Thread Tools Display Modes
06-13-10, 11:48 AM   #1
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Secure raid handler

Okay so at one point I had this chunk of code working but now it no longer works...maybe because i messed with it maybe because i changed the way party frames work. it should show/hide partyframes in raid entering/exiting according to the blizz option set. partyframes of course being attached to GrimPartyMain

any ideas? as you can see its commented out. last piece to fix for some perfect and very sweet party frames. two styles to chose from and movable!

lua Code:
  1. -----------------------------------
  2. -- GUI Party Frame main creation.
  3. -----------------------------------
  4. local GrimPartyMain = CreateFrame("Frame", "GrimPartyMain", UIParent, "SecureHandlerStateTemplate");
  5.  
  6. --SecureHandler_OnLoad(GrimPartyMain);
  7.  
  8.  
  9. --GrimPartyMain:SetFrameRef("GrimPartyMain", GrimPartyMain);
  10.  
  11. --GrimPartyMain:Execute([[
  12. --GrimPartyMain = self:GetFrameRef("GrimPartyMain");
  13. --]]);
  14.  
  15. --GrimPartyMain:Execute("raidhideparty = " .. tostring(GetCVar("hidePartyInRaid"))); -- hook to Blizzard option for party raid hide frames
  16.  
  17.  
  18. --GrimPartyMain:SetAttribute("_onstate-unitexists", [[
  19. --  --if raidhideparty == 1 and newstate then
  20. --  --GrimPartyMain:Hide()
  21. --  --end
  22. --  --if raidhideparty ~= 1 and newstate then
  23. --  --GrimPartyMain:Show()
  24. --  --end
  25. --]]);
  26.  
  27. --GrimPartyMain:SetAttribute("unit", "raid1");
  28. --GrimPartyMain(GrimPartyMain, true);
  29.  
  30. --GrimPartyMain:SetAttribute("state-unitexists", UnitExists("raid1"));


edit --

i should point out i have this function in another file that loads after the function above...

its in the options file and once again partly commented out so i could test if the dummy on the hide/show was the problem but it did not appear to be. although i could see this being a problem one way or the other.

lua Code:
  1. function GrimUI:PartyHideShowFunc()
  2.    
  3.     if GrimUIData.GUIPartyFrame == "show" then
  4.     --GrimPartyMain.Show = GrimPartyMain:Show()
  5.     GrimPartyMain:Show()
  6.     --GrimPartyMain.Hide = GrimUI.Dummy
  7.    
  8.     end
  9.     if GrimUIData.GUIPartyFrame == "hide" then
  10.     --GrimPartyMain.Hide = GrimPartyMain:Hide()
  11.     GrimPartyMain:Hide()
  12.     --GrimPartyMain.Show = GrimUI.Dummy
  13.     end
  14. end
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 06-13-10 at 11:52 AM.
  Reply With Quote
06-13-10, 01:49 PM   #2
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
Seems like it would be easier if you used RegisterStateDriver:
Code:
local GrimPartyMain = CreateFrame('Frame', "GrimPartyMain", UIParent, 'SecureHandlerStateTemplate')
GrimPartyMain:SetAttribute("_onstate-group", "self[newstate](self)")

for index = 1, MAX_PARTY_MEMBERS do
	_G['PartyMemberFrame' .. index]:SetParent(GrimPartyMain)
end
PartyMemberBackground:SetParent(GrimPartyMain)

local state
if GetCVarBool('hidePartyInRaid') then
	state = "[group:raid] Hide; [group:party] Show; Hide"
else
	state = "[group] Show; Hide"
end
RegisterStateDriver(GrimPartyMain, "group", state)
  Reply With Quote
06-13-10, 02:01 PM   #3
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
hmm does that check the variable for show in raid from the bliz functions though? dos not look like it but then secure code doesn't always look like what it should lol.

Its become somewhat trivial now anyhow... im totally lost on what to do about the upvalue issue... I thought i had a grasp on the tables now but... and even if i do i just dont know how to do it any different and still have everything work the way it should. gonna post the whole thing iin the upvalue thread...
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Secure raid handler


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