New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frames inheriting SecureActionButtonTemplate no longer execute SecureActionButton_OnClick #268
Comments
This works fine for me, although there is one limitation I have discovered. You need to make sure that RegisterForClicks matches the CVar ActionButtonUseKeyDown. If KeyDown is enabled, then you need RegisterForClicks("AnyDown"), if its not, you need "AnyUp" ... or just go with RegisterForClicks("AnyUp", "AnyDown") to catch both cases. Its a bit unfortunate that its enforced on a global level now, but at least its easy enough worked around - and it gives you consistency in button press behavior, I suppose. We could ask for a new attribute so that addons can individually control the on-down/on-up behavior of their buttons, or at least to make SecureActionButtons register for AnyDown/AnyUp by default, but this issue can be worked around for now, so maybe bigger fish to fry. On second thought, you likely need AnyDown registered if you ever want to deal with empowered spells. So maybe this is the only way for now without complex solutions. |
I'll flag this as a feature request since it's in the blurry mess between an awkward undesirable behavior and "well if we had this it'd be nice...". If adding an |
Hrm ok. I'll have to try this when I'm home from work. My addon allows users to set the on click behavior for buttons on an actionbar by actionbar basis, with the default being RegisterForClicks("AnyUp"). This change to the game potentially breaks this feature in my code, as I can't have this option be specific per actionbar as well as dependent on a global cvar. I may have to start mandating RegisterForClicks("AnyUp", "AnyDown") and take away the user selectable feature unless they return the behavior to how it was prior |
If you create actual actionbars with normal abilities, you won't get around supporting both up and down in any case, because empowered evoker abilities definitely need it, as they start channeling on "down" and fire on "up", which is why I think its probably not the most terrible requirement. |
Good point, I hadn't even thought about the evokers. I tested, and you are correct, self:RegisterForClicks("AnyDown", "AnyUp") does allow the buttons to execute. That said, this is a somewhat messy solution (not just for the above mentioned reasons), but it makes click to drag the spells around slightly more difficult as no my abilities are executing on the downclick before the drag has started. The old way was far more convenient tbh. |
Following on from this:
With the following test, the Hello and World appear but the /say line is never displayed via Update: thanks @Nevcairiel |
This hit me as well for SilverDragon, which is faking unit frames that do |
I'm going to close this in favour of splitting things into two tickets to make what we're asking clearer. |
In Shadowlands and prior, code implementing a simple button such as below would execute the macro text (or action, spell, whatever) upon being left-clicked.
In Dragonflight, the same code doesn't register any Lua errors; however, upon clicking the button does nothing.
Using hooksecurefunc on SecureActionButton_OnClick, I can verify that SecureActionButton_OnClick is called successfully when an built-in button is clicked, but is not executed when an addon button inheriting from SecureActionButtonTemplate is clicked. This effectively breaks addons that implement custom buttons to perform actions such as Neuron, etc.
The text was updated successfully, but these errors were encountered: