ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Lua/XML Help (https://www.esoui.com/forums/forumdisplay.php?f=175)
-   -   My key binding doesn't work. (https://www.esoui.com/forums/showthread.php?t=931)

Artajörn 04/15/14 12:56 PM

My key binding doesn't work.
 
Hi,

I'm trying to implement a key binding system in my add-on, but it doesn't work. This is the code I have:

Bindings.xml
Code:

<Bindings>
        <Layer name="Improved">
                <Category>
                        <Action name="ITESO_TOGGLE_DISPLAY_MENU_WINDOW">
                                <Down>ITESO.ToggleDisplayMenuWindow()</Down>
                        </Action>
                        <Action name="ITESO_TOGGLE_DISPLAY_HELM">
                                <Down>ITESO.ToggleDisplayHelm()</Down>
                        </Action>
                </Category>
        </Layer>
</Bindings>

Bindings.lua
Code:

ZO_CreateStringId("SI_BINDING_NAME_ITESO_TOGGLE_DISPLAY_MENU_WINDOW", "Toggle Display Menu Window")
ZO_CreateStringId("SI_BINDING_NAME_ITESO_TOGGLE_DISPLAY_HELM", "Toggle Display Helm")

I hope you can help me.

Regards and thanks in advance. :)

Halja 04/15/14 01:11 PM

ZOS is using the name attributes of the bindings XML to build the game menu for key binding settings. The layer name must become "General" in the language of the player.
English -- German -- French
"General" = "Allgemein" = "Général"

Use the localization string variables. The "SI_" table is global for all internationalized strings. I know you can customize the category but I don't think you can not have the name attribute.

Your bindings file should end up looking something like this:
Code:

<Bindings>
        <Layer name="SI_KEYBINDINGS_LAYER_GENERAL">
                <Category name="SI_KEYBINDINGS_CATEGORY_USER_INTERFACE">
                        <Action name="ITESO_TOGGLE_DISPLAY_MENU_WINDOW">
                                <Down>ITESO.ToggleDisplayMenuWindow()</Down>
                        </Action>
                        <Action name="ITESO_TOGGLE_DISPLAY_HELM">
                                <Down>ITESO.ToggleDisplayHelm()</Down>
                        </Action>
                </Category>
        </Layer>
</Bindings>

That should get the binding to at least show in the command key binding list and you just need to make sure you function is working from there.
--halja

Artajörn 04/15/14 02:29 PM

It worked! Thank you very much friend, you have saved me. ^^


All times are GMT -6. The time now is 03:51 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI