Thread Tools Display Modes
01-24-10, 07:39 PM   #1
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
darn taint

what should i do about this?

1x <event>ADDON_ACTION_BLOCKED:AddOn '!GrimUI' tried to call the protected function 'PartyMemberFrame1:Hide()'.
<in C code>: in function `Hide'
Interface\FrameXML\PartyMemberFrame.lua:111: in function `PartyMemberFrame_UpdateMember':
Interface\FrameXML\PartyMemberFrame.lua:317: in function `PartyMemberFrame_OnEvent':
<string>:"*:OnEvent":1: in function `OnEvent'
Interface\FrameXML\UnitFrame.lua:417: in function <Interface\FrameXML\UnitFrame.lua:415>:
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
01-24-10, 08:21 PM   #2
wurmfood
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 122
You're trying to hide stuff during combat, which you can't do.
  Reply With Quote
01-24-10, 08:37 PM   #3
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
yes you can.

Im just not sure how.

I think i may have fixed that problem by disabling the onevent and setscript for the partyframes. Problem though is how to hide my own partyframes when changing to a raid and in combat....

somehow you can show/hide secure frames in combat does anyone know? i know this much... i think it has to do with doing a setattribute but im not sure how to do a setattribute with my own function in it... wowwikki gets hard to follow on this area...
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
01-24-10, 10:06 PM   #4
acapela
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 241
dunno if this is what will work for you, but...

something that worked for me in Aloft was to UIObject:SetAlpha() to zero (0).

a bit tricky with nameplates, as this leaves the frame assembly "invisible" but still sensitive to the mouse, which can generically affect clicking on the WorldFrame, but Frame:EnableMouse() is also protected in combat (which resulted in disabled nameplate frame assemblies being recycled in combat, and then coming back into range assigned to a different unit but with the mouse still disabled; this might be less a problem with something static like a unit frame).

edit: depending on the nature of the object being hidden, it is my perception that Region:Hide() can indeed be "protected" in combat. this is true of the root frame in a nameplate assembly, for instance.
__________________
Retired author/maintainer of Aloft (the nameplate addon)
http://www.wowinterface.com/download...AloftBeta.html
-----
Zippy said it best: "All life is a BLUR of Republicans and Meat!"

Last edited by acapela : 01-24-10 at 10:09 PM.
  Reply With Quote
01-24-10, 10:15 PM   #5
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
it is protected in deed. If i understand things right you can use SetAttribute with a secure template of somekind to hide show frames in combat.

--- edit ---

heh just ran into a related issue. hiding the party frames is not only protected i used register unit watch to show/hide them in the first place how the heck do i hide those now? lol. need to hide them when joining a raid....
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
01-24-10, 10:20 PM   #6
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
Wouldn't it be easier ( assuming it's possible ) to have the attributes mark the frame as "player", "party1", "raid1" as required depending on the situation. That way you won't need to hide the frame at all.
__________________
  Reply With Quote
01-24-10, 10:37 PM   #7
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
one would think right but the problem is blizzards api does not automaticlly hide party frames when you change to a raid.....or at lest i dont thnk it does lol.

-- Okay it does but my frames are named different. SO of course it does not hide them on its own. fixed that part except of course it most likly will not do it in combat.


-- another edit --
i either need to make it hold off doing anything that would be secure until combat ends or figure out how to show/hide frames in combat.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 01-24-10 at 11:16 PM.
  Reply With Quote
01-24-10, 11:24 PM   #8
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,359
I'm not sure we're talking about the same thing as I only read the current page of comments but,
there _is_ a setting in the default client to hide party interface when joining a raid.

It's under Options(Esc)->Interface->Game tab->UnitFrames->"Hide party interface in Raid".
  Reply With Quote
01-24-10, 11:38 PM   #9
Dayve
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 15
I managed to accomplish this in my own unit/raid frames by parenting the party frames to one frame and hiding that frame using a SecureHandlerStateTemplate (which also doubles as the main table for the addon).
Creation:
lua Code:
  1. local main = CreateFrame("Frame", "DayveUF_Main", UIParent, "SecureHandlerStateTemplate");
  2. SecureHandler_OnLoad(main);
  3. main.partyMain = CreateFrame("Frame", nil, main);
Initialisation:
lua Code:
  1. self:SetFrameRef("PartyMain", self.partyMain);
  2. self:Execute([[
  3.     PartyMain = self:GetFrameRef("PartyMain");
  4. ]]);
  5. self:SetAttribute("_onstate-unitexists", [[
  6.     if raidhideparty and newstate then
  7.         PartyMain:Hide()
  8.     else
  9.         PartyMain:Show()
  10.     end
  11. ]]);
  12. self:SetAttribute("unit", "raid1");
  13. RegisterUnitWatch(self, true);
And to turn the behaviour on or off to reflect the user's setting:
lua Code:
  1. self:Execute(self.save.raidhideparty and [[
  2.     raidhideparty = true;
  3. ]] or [[
  4.     raidhideparty = false;
  5. ]]);
  6. self:SetAttribute("state-unitexists", UnitExists("raid1"));
  Reply With Quote
01-25-10, 09:09 AM   #10
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
That is exactly what im talking about

so that last part about the settings, that registers it to function based on the users selection in the blizzard options as far as raid party hide? trying right now to work this into my code
thanks a lot!
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
01-25-10, 09:59 AM   #11
Dayve
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 15
It uses the setting in my mod's saved variables, replace self.save.raidhideparty with whatever variable you want the setting to come from; I think the default UI setting is in HIDE_PARTY_INTERFACE
  Reply With Quote
01-25-10, 10:16 AM   #12
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
so the hide party in raid is an option you have in your addon?

im kinda over whelmed atm, everything got real complicated when it came to party frames since i made it so there was different party layouts to accommodate for various screen sizes. The way i did things the majority of the ui size and scale never changes just two pieces of art those two pieces of art dictate that action button space and... you guessed it the party member and raid member space.

so let me see if i under stand. you hook the partyframes that have the unitwatch party1 so on and soo on to the secure handler for the raid watch part?
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
01-25-10, 10:35 AM   #13
Dayve
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 15
Originally Posted by Grimsin View Post
so the hide party in raid is an option you have in your addon?
Yes, the addon in question is a combined unit+raid frames addon (not publicly available btw).

Your understanding is pretty much correct; to put things clearly: the party frames are individually shown/hidden as normal using unitwatch, and their shared parent frame is shown/hidden by the state handler (which can be the parent frame itself, or another frame as in my code) using a secure code snippet that responds to unitwatch state for the raid1 unit.
  Reply With Quote
01-25-10, 11:35 AM   #14
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
no luck yet.... i think it has to do with to many frames hooked to each other it does not show hide the right ones or something.... i dont know. the base looks like this

lua Code:
  1. -- party frame 1 unit watch
  2. local GrimMPartyFrame1 = CreateFrame("frame", "GrimMPartyFrame1", GrimPartyMain, "SecureUnitButtonTemplate")
  3. GrimMPartyFrame1:SetAttribute('unit', 'party1')
  4. RegisterUnitWatch(GrimMPartyFrame1)
  5.  
  6. GrimUI.GrimMPartyFrame1 = GrimMPartyFrame1
  7.  
  8. -- party frame 2 unit watch
  9. local GrimMPartyFrame2 = CreateFrame("frame", "GrimMPartyFrame2", GrimPartyMain, "SecureUnitButtonTemplate")
  10. GrimMPartyFrame2:SetAttribute('unit', 'party2')
  11. RegisterUnitWatch(GrimMPartyFrame2)
  12.  
  13. GrimUI.GrimMPartyFrame2 = GrimMPartyFrame2
  14.  
  15. -- party frame 3 unit watch
  16. local GrimMPartyFrame3 = CreateFrame("frame", "GrimMPartyFrame3", GrimPartyMain, "SecureUnitButtonTemplate")
  17. GrimMPartyFrame3:SetAttribute('unit', 'party3')
  18. RegisterUnitWatch(GrimMPartyFrame3)
  19.  
  20. GrimUI.GrimMPartyFrame3 = GrimMPartyFrame3
  21.  
  22. -- party frame 4 unit watch
  23. local GrimMPartyFrame4 = CreateFrame("frame", "GrimMPartyFrame4", GrimPartyMain, "SecureUnitButtonTemplate")
  24. GrimMPartyFrame4:SetAttribute('unit', 'party4')
  25. RegisterUnitWatch(GrimMPartyFrame4)
  26.  
  27. GrimUI.GrimMPartyFrame4 = GrimMPartyFrame4
  28.  
  29. ---- hide party frames in raid ----
  30.  
  31.  
  32.  
  33. local RaidPartyHandler = CreateFrame("Frame", "RaidPartyHandler", UIParent, "SecureHandlerStateTemplate");
  34. SecureHandler_OnLoad(RaidPartyHandler);
  35. RaidPartyHandler.GrimPartyMain = CreateFrame("Frame", nil, RaidPartyHandler);
  36.  
  37.  
  38.  
  39. RaidPartyHandler:SetFrameRef("GrimPartyMain", RaidPartyHandler.GrimPartyMain);
  40. RaidPartyHandler:Execute([[
  41. GrimPartyMain = self:GetFrameRef("GrimPartyMain");
  42. ]]);
  43. RaidPartyHandler:SetAttribute("_onstate-unitexists", [[
  44.     if newstate then
  45.     GrimPartyMain:Hide()
  46.     else
  47.     GrimPartyMain:Show()
  48.     end
  49. ]]);
  50.  
  51. RaidPartyHandler:SetAttribute("unit", "raid1");
  52. RegisterUnitWatch(RaidPartyHandler, true);
  53.  
  54. RaidPartyHandler:SetAttribute("state-unitexists", UnitExists("raid1"));
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
01-25-10, 11:55 AM   #15
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
FIGURED IT OUT!! thanks a lot !
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
01-25-10, 04:49 PM   #16
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
now trying to make the variable it checks come from theblizzard one but... not happening so far.

how would you check the blizz variables in this case? getcvar in the brackets does nothing
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
01-25-10, 06:08 PM   #17
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
Originally Posted by Grimsin View Post
now trying to make the variable it checks come from theblizzard one but... not happening so far.

how would you check the blizz variables in this case? getcvar in the brackets does nothing
I usually dabble in the options screen that sets the variable and see how they set it, then grab it from that.

eg.
local uiScaling = GetCVar("useUiScale");
local uiScale = tonumber(GetCVar("uiScale"));

I use those in my nUI InfoPanel plugins when I need to ensure scaling values in the options are taken into account. Example : FontSize 10 at scale of 1.0 would be too small at scale or 0.6 so I check the scale and then use a higher fontsize so that it still looks fine.
__________________
  Reply With Quote
01-25-10, 07:00 PM   #18
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
yea the problem is i cant put those into secure template functions. or at lest em not sure how i think they need to be woven into the execute but..
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
01-25-10, 07:31 PM   #19
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
just found out that set focus on the dropdown menu is blocked for my party and player frames
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
01-25-10, 07:50 PM   #20
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,877
Originally Posted by Grimsin View Post
just found out that set focus on the dropdown menu is blocked for my party and player frames
Yep, standard addon functionality I'm afraid.
__________________
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » darn taint

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