From fce239349cf55ce0da6793467399dc657f408fa8 Mon Sep 17 00:00:00 2001 From: Meow <30401521+me0wg4ming@users.noreply.github.com> Date: Mon, 16 Mar 2026 15:45:04 +0100 Subject: [PATCH] switch map to current zone when opening the map --- modules/map.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/map.lua b/modules/map.lua index a1ec6124..8fc0534a 100644 --- a/modules/map.lua +++ b/modules/map.lua @@ -17,7 +17,7 @@ pfUI:RegisterModule("map", "vanilla:tbc", function () -- hook SetMapToCurrentZone to allow suppression local pfOrigSetMapToCurrentZone = _G.SetMapToCurrentZone _G.SetMapToCurrentZone = function() - if C.appearance.worldmap.autozoneswitch == "0" then return end + if C.appearance.worldmap.autozoneswitch == "0" and WorldMapFrame:IsShown() then return end pfOrigSetMapToCurrentZone() end @@ -61,6 +61,9 @@ pfUI:RegisterModule("map", "vanilla:tbc", function () -- set back to default scale WorldMapFrame:SetScale(scale or .85) + + -- always switch to current zone when opening the map + pfOrigSetMapToCurrentZone() end) HookScript(WorldMapFrame, "OnMouseWheel", function() @@ -129,7 +132,7 @@ pfUI:RegisterModule("map", "vanilla:tbc", function () CreateBackdrop(btn, nil, true) btn:SetWidth(14) btn:SetHeight(14) - btn:SetPoint("RIGHT", WorldMapContinentDropDown, "LEFT", -8, 0) + btn:SetPoint("RIGHT", WorldMapContinentDropDown, "LEFT", -8, 2) btn.text:ClearAllPoints() btn.text:SetPoint("RIGHT", btn, "LEFT", -4, 1) btn.text:SetJustifyH("RIGHT") @@ -140,6 +143,7 @@ pfUI:RegisterModule("map", "vanilla:tbc", function () btn:SetScript("OnClick", function() if this:GetChecked() then C.appearance.worldmap.autozoneswitch = "1" + pfOrigSetMapToCurrentZone() else C.appearance.worldmap.autozoneswitch = "0" end @@ -186,4 +190,4 @@ pfUI:RegisterModule("map", "vanilla:tbc", function () end) pfUI.map.loader = pfMapLoader -end) +end) \ No newline at end of file