Detecting interface open
Hello there.
How to detect if 'any' of the interface layer is popped open ? I.e. inventory or team window or any other window including the 'esc' menu. Do I have to check for every one of it ? And which event(s) is that related to ? I would like to fire an event if any UI window is open to hide my AddOn. And by the way, is there a function to hide/show a control 'smoothly' - that is to have it fade to transparent or pop visible elegantly like you could do in JQuery ? Is this integrated or requires to code a function for that ? A nice day to you - thanks for any feedback. *edit* I forgot to ask : I want to detect if the player sheathed/unsheathed his/her weapon (~combat mode) to hide/unhide my UI. I checked the doc but didn't find anything so far. |
I assume, every TopLevelControl has the function :IsHidden(), for example
lua Code:
|
Okay fine - where can I get a list of all the ZO_ top level controls ? I need to check if *any* is not hidden.
Thanks |
Quote:
btw, does any one know is there any possibility to change Key Icon: For example Key icon under cursor, when mouse over on NPC to interact with, and other key icons throw all UI? Thnaks |
Okay that's a big list :|
I will try to trigger some events that may return the names of the windows. Thanks tho. |
Quote:
|
Okay I might check that - thanks for the link. I assume I could make a PlayerInventory:getParent() or something then loop through childrens ? Anyway will try it thx.
|
Edda,
http://wiki.esoui.com/Events#UI EVENT_ACTION_LAYER_POPPED (luaindex layerIndex, luaindex activeLayerIndex) EVENT_ACTION_LAYER_PUSHED (luaindex layerIndex, luaindex activeLayerIndex) both are fired when anything is shown such inventories or menus. If you need to hook a specific then you really need the ZO_ globals. However your post tells me you are looking for the 2 mentioned above. For your "fade" you have diferrenct animation controls which can be found here: http://wiki.esoui.com/UI_XML |
All right looking forward to it...
What about the ~Weapon (un)sheated~ event ??? I tried EVENT_PLAYER_COMBAT_STATE but it doesnt work the way I want. Does this event exist (if anyone knows) ? I just want to detect if you sheated or unsheated weapon. And now for another basic noob question : how do I actually use an event in the fired function ? I have Code:
EVENT_MANAGER:RegisterForEvent("MXPV", EVENT_PLAYER_COMBAT_STATE, MXPV.GetCombatState); I tried Code:
EVENT_MANAGER:RegisterForEvent("MXPV", EVENT_PLAYER_COMBAT_STATE, MXPV.GetCombatState(event)); Code:
MXPV.CombatState = EVENT_PLAYER_COMBAT_STATE; Code:
MXPV.CombatState = EVENT_PLAYER_COMBAT_STATE.inCombat; So ? :mad: |
Regarding character menus, an easy way to run a function when a menu opens or closes is to bind to the handler of the menu categories (the top icons bar when you open a menu)
Code:
ZO_PreHookHandler(ZO_MainMenuCategoryBar, "OnShow", function() |
Quote:
MXPV.GetCombatState(event) <-- calls this function with event as the first argument and assigns the result of that function call to the event handler You want this: Lua Code:
or this: Lua Code:
|
Yes that's what I was looking for - noob question soz but Im new to Lua :p
Anyway thanks. |
EVENT_ACTION_LAYER_POPPED/PUSHED did the trick.
*edit* I gave up on weapon sheated/unsheathed event to hide/display my mod (bad idea). As for now only hide it when interface popped (or pushed never remember which one is what :P). I grabbed the LayerIds for the 'Esc' window and other Menu windows (which are only 2 Ids btw) - can't remember them right now but will post them later maybe in case anyone needs em. IIRC : any basic layers (inventory - group window - skills - character - etc etc..) are layers 2 & 16 and loot window is 11. |
All times are GMT -6. The time now is 10:52 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI