Whats the proper way to hide a window when you enter into a dialog ?
I am trying to hide a window when i enter any form of dialog. Dialogs, as in menus by pressing esc, inventory, character and so forth.
I tried by setting the following drawlevels of my toplevelwindow to several different values, but it has no effect on entering/exiting dialogs. I am not 100% sure if that is the way to go either. SetDrawLevel(0) SetDrawLayer(0) SetDrawTier(0) I tried hooking into the following events and hide/show my window if layer 6 is popped/pushed EVENT_ACTION_LAYER_PUSHED EVENT_ACTION_LAYER_POPPED this works. However when i do a reloadui or load into the game it stays hidden, while i set it explicitly to be shown in EVENT_ADD_ON_LOADED. I just can't figure out why it is doing this. I added some debug messages and it should show, but it doesn't. If i disable the functionality in the EVENT_ACTION_LAYER_PUSHED and EVENT_ACTION_LAYER_POPPED then it just shows correct. I assume there is an EVENT_ACTION_LAYER_PUSHED done somewhere, but it doesn't register if i add some debug messaging to it, most likely cause not everything is loaded @ reload/start Anyone an idea how to solve this ? |
Lua Code:
This adds yourControl to the HUD and the UI engine does all the work showing and hiding it when its appropriate. The downsite is you can't remove this show/hide behaviour without a reload of the UI, unless you want to hack into the scene by removing the fragment by force and toggling the scene twice. Imo triggering an reload when changing something like this is acceptable. |
Quote:
Lua Code:
EDIT: As of patch 1.1.2 you can use: Lua Code:
|
I don't see a reason to hack it tbh. It's not a setting that changes a lot. a /reloadui is sufficient.
Thanks for the info. |
This works for me to hide my windows when entering menus, dialogues and whatnot..
In init/onload method: Lua Code:
Lua Code:
HoWUI_QuestJournal is my TopLevelWindow. self.vars.visible is a SV i use to keep track of if window should be visible or not afterwards. |
Quote:
Can't drag skills to my action bar anymore cause i tries to call a protected function. Dialogs aren't properly initialized at moment that EVENT_CHATTER_BEGIN is fired. |
Well, i never noticed that one. i always used the right click menu to select skills, which has a wastly superior mouse movement economy ;).
I would consider this a bug in the api. I tried to trigger some onDrag events via scripts and they were all private and since dragging works everywhere else there is something fishy. Where is this chatter event used and what are the consequences of it. |
The problem with the EVENT_CHATTER_BEGIN is that when it fires - and it allways fires when starting a dialog with a NPC - that at the moment of firing the dialog is being build up.
If you use an addon that uses information that exists out of that dialog it could happen that the dialog is not fully finished building, when extracting information. Specific with my addon hooking into the scenemanager, it caused issues in the addon Dialog Tweaks. Which normally should not happen, cause i am not doing anything related with the EVENT_CHATTER_BEGIN event. But the case was that Dialog Tweaks asks if a certain option is visible in the dialog, and if so, does something with it. What i could figure out with some debug statements was that the hidden property was not set at the moment the addon inquired, but when the dialog was fully loaded, it was. I am pretty sure there are more minor conflicts going on, but these are the one i could find out, or actually people pointed me to it. Someone mentioned also that it caused issues with Fast Travel addon. All this, just because i added something to the scenemanager. |
I've been using EVENT_ACTION_LAYER_POP/PUSH, but the fact that they trigger on menus and dialogs is only a coincidence since Action Layers are all about Keybinding contexts. That's more hack-ish than I'm comfortable with.
The best hack I've found is to set the Control's parent to the Compass if I want it to hide when menus open, since that's what the Compass does (and the Control inherits that behavior). |
Ok, I found the source of all the problems, i could conform.
Lua Code:
the dialog window is quite intuitive, and the reason i found this solution, why this is breaking the drag event in the skill menu is certainly another matter :confused:. Anyway this should fix all issues and a 0.2sec fade animation is hardly impoertant to most people :D. edit: I still can't reproduce any problems with the fast travel system, using either fragment classes, i jumped around for about 30min between wayshrine and i still have as much money as before. |
The bug with travelling as posted on my addon
Quote:
Quote:
|
Quote:
Currently it hides the UI if you use siege weapons, I would like to remove that behavior. :( edit: well I just found it. This does the job :) Code:
SCENE_MANAGER.scenes.siegeBar:RegisterCallback( 'StateChange', function( oldState, newState ) |
Quote:
Lua Code:
|
All times are GMT -6. The time now is 05:44 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI