View Single Post
10-23-15, 03:58 PM   #10
lightspark
A Rage Talon Dragon Guard
 
lightspark's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2012
Posts: 341
Originally Posted by LanceDH View Post
Had no clue :Hide() also caused errors in combat so can't say I 'protected' any of those.
I guess PLAYER_REGEN_DISABLED, where I hide everything when combat starts, happens before errors start happening.
Will have to fix that now that I know.
Unfortunately, many things cause taints, some things can't be used by 3rd party, others are restricted to not-in-combat times. Taken from InCombatLockdown function description. Read description on that page, it says what you can't do to a frame.

While in combat:
  • Programatic modification of macros or bindings is not allowed.
  • Some things can't be done on "Protected" frames, their parents, or any frame they are anchored to. These include, but are not restricted to:
    • Hiding the frame using Hide widget method.
    • Showing the frame using Show widget method.
    • Changing the frame's attributes (custom attributes are used by Blizzard secure templates to set up their behavior).
    • Moving the frame by resetting frame's points or anchors (movements initiated by user are still allowed while in combat).


Originally Posted by LanceDH View Post
Wouldn't it be worth it to create frames in XML and use SetScript with local functions in LUA?
Or does the XML itself cause issues?
Having done it both ways now I must say I find XML to make the base for frames a lot easier to use and keep track of things, and doesn't clutter my LUA files as much.
Sure, XML-templates are quite handy, XML is a markup language for a reason. However, debugging things that happens there isn't cool, and you have to expose quite much, it's never 100% safe T_T I also liked this approach in the past, but it's really leaky...

If you need to use same template many times, instead creating XML-template, create constructor for this widget in Lua. It's easier to debug, it's more flexible and more secure.

P.S. And semlar, as always, explained everything nicely. But I, being a lazy ass, said to almost never use blizz stuff, if they implemented it in Lua. That's almost always true for their OnClick handlers and quite many other functions. I just think it's safest, yet dumbest approach, works for me Ofc there are few handy exceptions, which are safe to use.
__________________

Last edited by lightspark : 10-23-15 at 04:08 PM.
  Reply With Quote