SecureHandler template object fails visibility check
So, I'm currently trying to make a button that cancels aura on right mouse button and here's what I've got atm
Lua Code:
It currently fails at L#42 where I check cd's visibility. Would that be because cd itself is not a SecureHandler template object? |
You may check the RestrictedEnvironment.lua#L18-L94, the CancelUnitBuff can't be used in the secure snippets. Also none secure frames like the cooldown can't be used in the secure snippets.
You should use SecureActionButtonTemplate instead of the SecureHandlerClickTemplate Lua Code:
See SecureTemplates.lua#L443-L459 for details. |
To clarify, you can get frame references to unprotected frames in a secure scope, but you can't see them in a secure scope when you're in combat. :GetFrameRef will not return your frame if it's not protected.
https://github.com/Gethe/wow-ui-sour...es.lua#L76-L97 |
Many thanks to Kurapica and MunkDev.
Using SecureActionButtonTemplate did the trick :) It seems like you would need a unit attribute set as well to use cancelaura, btw ;) |
Just being curious with
Lua Code:
Can you hook the script when it actually calls cancelaura function(?) either by hooksecurefunc() or :HookScript()? |
Quote:
|
Quote:
That's easier than I thought :D |
All times are GMT -6. The time now is 01:57 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI