mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-27 18:06:02 +00:00
switch map to current zone when opening the map
This commit is contained in:
+7
-3
@@ -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)
|
||||
Reference in New Issue
Block a user