View Single Post
05/10/22, 02:36 PM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,991
Try function ZO_MapPanAndZoom:SetCurrentNormalizedZoomInternal(normalizedZoom)
It seems to be called from internal local functions as you click the zoom slider and maybe also if you use the mousewheel as it is called from different zoom functions there (normalized, curved etc.)

The object is stored in the local g_mapPanAndZoom which is returned by function ZO_WorldMap_GetPanAndZoom()

Lua Code:
  1. local mapPanAndZoom = ZO_WorldMap_GetPanAndZoom()
  2. SecurePostHook(mapPanAndZoom , "SetCurrentNormalizedZoomInternal", function(selfMapPanAndZoom, normalizedZoom)
  3. d("normalizedZoom: " ..tostring(normalizedZoom))
  4. end)

If this is not the correct one that will fire as you use the mouse wheel check any other of the update/set functions there, e.g.
:OnMouseWheel(delta)
which will call AddZoomDelta
which calls SetLockedNormalizedZoom
which calls SetTargetNormalizedZoom

Last edited by Baertram : 05/10/22 at 02:40 PM.
  Reply With Quote