diff --git a/api/config.lua b/api/config.lua index 85598314..904cbfda 100644 --- a/api/config.lua +++ b/api/config.lua @@ -181,6 +181,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("appearance", "minimap", "tracking_pulse", "1") pfUI:UpdateConfig("appearance", "minimap", "addon_buttons", "0") pfUI:UpdateConfig("appearance", "worldmap", "tooltipsize", "0") + pfUI:UpdateConfig("appearance", "worldmap", "autozoneswitch", "1") pfUI:UpdateConfig("appearance", "worldmap", "mapreveal", "0") pfUI:UpdateConfig("appearance", "worldmap", "mapreveal_color", ".4,.4,.4,1") pfUI:UpdateConfig("appearance", "worldmap", "mapexploration", "0") @@ -1364,4 +1365,4 @@ function pfUI:MigrateConfig() pfUI_config.version = pfUI.version.string -end +end \ No newline at end of file diff --git a/env/translations_deDE.lua b/env/translations_deDE.lua index 6a860e34..5f0b0464 100644 --- a/env/translations_deDE.lua +++ b/env/translations_deDE.lua @@ -644,6 +644,7 @@ pfUI_translation["deDE"] = { ["Rested Color"] = nil, ["Resting"] = nil, ["Reveal Unexplored Areas"] = nil, + ["Switch to current zone"] = "Zur aktuellen Zone wechseln", ["Right"] = nil, ["Right Actionbar"] = nil, ["Right Anchor"] = nil, diff --git a/env/translations_enUS.lua b/env/translations_enUS.lua index 6a8470c8..05b45f15 100644 --- a/env/translations_enUS.lua +++ b/env/translations_enUS.lua @@ -644,6 +644,7 @@ pfUI_translation["enUS"] = { ["Rested Color"] = nil, ["Resting"] = nil, ["Reveal Unexplored Areas"] = nil, + ["Switch to current zone"] = nil, ["Right"] = nil, ["Right Actionbar"] = nil, ["Right Anchor"] = nil, diff --git a/env/translations_esES.lua b/env/translations_esES.lua index 9f89d09f..89f3ce43 100644 --- a/env/translations_esES.lua +++ b/env/translations_esES.lua @@ -644,6 +644,7 @@ pfUI_translation["esES"] = { ["Rested Color"] = "Color en descanso", ["Resting"] = "Descansando", ["Reveal Unexplored Areas"] = "Mostrar áreas no exploradas", + ["Switch to current zone"] = "Ir a la zona actual", ["Right"] = "Derecho", ["Right Actionbar"] = "Barra de acción derecha", ["Right Anchor"] = nil, diff --git a/env/translations_frFR.lua b/env/translations_frFR.lua index 9bf04233..837649ad 100644 --- a/env/translations_frFR.lua +++ b/env/translations_frFR.lua @@ -644,6 +644,7 @@ pfUI_translation["frFR"] = { ["Rested Color"] = "Couleur quand Reposé", ["Resting"] = "Au Repos", ["Reveal Unexplored Areas"] = "Révèle les zones non explorées", + ["Switch to current zone"] = "Aller à la zone actuelle", ["Right"] = "Droit", ["Right Actionbar"] = "Barre d'action droite", ["Right Anchor"] = nil, diff --git a/env/translations_koKR.lua b/env/translations_koKR.lua index a82899d0..d857c727 100644 --- a/env/translations_koKR.lua +++ b/env/translations_koKR.lua @@ -644,6 +644,7 @@ pfUI_translation["koKR"] = { ["Rested Color"] = nil, ["Resting"] = "휴식", ["Reveal Unexplored Areas"] = nil, + ["Switch to current zone"] = nil, ["Right"] = "오른쪽", ["Right Actionbar"] = nil, ["Right Anchor"] = nil, diff --git a/env/translations_ruRU.lua b/env/translations_ruRU.lua index 33c44911..78bb6a60 100644 --- a/env/translations_ruRU.lua +++ b/env/translations_ruRU.lua @@ -644,6 +644,7 @@ pfUI_translation["ruRU"] = { ["Rested Color"] = "Опыт за отдых", ["Resting"] = "Отдыхающий", ["Reveal Unexplored Areas"] = "Показывать неисследованные области", + ["Switch to current zone"] = "Перейти к текущей зоне", ["Right"] = "Справа", ["Right Actionbar"] = "Правая", ["Right Anchor"] = nil, diff --git a/env/translations_zhCN.lua b/env/translations_zhCN.lua index dc879872..3cff5eed 100644 --- a/env/translations_zhCN.lua +++ b/env/translations_zhCN.lua @@ -644,6 +644,7 @@ pfUI_translation["zhCN"] = { ["Rested Color"] = "精力充沛颜色", ["Resting"] = "休息中", ["Reveal Unexplored Areas"] = "展示未勘探的地区", + ["Switch to current zone"] = nil, ["Right"] = "右边", ["Right Actionbar"] = "右侧动作条", ["Right Anchor"] = "右锚点", diff --git a/env/translations_zhTW.lua b/env/translations_zhTW.lua index b60b8b99..64bf2deb 100644 --- a/env/translations_zhTW.lua +++ b/env/translations_zhTW.lua @@ -644,6 +644,7 @@ pfUI_translation["zhTW"] = { ["Rested Color"] = nil, ["Resting"] = "休息中", ["Reveal Unexplored Areas"] = "展示未勘探的地區", + ["Switch to current zone"] = nil, ["Right"] = "右邊", ["Right Actionbar"] = nil, ["Right Anchor"] = nil, diff --git a/modules/map.lua b/modules/map.lua index 806f1e17..a1ec6124 100644 --- a/modules/map.lua +++ b/modules/map.lua @@ -14,6 +14,13 @@ pfUI:RegisterModule("map", "vanilla:tbc", function () end end + -- hook SetMapToCurrentZone to allow suppression + local pfOrigSetMapToCurrentZone = _G.SetMapToCurrentZone + _G.SetMapToCurrentZone = function() + if C.appearance.worldmap.autozoneswitch == "0" then return end + pfOrigSetMapToCurrentZone() + end + -- register config update handler pfUI.map = { UpdateConfig = UpdateTooltipScale } @@ -111,6 +118,34 @@ pfUI:RegisterModule("map", "vanilla:tbc", function () SkinButton(WorldMapZoomOutButton) SkinCloseButton(WorldMapFrameCloseButton, WorldMapFrame, -3, -3) + + -- "Switch to current zone" toggle (left side of titlebar) + if not pfUI.map.autozoneswitch then + local btn = CreateFrame("CheckButton", "pfUI_map_autozoneswitch", WorldMapFrame, "UICheckButtonTemplate") + btn:SetNormalTexture("") + btn:SetPushedTexture("") + btn:SetHighlightTexture("") + btn.text = _G["pfUI_map_autozoneswitchText"] + CreateBackdrop(btn, nil, true) + btn:SetWidth(14) + btn:SetHeight(14) + btn:SetPoint("RIGHT", WorldMapContinentDropDown, "LEFT", -8, 0) + btn.text:ClearAllPoints() + btn.text:SetPoint("RIGHT", btn, "LEFT", -4, 1) + btn.text:SetJustifyH("RIGHT") + btn.text:SetText(T["Switch to current zone"]) + btn:SetScript("OnShow", function() + this:SetChecked(C.appearance.worldmap.autozoneswitch == "1") + end) + btn:SetScript("OnClick", function() + if this:GetChecked() then + C.appearance.worldmap.autozoneswitch = "1" + else + C.appearance.worldmap.autozoneswitch = "0" + end + end) + pfUI.map.autozoneswitch = btn + end SkinDropDown(WorldMapContinentDropDown) SkinDropDown(WorldMapZoneDropDown) if WorldMapZoneMinimapDropDown then