Keybindissue
Hey @ all!
I try to alter the keybind text with this small function: Lua Code:
I know I had the correct update-function from the blizzardcode but the hotkeys won't change. I had already Mouse Button 4, a-Mouse Button 4 and so on. Is there a possibly an error I overlooked? A friend of mine used the same code and there it works fine. Currently I am a little perplexed :confused: |
Seems fine. What is the problem exactly? Add some prints to see if the SetText call is happening, and with what value.
|
That's the problem, it's fine but do not work. The print statements do not return anything, which I currently considers that, that the function is not executed.
It is the same function as I insets in DuffedUI v7 (as it works), only that I have replaced the values to the global values (e.g. "Home" to KEY_HOME). @edit It looks as if the function can be called only if I change a keybind, but not if I have a reload or Login performed. If the function "ActionButton_UpdateHotkeys" not trigger at PLAYER_ENTERING_WORLD? |
Yes, it seems the text is only updated OnLoad (when the buttons are created, you won't be able to hook that) and when bindings change.
You could either call the hook for all buttons once in your addon, or hook some other function in addition, such as ActionButton_Update, which seems to fire on PLAYER_ENTERING_WORLD. That's also called on a lot of other occasions probably, so the former is probably the better solution. |
Iterating the keys on UPDATE_BINDINGS and PLAYER_LOGIN works well.
|
@Lombra
The old function from DuffedUI v7 won't work as welll because it is the same way I call the function. @p3lim That's right, but after /reloadui the function will not be executed. On live server I can reload the whole UI several times and the keybindtext will not change. The function also executes again only if I change a keybind. |
Have found a way to get the function even after a reload to trigger
Directly behind: Lua Code:
|
All times are GMT -6. The time now is 02:38 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI