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,953
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.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
01-25-10, 11:35 AM   #7
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   #8
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   #9
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   #10
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,953
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.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
01-25-10, 07:00 PM   #11
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   #12
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   #13
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,953
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.
__________________


Characters:
Gwynedda - 70 - Demon Warlock
Galaviel - 65 - Resto Druid
Gamaliel - 61 - Disc Priest
Gwynytha - 60 - Survival Hunter
Lienae - 60 - Resto Shaman
Plus several others below level 60

Info Panel IDs : http://www.wowinterface.com/forums/s...818#post136818
  Reply With Quote
01-25-10, 10:05 PM   #14
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Originally Posted by Xrystal View Post
Yep, standard addon functionality I'm afraid.
this was linked to me from the bliz forums, posted same question there.

http://forums.wowace.com/showthread.php?t=16669

i also had another idea.... what if... one were to take over the bliz function for setfocus on the drop down and replace it with lua code that runs the /focus slash cmd, and create your own setfocus frame that opens on unit watch..

if the bliz focus frame works on unitwatch then you dont need to make your own even. assuming the macro will fire from lua while in combat.

that work around that i posted the link to looks dicey to me but then im still a coding noob imo.
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]
  Reply With Quote
01-28-10, 09:04 AM   #15
AnrDaemon
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 156
I'm using keybind (Alt+F) to set focus.
I saw many discussions about addon being unable to set focus, and to create a macro for "/focus", but I'm failing to see how that would be more useful...
  Reply With Quote
01-28-10, 09:08 AM   #16
nightcracker
A Molten Giant
 
nightcracker's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 716
I have no idea how it works, but it's in my bookmarks:
http://paste.wowace.com/781/
__________________
Three things are certain,
Death, taxes and site not found,
You, victim of one.
  Reply With Quote
01-25-10, 08:05 PM   #17
Dayve
A Deviate Faerie Dragon
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 15
For the user setting to work the code snippet that runs in response to state change needs to reference the setting in a variable in its restricted environment; in the code I provided it is stored in "raidhideparty". After initialization and whenever the user setting changes it must be propagated into the restricted enviroment using :Execute, which is the purpose of the 3rd code extract in my first post, which effectively sets "ridehideparty" to be equal to the value in the user setting variable. That part could also be written like this for clarity (with the appropriate CVar used):
lua Code:
  1. RaidPartyHandler:Execute("raidhideparty = " .. tostring(GetCVarBool("hidePartyInRaid")));
  2. RaidPartyHandler:SetAttribute("state-unitexists", UnitExists("raid1"));
  Reply With Quote

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


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