• 0

    posted a message on Omen3
    Spanish localization is attached.

    Disclaimer: I'm not a native speaker, so there are bound to be errors. ;)
    Posted in: Raid AddOns
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    For some reason I thought you and the person asking about hiding raid frames in battlegrounds were the same person, so I used your function. Anyway, Will, I'd change that to..
    local partyToggle = CreateFrame('Frame')
    partyToggle:RegisterEvent('PLAYER_LOGIN')
    partyToggle:RegisterEvent('RAID_ROSTER_UPDATE')
    partyToggle:RegisterEvent('PARTY_LEADER_CHANGED')
    partyToggle:RegisterEvent('PARTY_MEMBER_CHANGED')
    partyToggle:SetScript('OnEvent', function(self)
    	if(InCombatLockdown()) then
    		self:RegisterEvent('PLAYER_REGEN_ENABLED')
    	else
    		self:UnregisterEvent('PLAYER_REGEN_ENABLED')
    		local _, zonetype = IsInInstance()
    		if(zonetype == 'pvp') then
    			party:Hide()
    			for _, v in ipairs(Raid) do v:Hide() end
    		else
    			if(GetNumRaidMembers() > 0) then
    				party:Hide()
    				for _, v in ipairs(Raid) do v:Show() end
    			else
    				party:Show()
    				for _, v in ipairs(Raid) do v:Hide() end
    			end
    		end
    	end
    end)
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Try..
    local partyToggle = CreateFrame('Frame')
    partyToggle:RegisterEvent('PLAYER_LOGIN')
    partyToggle:RegisterEvent('RAID_ROSTER_UPDATE')
    partyToggle:RegisterEvent('PARTY_LEADER_CHANGED')
    partyToggle:RegisterEvent('PARTY_MEMBER_CHANGED')
    partyToggle:SetScript('OnEvent', function(self)
    	if(InCombatLockdown()) then
    		self:RegisterEvent('PLAYER_REGEN_ENABLED')
    	else
    		self:UnregisterEvent('PLAYER_REGEN_ENABLED')
    		local zone = GetRealZoneText()
    		if(zone == 'Warsong Gulch' or zone == 'Arathi Basin' or zone == 'Alterac Valley' or zone == 'Eye of the Storm') then
    			party:Hide()
    			for i, v in ipairs(Raid) do v:Hide() end
    			for i, v in ipairs(pets) do
    				UnregisterUnitWatch(v)
    				v:Hide()
    			end
    		else
    			if(GetNumRaidMembers() > 0) then
    				party:Hide()
    				for _, v in ipairs(Raid) do v:Show() end
    				for i, v in ipairs(pets) do
    					UnregisterUnitWatch(v)
    					v:Hide()
    				end
    			else
    				party:Show()
    				for _, v in ipairs(Raid) do v:Hide() end
    				for i, v in ipairs(pets) do
    					RegisterUnitWatch(v)
    					v:Show()
    				end
    			end
    		end
    	end
    end)


    I didn't check to see if those are the exact zone names for the BGs, so if that doesn't work, you might want to check the names.
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Assuming you're using haste's latest version with the Enable() and Disable() functions, try...
    local partytarget = {}
    for i = 1, 5 do
    	partytarget[i] = oUF:Spawn("party"..i.."target", "oUF_Party"..i.."Target")
    	if i == 1 then
    		partytarget[i]:SetPoint("TOPLEFT", party, "TOPRIGHT", 8, 0)
    	else
    		partytarget[i]:SetPoint("TOP", partytarget[i-1], "BOTTOM", 0, -4)
    	end
    end
    
    local partyToggle = CreateFrame('Frame')
    partyToggle:RegisterEvent('PLAYER_LOGIN')
    partyToggle:RegisterEvent('RAID_ROSTER_UPDATE')
    partyToggle:RegisterEvent('PARTY_LEADER_CHANGED')
    partyToggle:RegisterEvent('PARTY_MEMBER_CHANGED')
    partyToggle:SetScript('OnEvent', function(self)
    	if(InCombatLockdown()) then
    		self:RegisterEvent('PLAYER_REGEN_ENABLED')
    	else
    		self:UnregisterEvent('PLAYER_REGEN_ENABLED')
    		if(GetNumRaidMembers() > 0) then
    			party:Hide()
    			for i,v in ipairs(partytarget) do
    				v:Disable()
    			end
    		else
    			party:Show()
    			for i,v in ipairs(partytarget) do
    				v:Enable()
    			end
    		end
    	end
    end)
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    In the latest 3.0 patch line 38 in ouf.lua is throwing an error because UnitReactionColor is nil. Being lazy and not wanting to figure out what's changed until wowcompares posts this patch's data, I just added the old UnitReactionColor table to my ouf.lua.
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Try
    local PartyTargets = {}
    for i = 1, 5 do
    	PartyTargets[i] = oUF:Spawn("party"..i.."target", "oUF_Party"..i.."Target")
    	PartyTargets[i]:SetAttribute('showRaid', false)
    	if i == 1 then
    		PartyTargets[1]:SetPoint("TOPLEFT", party, "TOPRIGHT", 8, 0)
    	else
    		PartyTargets[i]:SetPoint("TOP", PartyTargets[i-1], "BOTTOM", 0, -4)
    	end
    end

    or
    if(GetNumRaidMembers() > 0) then
    	party:Hide()
    	for i = 1, 5 do
    		PartyTargets[i]:Hide()
    	end
    else
    	party:Show()
    	for i = 1, 5 do
    		PartyTargets[i]:Show()
    	end
    end
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    gsub('%.0(k|m)$', %1)

    ?
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts

    Thanks Zariel. Actually this worked for the party frame doing if self:GetParent():GetName() == "oUF_Party" then but not the raid frame for some reason however I've managed to do what I intended by using if (not unit) for the raid and the above for the party so its working Thank you!


    For the raid frame I believe it needs to be
    self:GetParent():GetName():match('^oUF_Raid')

    There are actually 8 frames that are matched by that, the headers for each group in a raid.. oUF_Raid1 through oUF_Raid8.
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    Quote from zariel »

    try printing each argument to check that they are correct

    Well I've determined that the unit argument has nil value.

    Quote from haste »

    Easy solution: Don't run such updates in the setStyle function.

    What would be a better way to go about it?

    I tried iterating through the raid frames and assigning a font string to each with:

    local numRaidMembers = GetNumPartyMembers()
    
    for i = 1, 8 do
    	local stop = false
    	for j = 1, 5 do
    		if i == 1 then
    			cur = j
    		else
    			cur = ((i-1)*5)+j
    		end
    		if cur > numRaidMembers then
    			stop = true
    			break
    		end
    		local thisFrame = "oUF_Raid"..i.."UnitButton"..j
    		local name = thisFrame.."name"
    		local color = RAID_CLASS_COLORS[select(2, UnitClass("raid"..cur))]
    		thisFrame:CreateFontString(name, "OVERLAY")
    		name:SetFont(fontStyle, fontHeight)
    		name:SetShadowColor(0,0,0)
    		name:SetShadowOffset(0.8, -0.8)
    		name:SetTextColor(color.r, color.g, color.b)
    		name:SetJustifyH("LEFT")
    		name:SetPoint("TOP", 0, 0)
    		name:SetText(UnitName("raid"..cur))
    		name.UNIT_NAME_UPDATE = updateName
    	end
    	if stop == true then break end
    end

    That attempt is probably way off, and hasn't even taken into consideration updating when people join/leave, but I'm learning as I go. That bit is throwing the error: "attempt to call method 'CreateFontString' (a nil value)"
    Posted in: Unit Frames
  • 0

    posted a message on Unofficial oUF - methods used for layouts
    I wrote this all out once and then lost it, I don't feel like retyping everything so I'll be fairly succinct.

    I'm using a modified version of P3lim's layout.

    The default has this in updateRaidHealth():

    local color = RAID_CLASS_COLORS[select(2, UnitClass(unit))]
    if(color) then bar:SetStatusBarColor(color.r, color.g, color.b) end


    I'm putting names on the raid bars and want to colour them according to class, so I modified setFontString() and setRaidStyle() to the following:

    local setFontString = function(parent, fontStyle, fontHeight, fontR, fontG, fontB)
    	local fs = parent:CreateFontString(nil, "OVERLAY")
    	fs:SetFont(fontStyle, fontHeight)
    	fs:SetShadowColor(0,0,0)
    	fs:SetShadowOffset(0.8, -0.8)
    	fs:SetTextColor(fontR, fontG, fontB)
    	fs:SetJustifyH("LEFT")
    	return fs
    end
    
    local setRaidStyle = function(settings, self, unit)
    
    	...
    
    	local color = RAID_CLASS_COLORS[select(2, UnitClass(unit))]
    	self.Name = setFontString(hp, fontnormal, 10, color.r, color.g, color.b)
    	self.Name:SetPoint("TOP", 0, 0)
    	self.UNIT_NAME_UPDATE = updateName
    	
    	...
    
    	return self
    end


    I get the following error:


    Interface\Addons\oUF_P3lim\oUF_P3limRaid.lua:
    71: Usage: UnitClass("unit")


    Obviously UnitClass() is being fed invalid input, but I have no idea why. I haven't been able to find where these functions are being called to see what is being passed to them.
    Posted in: Unit Frames
  • 0

    posted a message on Sanity 2.0
    I just started using Sanity 2 and I noticed that the strata of the backdrop is higher than that of the text, I looked through the XML and lua files but couldn't find anything obvious to change to fix it. I uploaded a screenshot as an example.

    http://sotilas.monkeh.net/sanity.jpg

    Anyone suggestions to fix it?
    Posted in: General AddOns
  • To post a comment, please or register a new account.