mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-23 12:30:50 +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
|
-- hook SetMapToCurrentZone to allow suppression
|
||||||
local pfOrigSetMapToCurrentZone = _G.SetMapToCurrentZone
|
local pfOrigSetMapToCurrentZone = _G.SetMapToCurrentZone
|
||||||
_G.SetMapToCurrentZone = function()
|
_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()
|
pfOrigSetMapToCurrentZone()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -61,6 +61,9 @@ pfUI:RegisterModule("map", "vanilla:tbc", function ()
|
|||||||
|
|
||||||
-- set back to default scale
|
-- set back to default scale
|
||||||
WorldMapFrame:SetScale(scale or .85)
|
WorldMapFrame:SetScale(scale or .85)
|
||||||
|
|
||||||
|
-- always switch to current zone when opening the map
|
||||||
|
pfOrigSetMapToCurrentZone()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
HookScript(WorldMapFrame, "OnMouseWheel", function()
|
HookScript(WorldMapFrame, "OnMouseWheel", function()
|
||||||
@@ -129,7 +132,7 @@ pfUI:RegisterModule("map", "vanilla:tbc", function ()
|
|||||||
CreateBackdrop(btn, nil, true)
|
CreateBackdrop(btn, nil, true)
|
||||||
btn:SetWidth(14)
|
btn:SetWidth(14)
|
||||||
btn:SetHeight(14)
|
btn:SetHeight(14)
|
||||||
btn:SetPoint("RIGHT", WorldMapContinentDropDown, "LEFT", -8, 0)
|
btn:SetPoint("RIGHT", WorldMapContinentDropDown, "LEFT", -8, 2)
|
||||||
btn.text:ClearAllPoints()
|
btn.text:ClearAllPoints()
|
||||||
btn.text:SetPoint("RIGHT", btn, "LEFT", -4, 1)
|
btn.text:SetPoint("RIGHT", btn, "LEFT", -4, 1)
|
||||||
btn.text:SetJustifyH("RIGHT")
|
btn.text:SetJustifyH("RIGHT")
|
||||||
@@ -140,6 +143,7 @@ pfUI:RegisterModule("map", "vanilla:tbc", function ()
|
|||||||
btn:SetScript("OnClick", function()
|
btn:SetScript("OnClick", function()
|
||||||
if this:GetChecked() then
|
if this:GetChecked() then
|
||||||
C.appearance.worldmap.autozoneswitch = "1"
|
C.appearance.worldmap.autozoneswitch = "1"
|
||||||
|
pfOrigSetMapToCurrentZone()
|
||||||
else
|
else
|
||||||
C.appearance.worldmap.autozoneswitch = "0"
|
C.appearance.worldmap.autozoneswitch = "0"
|
||||||
end
|
end
|
||||||
@@ -186,4 +190,4 @@ pfUI:RegisterModule("map", "vanilla:tbc", function ()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
pfUI.map.loader = pfMapLoader
|
pfUI.map.loader = pfMapLoader
|
||||||
end)
|
end)
|
||||||
Reference in New Issue
Block a user