View Single Post
11-21-08, 03:11 PM   #255
Caellian
A Frostmaul Preserver
 
Caellian's Avatar
Join Date: May 2006
Posts: 281
I would like to have some help with this, i'll paste a part of my frames spawn code below. After WotLK my wife had to respec her shaman to resto and asked me to include the player frame in the party, that wasn't too complicated but then i found no way to have the party targets to work accordingly.
So in short what i need to do with this is add the player frame to the party with its target added to the list of the party targets. Could anyone help ?

Code:
local party = oUF:Spawn('header', 'oUF_Party')
party:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', 15, -15)
party:SetManyAttributes('yOffset', -5, 'showParty', true)

local partyToggle = CreateFrame('Frame')
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', 5, 0)
	else
		partytarget[i]:SetPoint('TOP', partytarget[i-1], 'BOTTOM', 0, -5)
	end
end

local raid = {}
for i = 1, 8 do
	local raidgroup = oUF:Spawn('header', 'oUF_Raid'..i)
	raidgroup:SetManyAttributes('groupFilter', tostring(i), 'showRaid', true, 'yOffSet', -5)
	table.insert(raid, raidgroup)
	if(i==1) then
		raidgroup:SetPoint('TOPLEFT', UIParent, 'TOPLEFT', 15, -15)
	else
		raidgroup:SetPoint('TOPLEFT', raid[i-1], 'TOPRIGHT', 5, 0)
	end
end

partyToggle:RegisterEvent('PLAYER_LOGIN')
partyToggle:RegisterEvent('RAID_ROSTER_UPDATE')
partyToggle:RegisterEvent('PARTY_LEADER_CHANGED')
partyToggle:RegisterEvent('PARTY_MEMBERS_CHANGED')
partyToggle:SetScript('OnEvent', function(self)
	if(InCombatLockdown()) then
		self:RegisterEvent('PLAYER_REGEN_ENABLED')
	else
		self:UnregisterEvent('PLAYER_REGEN_ENABLED')
		if(GetNumRaidMembers() > 5) then
			party:Hide()
			for i,v in ipairs(raid) do v:Show() end
			for i,v in ipairs(partytarget) do v:Disable()	end
		else
			party:Show()
			for i,v in ipairs(raid) do v:Hide() end
			for i,v in ipairs(partytarget) do v:Enable() end
		end
	end
end)
__________________
if (sizeof(workload) > sizeof(brain_capacity)) { die('System Overload'); }