05/25/14, 09:09 PM | #1 |
|
LibAddonmenu question
How do I hook into the "[X] Defaults" keystroke at the bottom of the menu? It looks like it's difficult to remove that button, although looks like you can add others.
I want to be able to set the defaults, and not sure how to do that. |
05/25/14, 09:17 PM | #2 |
LAM doesn't support the defaults button. The script run by that button when it is clicked is more than just "here's a default value! ".
Unfortunately, that Defaults button has been a PITA to hide/remove/disable the keybind/etc. LAM-2.0 will have defaults support. |
|
05/25/14, 09:27 PM | #3 |
|
I don't mind not hiding it... just curious if there's a known way to hook into it so I can call my own routines. (Doesn't have to be through LAM, I don't mind hooking into the base UI.)
Finally got the tooltip thing handled although I haven't been able to figure out how to read it. The defaults button was one of those things left that's bugging me, though. Thanks! Last edited by Vuelhering : 05/25/14 at 09:40 PM. |
05/26/14, 06:17 AM | #4 | |
Lua Code:
|
||
05/26/14, 01:07 PM | #5 |
|
Excellent! *tents fingers*
|
05/27/14, 12:08 AM | #6 |
|
Below, I'll paste a code block that might help you. I'll add comments to show what I am doing, and why in that block.
Lua Code:
Result: For vanilla menus, the texts will be reverted back, as well as the hidden keybind buttons. For other menus created with LAM, they will keep their hidden stuff. As I've said above, keybinds cannot be disabled for some reason (try pressing "Apply" key or "Defaults" key while navigating a LAM menu); only their icons are disabled, not their functions, I'm sure Seerah will find the reason soon enough with 2.0 or something If anyone know how to change a keybinding via API, then changing that keybinding temporarily or unbinding would help (run "/script d(ZO_Keybindings_GetBindingStringFromAction("OPTIONS_APPLY_CHANGES"))" this is the problem). Also this code above has one problem; when you open your add-on menu, it will also override vanilla stuff, so lets say you changed defaults button and now it simply just runs a d() function, after looking at your menu then vanilla menus and clicking defaults button will also run that function. Off-topic, for some reason LAM tries to show/hide the reset buttons under "AddHeader". It has handlers for OnShow and OnHide, but they do not work as intended I believe. I'll contact Seerah about these, but for now this is more or less how you can modify the vanilla buttons for your options menu that is created with LAM. Last edited by lyravega : 05/27/14 at 01:01 AM. |
05/27/14, 01:57 PM | #7 | |
Join Date: Apr 2014
Posts: 16
|
Do something like the following and you will notice that the callback of the button has nothing to do with the action triggered with the keybind.
Lua Code:
I just don't think this is a really good idea unless you know all possible dialog names. |
|
05/28/14, 08:08 PM | #8 | |
|
You could simply hook into it and ignore anything that isn't one of your dialogs. |
|
05/29/14, 05:43 AM | #9 | |
So I was digging around and I found that dialog displayed from the callback is "OPTIONS_RESET_TO_DEFAULTS" and from this dialog is called function ZO_OptionsWindow_LoadDefaults(). So maybe hook this function? Lua Code:
|
||
05/29/14, 06:11 AM | #10 | |
|
|
|
ESOUI » Developer Discussions » General Authoring Discussion » LibAddonmenu question |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|