Thread Tools Display Modes
02-25-10, 12:30 PM   #1
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Party frames in arena

Is there an obvious reason why my party frames do not show up in arenas?
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
02-25-10, 01:22 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Do you have them set to hide when in raid?
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
02-26-10, 09:50 AM   #3
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
i have party frames set to hide in raid. Well actually... my code checks to see what the blizzard option is set to to decide that... but i always have mine checked to hide them in raid. When you are in the arena it thinks you are in a raid?

My party frames have some issues with hiding and showing properly all the time in general. like for some reason when you queue for wintersgrasp it does not hide the party frames like its supposed to. You have to /reload to get it to register but yet if you are in a party and the party leader shifts it to a raid it changes up just fine. I have PLAYER_ENTERING_WORLD set as one of the events to check against so i would think it would fire when entering wintersgrasp and fix the party frames. But it does not...

I had a problem with the party frames not showing up after being in a raid and everyone dropping from a dungeon. I think i fixed that although im sure if you were to drop raid while in combat it would fire taint since my fix was not secure code.

Also have a funny issue with the party leader icons, if you go to a random with a friend and you finish the random if you both stay partied and everyone else drops and you leave the dungeon it for some reason thinks you are both the party leader and the leader icon gets stuck. Only does this for party member 1. The other ones seem to function right when this same scenario is recreated.

IE having 3 friends... its only partyframe 1 that gets the leader icon stuck. partyframe 2's leader icon functions proper.

I would post my partyframes code but..... i wouldnt expect anyone to look through it its almost 12000 lines... - edit: i take that back its about 6000 lines and thats with most of the 2nd layout missing and no petframes for either layout....
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 02-26-10 at 09:58 AM.
  Reply With Quote
02-26-10, 09:55 AM   #4
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
partyframes

i weeded out the parts that deal with the hiding/showing

lua Code:
  1. -----------------------------------------
  2. ---- hide party frames in raid Start ----
  3. -----------------------------------------
  4.  
  5. local RaidPartyHandler = CreateFrame("Frame", "RaidPartyHandler", UIParent, "SecureHandlerStateTemplate");
  6. SecureHandler_OnLoad(RaidPartyHandler);
  7. GrimUI.RaidPartyHandler = RaidPartyHandler
  8.  
  9. GrimPartyMain = CreateFrame("Frame", nil, RaidPartyHandler);
  10. GrimUI.GrimPartyMain = GrimPartyMain
  11.  
  12.  
  13. RaidPartyHandler:SetFrameRef("GrimPartyMain", GrimPartyMain);
  14.  
  15. RaidPartyHandler:Execute([[
  16. GrimPartyMain = self:GetFrameRef("GrimPartyMain");
  17. ]]);
  18.  
  19. RaidPartyHandler:Execute("raidhideparty = " .. tostring(GetCVar("hidePartyInRaid"))); -- hook to Blizzard option for party raid hide frames
  20.  
  21.  
  22. RaidPartyHandler:SetAttribute("_onstate-unitexists", [[
  23.     if raidhideparty == 1 and newstate then
  24.     GrimPartyMain:Hide()
  25.     end
  26.     if raidhideparty ~= 1 and newstate then
  27.     GrimPartyMain:Show()
  28.     end
  29. ]]);
  30.  
  31. RaidPartyHandler:SetAttribute("unit", "raid1");
  32. RegisterUnitWatch(RaidPartyHandler, true);
  33.  
  34.  
  35.  
  36. RaidPartyHandler:SetAttribute("state-unitexists", UnitExists("raid1"));
  37.  
  38. -----------------------------------------
  39. ---- hide party frames in raid End   ----
  40. -----------------------------------------
  41.  
  42. ---------------------------------------
  43. -- show them again when you leave it heh....
  44. ----------------------------------------------
  45. local ReshowPartyFrames = CreateFrame("Frame", nil, UIParent)
  46. ReshowPartyFrames:RegisterEvent("RAID_ROSTER_UPDATE")
  47. ReshowPartyFrames:RegisterEvent("PLAYER_ENTERING_WORLD")
  48.  
  49. GrimUI.ReshowPartyFrames = ReshowPartyFrames
  50.  
  51. ReshowPartyFrames:SetScript("OnEvent", function(self)
  52.    
  53.     local StillInRaid = UnitExists("raid1")
  54.    
  55.     if event == "PLAYER_ENTERING_WORLD" and StillInRaid ~= 1 then
  56.     GrimPartyMain:Show()
  57.     end
  58.    
  59.    
  60.     if StillInRaid ~= 1 then
  61.     GrimPartyMain:Show()
  62.     end
  63.  
  64. end)
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
02-26-10, 03:46 PM   #5
Shadowed
...
Premium Member
Featured
Join Date: Feb 2006
Posts: 387
There's a simpler way of doing it. You don't need to muck around with the secure system as much: partyFrame is the secure header that shows the party frame.

lua Code:
  1. local stateMonitor = CreateFrame("Frame", nil, nil, "SecureHandlerBaseTemplate")
  2.         stateMonitor:SetFrameRef("partyHeader", partyFrame)
  3.         stateMonitor:WrapScript(stateMonitor, "OnAttributeChanged", [[
  4.             if( name ~= "state-raidmonitor" ) then return end
  5.            
  6.             if( self:GetAttribute("state-raidmonitor") == "raid" ) then
  7.                 self:GetFrameRef("partyHeader"):Hide()
  8.             else
  9.                 self:GetFrameRef("partyHeader"):Show()
  10.             end
  11.         ]])
  12.         RegisterStateDriver(stateMonitor, "raidmonitor", "[target=raid1, exists] raid; none")

That is a simplified version of what Shadowed Unit Frames does, https://gist.github.com/6323ba8bb2a9a4365413 is the full version which let's me do things like modify the stateMonitors attributes to decide whether or not I want the feature enabled.

You have to WrapScript before you call RegisterStateDriver, because as soon as you call RegisterStateDriver it's going to check the state and it'll switch to raid (or none) before your attribute event is setup.
  Reply With Quote
02-26-10, 05:15 PM   #6
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
so wait what your saying is i can hook my party frames to partyFrame? and use that stateheader to control the party frames? and it will register the bliz option as well?
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
02-27-10, 04:48 AM   #7
Dayve
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 15
Originally Posted by Shadowed View Post
There's a simpler way of doing it. You don't need to muck around with the secure system as much: partyFrame is the secure header that shows the party frame.
Both versions use secure code to respond to a state attribute change, but Grimsin's method (which is my old method that I told him about) uses UnitWatch to set the state while yours uses a state driver. What is simpler is this method which I started using recently:
lua Code:
  1. RegisterStateDriver(partyFrame, "visibility", "[@raid1,exists]hide;show");
That will enable in-raid hiding on partyFrame, no other code required. And to disable it after having been enabled:
lua Code:
  1. UnregisterStateDriver(partyFrame, "visibility");
  2. partyFrame:Show();
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Party frames in arena


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