added new button "Switch to current zone"

This commit is contained in:
Meow
2026-03-12 06:34:33 +01:00
parent 4176358bfa
commit 33acd7bbf5
10 changed files with 45 additions and 1 deletions
+2 -1
View File
@@ -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
+1
View File
@@ -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,
+1
View File
@@ -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,
+1
View File
@@ -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,
+1
View File
@@ -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,
+1
View File
@@ -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,
+1
View File
@@ -644,6 +644,7 @@ pfUI_translation["ruRU"] = {
["Rested Color"] = "Опыт за отдых",
["Resting"] = "Отдыхающий",
["Reveal Unexplored Areas"] = "Показывать неисследованные области",
["Switch to current zone"] = "Перейти к текущей зоне",
["Right"] = "Справа",
["Right Actionbar"] = "Правая",
["Right Anchor"] = nil,
+1
View File
@@ -644,6 +644,7 @@ pfUI_translation["zhCN"] = {
["Rested Color"] = "精力充沛颜色",
["Resting"] = "休息中",
["Reveal Unexplored Areas"] = "展示未勘探的地区",
["Switch to current zone"] = nil,
["Right"] = "右边",
["Right Actionbar"] = "右侧动作条",
["Right Anchor"] = "右锚点",
+1
View File
@@ -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,
+35
View File
@@ -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