Binding simple keys from LUA
I have observed the following:
The key bindings are stored in "D:\Games\World of Warcraft\_retail_\WTF\Account\XYZ\bindings-cache.wtf" If you reset all your key bindings to default, then this file gets deleted or is empty If you make a simple change, eg set ' to be action bar 5, it then creates this file with BINDINGMODE 0 bind 5 NONE bind ' ACTIONBUTTON5 ***************************** I usually set my special/extra key bindings using the standard UI. It then creates the bindings-cache.wtf file. For example I set "shift 1" to be "bottom left action button 1" which inserts another entry to the bindings-cache.wtf file: bind SHIFT-2 MULTIACTIONBAR1BUTTON2 I wanted to set those key bindings from my addon in LUA. I then did this: SetBinding("SHIFT-1", "MULTIACTIONBAR1BUTTON1") However this does not work as imagined. I have not got to the bottom of it yet. I have observed that right after a character reload it works fine, I can press Shift-1 and get the action expected. If I then go the key-bindings UI, the multiactionbar section appears empty and even if I ESC out of it, it has now "lost" my Shift-1 binding, until another /reload or login, and then the shift-1 works just fine, as long as I do not visit the key-bindings UI. No other addons are loaded. Could someone please help me understand this? |
You're not saving your bindings. On login, and when opening the keybinding UI, it loads your current binding set using LoadBindings(set), where set is:
Code:
DEFAULT_BINDINGS (0) Alternatively, if you don't want to permanently store your bindings, run your code in response to the UPDATE_BINDINGS event. |
OK, currently I load my bindings during the PLAYER_LOGIN event. I will use the save function then to make sure but will still load my bindings during every PLAYER_LOGIN just to be sure.
|
All times are GMT -6. The time now is 03:14 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI