I had changed the code in HideMe v3 already to use the name constant but you have stripped it again
Here is the changed code for v4, all files + the zip archive attached:
HideMe.txt
Code:
## Title: HideMe
## Description: Immersive changes to the map, pins and zoom
## Version: 4
## AddOnVersion: 4
## APIVersion: 100025 100026
HideMe.lua
src/NoZoom.lua
src/NoZoom.lua
Lua Code:
local ZO_MapPanAndZoom = {MAX_OVER_ZOOM = 0.589}
function ZO_MapPanAndZoom:CanMapZoom()
return GetMapContentType() ~= MAP_CONTENT_DUNGEON
end
function ZO_MapPanAndZoom:ComputeMinZoom()
return 1
end
function ZO_MapPanAndZoom:ComputeMaxZoom()
if(not self:CanMapZoom()) then
return 1
else
local numTiles = GetMapNumTiles()
local tilePixelWidth = ZO_WorldMapContainer1:GetTextureFileDimensions()
local totalPixels = numTiles * tilePixelWidth
local mapAreaUIUnits = ZO_WorldMapScroll:GetHeight()
local mapAreaPixels = mapAreaUIUnits * GetUIGlobalScale()
local maxZoomToStayBelowNative = totalPixels / mapAreaPixels
return zo_max(maxZoomToStayBelowNative * ZO_MapPanAndZoom.MAX_OVER_ZOOM, 0.589)
end
end
local function ChangeZoomLimit()
local FACTOR = 1
local minZoom = ZO_MapPanAndZoom:ComputeMinZoom()
local maxZoom = ZO_MapPanAndZoom:ComputeMaxZoom()
ZO_WorldMap_SetCustomZoomLevels(minZoom, maxZoom * FACTOR)
end
local orig_ZO_WorldMap_ShowWorldMap = ZO_WorldMap_ShowWorldMap
ZO_WorldMap_ShowWorldMap = function()
orig_ZO_WorldMap_ShowWorldMap()
ZO_WorldMap_ClearCustomZoomLevels()
zo_callLater(ChangeZoomLimit, 1)
end
local orig_ZO_WorldMap_UpdateMap = ZO_WorldMap_UpdateMap
ZO_WorldMap_UpdateMap = function()
orig_ZO_WorldMap_UpdateMap()
ZO_WorldMap_ClearCustomZoomLevels()
zo_callLater(ChangeZoomLimit, 1)
end
HideMe.lua
Lua Code:
HideMe = {}
HideMe.name = "HideMe"
local function Addon_Loaded(eventCode, addOnName)
if (addOnName == HideMe.name) then
--Hide player pin on map
ZO_MapPin0:SetHidden(true)
ZO_MapPin0.SetHidden = function()
end
--Disable "show player on map" keybind
ZO_PreHook("ZO_WorldMap_PanToPlayer", function()
return true
end
)
end
--Hide map pins in subZones (cities etc.)
ZO_PreHook("IsMapLocationVisible", function()
if GetParentZoneId ~= nil then
local zoneId, subZoneId
zoneId = GetParentZoneId ()
if zoneId ~= nil then
local zoneIndex = GetUnitZoneIndex("player")
if zoneIndex ~= nil then
subZoneId = GetZoneId(zoneIndex)
if subZoneId ~= nil then return true end
end
end
end
return false
end)
end
EVENT_MANAGER:RegisterForEvent(HideMe.name, EVENT_ADD_ON_LOADED, Addon_Loaded)