Quantcast
How to call functions on protected ui objects? - WoWInterface
Thread Tools Display Modes
10-14-20, 09:07 AM   #1
Lybrial
A Flamescale Wyrmkin
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 103
How to call functions on protected ui objects?

Im currently getting two errors:

Lua Code:
  1. AddOn 'Lybrial_ActionBars' tried to call the protected function 'SpellFlyout:SetFrameStrata()'.

And:

Lua Code:
  1. AddOn 'Lybrial_UI' tried to call the protected function 'Lybrial_ActionBars_Pet_Frame:Show()'.
  2. in function `FadeIn'

How can do either of those two things?

1. Call those functions anyway?
2. Prevent those functions from getting called when they are secured / protected?

For option two I thought checking for "IsForbidden()" would do the trick but I was wrong, meaning this here:

Lua Code:
  1. if (not _G.SpellFlyout:IsForbidden()) then
  2.     _G.SpellFlyout:SetFrameStrata("HIGH")
  3. end

And this:

Lua Code:
  1. if (not frame:IsForbidden()) then
  2.     UIFrameFadeIn(frame, 0.2, frame:GetAlpha(), 1);
  3. end

Did not fix the errors.
  Reply With Quote
10-14-20, 10:04 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 1,973
frame:IsForbidden()frame:IsProtected()

Forbidden frames means you can't interact with them at all. Protected frames just have limited access to a handful of functions while in combat. (see InCombatLockdown())
__________________
ESOUI AddOns | WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
10-14-20, 10:32 AM   #3
Lybrial
A Flamescale Wyrmkin
AddOn Compiler - Click to view compilations
Join Date: Jan 2010
Posts: 103
Thank you, that solved it.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » How to call functions on protected ui objects?

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