Originally Posted by Baertram
Hacked this quickly together, maybe it helps
Lua Code:
function MyAddon.GetMapZoom() if not ZO_WorldMap_IsWorldMapShowing() then return end local worldMapZoomData = ZO_WorldMap_GetPanAndZoom() if worldMapZoomData then return worldMapZoomData:GetCurrentNormalizedZoom() end return 0 end
returns nil if map is closed
returns 0 if ZO_WorldMap_GetPanAndZoom is returning nil
returns the current normalized zoom level (e.g. 0.5 at half zoom) if map is shown
If you check for the returned value to be ~= nil and > 0 and == 1 hen you'll know it is at maximum value (as 1 should be the max zoom).
Or you simply check for ZO_WorldMap_GetPanAndZoom():CanZoomInFurther() == false -> no further zoom in means you are at max already
|
Yep I did the later, indeed the problem was my LUA skills, but i'm learning fast
it doesn't work with parenthesis though, here is the working code snippet I use in my addon:
Lua Code:
local g_mapPanAndZoom = ZO_WorldMap_GetPanAndZoom()
zoomMaxed = false
if g_mapPanAndZoom.canZoomOutFurther == false then
zoomMaxed = true
end
Thanks a lot for helping me