Thread Tools Display Modes
05/09/20, 06:34 AM   #1
ZephyrDawn
Join Date: May 2020
Posts: 4
World Map

Hi all, apologies if this question is quite basic. The documentation is proving quite daunting haha.

I'm trying to find something, whether that be an event, scene, or callback that I can use to detect when the user has opened their world map. The events EVENT_ACTION_LAYER_PUSHED and EVENT_ACTION_LAYER_POPPED are the closest I've seen, but those fire every time the reticle is shown/hidden so I'm not sure how to specifically differentiate when it fires with relation to the map being opened. I also don't think those will work as they don't seem to fire when switching between menu tabs (i.e. from the inventory screen to the world map).

Can anyone point me in the direction of something I can use to detect this?
  Reply With Quote
05/09/20, 07:17 AM   #2
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,566
The game has a concept of scenes for different UI states which are handled by a scene manager. You could hook into the scene for the world map and listen to the callback that is fired when it shows or hides. This code in worldmap.lua gives an example how it works.
  Reply With Quote
05/09/20, 08:02 AM   #3
ZephyrDawn
Join Date: May 2020
Posts: 4
That was exactly what I'm looking for! Thanks very much

Out of curiosity for the future. Is there a resource that lists the base game scenes? I'm seeing resources for events and public api functions on the wiki, but not anything for scenes
  Reply With Quote
05/09/20, 11:48 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
The data at the wiki basically is provided by ZOs in the ESOUIDocumentationPxx.txt files they provide us at updates/API version increase.
Some additional data like textrues or sounds are read from the global ingame variables then.
Scenes are not in there so you need to check the scenes ingame either by using a tool like merTorchbug or ZGOO and inspect SCNENE_MANAGER.currentScene e.g.
Or you can have a look at the ESOUi source code to get some of the scenes defined by searching the files for SCENE_MANAGER:OpenScene or just SCENE_MANAGER or similar.

Here is a file of the ESOUI sources containing some of the scenes which are defined:
https://github.com/esoui/esoui/blob/...gamescenes.lua

Others are defined in the ingame folder subfolders, like ingame/inventory will most like contain the inventory related (maybe also bank) scene etc.
https://github.com/esoui/esoui/tree/...0/esoui/ingame

Hint: There most of the time exist own scenes for keyboard or gamepad mode.

Last edited by Baertram : 05/09/20 at 11:51 AM.
  Reply With Quote
05/10/20, 08:41 AM   #5
Aenathel
 
Aenathel's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2020
Posts: 8
If you haven't found it yet, the world map scene is simply called "worldMap".
  Reply With Quote
05/10/20, 04:35 PM   #6
ZephyrDawn
Join Date: May 2020
Posts: 4
This is all perfect thanks for the information!
  Reply With Quote
05/11/20, 09:26 AM   #7
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
And there is a global variable WORLD_MAP_SCENE.
Lua Code:
  1. WORLD_MAP_SCENE:RegisterCallback("StateChange", function(oldState, newState)
  2.   if newState == SCENE_SHOWING then
  3.   elseif newState == SCENE_HIDDEN then
  4.   end
  5. end)
  Reply With Quote
05/11/20, 04:26 PM   #8
ZephyrDawn
Join Date: May 2020
Posts: 4
My addon is nearly done, but I'm struggling with one last thing. I'm trying to register when a control or any of its children have been clicked on (like an on click callback or something). Specifically, I'm trying to monitor when the zoom level has changed. I can see some interaction methods for clicking and mouse wheeling on the zoom control's children, but is there any way to set up a watcher or something that will fire when these methods are called?

Thanks
  Reply With Quote
05/11/20, 05:28 PM   #9
Wheels
AddOn Author - Click to view addons
Join Date: Feb 2017
Posts: 60
ZO_PreHook("ZO_WorldMapZoomPlus_OnClicked", function() ... end)
ZO_PreHook("ZO_WorldMapZoomMinus_OnClicked", function() ... end)
ZO_PreHook("ZO_WorldMapZoom_OnMouseWheel", function() ... end) -- does not seem to actually be used

Take a look at the world map source here
  Reply With Quote
05/11/20, 05:41 PM   #10
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,912
Run your code before/After other code:
https://wiki.esoui.com/How_to_run_yo...eHook/PostHook)

Event handlers on controls (if you do not want to use a PreHook/PostHook you can register your own event handler like OnMouseUp or OnClicked etc. to a control -> Not to a function!):
https://wiki.esoui.com/SetHandler

There also exists ZO_PreHookHandler and ZO_PostHookHandler but the new eventHandlers 8see the link above) will take care of the run order, so these functions shouldn't be used anymore if not necessary.

Last edited by Baertram : 05/11/20 at 05:44 PM.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » World Map

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off