WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Binding a SecureActionButton (https://www.wowinterface.com/forums/showthread.php?t=57635)

Zax 10-26-19 09:55 AM

Binding a SecureActionButton
 
Hello,

I know how to create basic bindings with a Bindings.xml file, like this:
Code:

<Bindings>
        <Binding name="SOMETHING" header="XXX">
                MyAddon.MyFunction();
        </Binding>
</Bindings>

but I don't understand how to bind some personal buttons created from the "SecureActionButtonTemplate" template. As my buttons are protected and only contains macros, I can't call any lua functions.

Thank you.

kurapica.igas 10-26-19 08:25 PM

Out of the combat, you can use

Lua Code:
  1. SetOverrideBindingClick(Your_button, true, "B", "Your_button_name", "LeftButton")

To bind key, and use

Lua Code:
  1. ClearOverrideBindings(Your_button)

to release the binding key

Voopie 10-26-19 09:29 PM

I use the following:

Lua Code:
  1. <Bindings>
  2.     <Binding name="CLICK SECUREACTIONBUTTON_NAME:LeftButton" header="XXX">
  3.         -- Empty
  4.     </Binding>
  5. </Bindings>

And localization:

Lua Code:
  1. _G["BINDING_NAME_CLICK SECUREACTIONBUTTON_NAME:LeftButton"] = "SOMETHING";

Zax 10-27-19 06:19 AM

It works :)
Thanks.


All times are GMT -6. The time now is 12:42 PM.

vBulletin © 2020, Jelsoft Enterprises Ltd
© 2004 - 2020 MMOUI