Thread Tools Display Modes
07-23-10, 12:45 PM   #1
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Arrow Toggle party in raid - error

oUF gurus,

I am setting up my oUF layout and getting an error. Any help with my logic here would be great. This is not an oUF 1.4 compatible layout, will do that soon.

Error:
layout.lua:1463: attempt to index global 'party' (a nil value)

I highlighted and bolded line 1463 in red. This is the "party toggle in raid" section, which is causing the problems.



Code:
	
	--
	-- party 
	--


	if(not (playerClass=="PRIEST") and (showparty == true)) then
		local party = oUF:Spawn("header", "oUF_Party")
		party:SetManyAttributes(
		"showParty", true,
		"showSolo", false,
		"yOffset", 105)
		party:SetPoint("TOPLEFT", player, -245, 25)
		--party:SetAttribute("showRaid", true)
		
	end


	--
	-- partypets
	--
	
	if(not (playerClass=="PRIEST") and (showpartypets == true)) then
		local partypet = {}
		partypet[1] = oUF:Spawn('partypet1', 'oUF_PartyPet1')
		partypet[1]:SetPoint('TOPLEFT', party, 'TOPLEFT', -75, 0)
		for i =2, 4 do
			partypet[i] = oUF:Spawn('partypet'..i, 'oUF_PartyPet'..i)
			partypet[i]:SetPoint('TOP', partypet[i-1], 'BOTTOM', 0, 105)
		end
	end


	--
	-- raid
	--

	if (not(playerClass=="PRIEST") and (showraid == true)) then
		local raid = {} -- group 1-5 only
		for i = 1, 5 do
		table.insert(raid, oUF:Spawn("header", "oUF_Raid"..i))
		if i == 1 then
		raid[i]:SetPoint("LEFT", UIParent, "LEFT", 25, -25)
		else
		raid[i]:SetPoint("CENTER", raid[i-1], "CENTER", 0, -42)    
		end

		raid[i]:SetManyAttributes(    
		--"showParty", false,
		"showPlayer", true,  
		"showRaid", true,   
		"showSolo", false,
		"columnSpacing", 10,   -- default was 8
		"unitsPerColumn", 1,   
		"maxColumns", 5,   
		"columnAnchorPoint", "LEFT",   
		"xOffset", 12,   
		"groupFilter", i ) 
						
		end
	end
	


	--
	-- party toggle in raid
	--
	
	if (not (playerClass=="PRIEST")) then
		local partyToggle = CreateFrame('Frame')
		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")
				local numraid = GetNumRaidMembers()
				if numraid > 5 then
					if showparty == true then			
						party:Hide()
					end
					if showraid == true then
						raid:Show()
					end
				else
					if showparty == true then			
						party:Show()
					end
					if showraid == true then
						raid:Hide()
					end
				end
			end
		end)
	end
My entire layout if this helps: http://pastey.net/138864

Thanks!!

Last edited by Toran : 07-23-10 at 01:38 PM. Reason: Added pastey link
  Reply With Quote
07-23-10, 01:55 PM   #2
Dawn
A Molten Giant
 
Dawn's Avatar
AddOn Author - Click to view addons
Join Date: May 2006
Posts: 918
Try to wrap

Code:
if(not (playerClass=="PRIEST") and (showparty == true)) then

...

end
around your

Code:
Party:Hide/Show()
and remove it from the party and raid spawn, this might help.
__________________
Rock: "We're sub-standard DPS. Nerf Paper, Scissors are fine."
Paper: "OMG, WTF, Scissors!"
Scissors: "Rock is OP and Paper are QQers. We need PvP buffs."

"neeh the game wont be remembered as the game who made blizz the most money, it will be remembered as the game who had the most QQ'ers that just couldnt quit the game for some reason..."

  Reply With Quote
07-23-10, 02:06 PM   #3
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Dawn, tried that and get an error:

layout.lua:1467: attempt to call method 'Hide' (a nil value)

This refers to the last "raid:Hide()" call. Hmmm.
  Reply With Quote
07-23-10, 02:32 PM   #4
Sojik
A Wyrmkin Dreamwalker
 
Sojik's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 53
Originally Posted by Toran View Post
This is not an oUF 1.4 compatible layout, will do that soon.
How soon? Because this is very easy to fix in 1.4.
  Reply With Quote
07-23-10, 02:33 PM   #5
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Originally Posted by Sojik View Post
How soon? Because this is very easy to fix in 1.4.
I wasn't sure where to start. Checked Zork's guide, but couldn't match things up well to my (old) layout. Any suggestions?
  Reply With Quote
07-23-10, 02:38 PM   #6
Sojik
A Wyrmkin Dreamwalker
 
Sojik's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 53
I just rewrote my layout from scratch borrowing heavily from oUF_Freeb and oUF_Freebgrid, personally.
  Reply With Quote
07-23-10, 04:23 PM   #7
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Fixed. Didn't need all the raid conditionals in the party hide/show section. Thanks.
  Reply With Quote
07-24-10, 03:05 PM   #8
Toran
A Nerdscale Dorkin
 
Toran's Avatar
Premium Member
Join Date: May 2006
Posts: 143
Originally Posted by Sojik View Post
I just rewrote my layout from scratch borrowing heavily from oUF_Freeb and oUF_Freebgrid, personally.
Wish I had the time. Might try at some point, but will use my old layout until it breaks.
  Reply With Quote
07-24-10, 10:42 PM   #9
haste
Featured Artist
 
haste's Avatar
Premium Member
Featured
Join Date: Dec 2005
Posts: 1,027
If you use frequent update tags, then I'd urge you to update to 1.4. There's a pretty bad performance regression in 1.3.x.
__________________
「貴方は1人じゃないよ」
  Reply With Quote

WoWInterface » Featured Projects » oUF (Otravi Unit Frames) » Party spawn error in my layout

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off