From 5082a7deb3520d2ea06b44a60c2ae9fac91f45e7 Mon Sep 17 00:00:00 2001 From: Artur Morozov Date: Sat, 15 Jun 2019 13:23:26 +0300 Subject: [PATCH] panel: add tbc compatibility for minimap zone text --- compat/tbc.lua | 1 + compat/vanilla.lua | 1 + modules/panel.lua | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/compat/tbc.lua b/compat/tbc.lua index b7c19889..546f5191 100644 --- a/compat/tbc.lua +++ b/compat/tbc.lua @@ -5,6 +5,7 @@ if pfUI.expansion ~= "tbc" then return end -- [[ Constants ]]-- CASTBAR_EVENT_CAST_DELAY = "UNIT_SPELLCAST_DELAYED" CASTBAR_EVENT_CHANNEL_DELAY = "UNIT_SPELLCAST_CHANNEL_UPDATE" +EVENTS_MINIMAP_ZONE_UPDATE = {"PLAYER_ENTERING_WORLD", "ZONE_CHANGED_NEW_AREA", "ZONE_CHANGED"} MICRO_BUTTONS = { 'CharacterMicroButton', 'SpellbookMicroButton', 'TalentMicroButton', diff --git a/compat/vanilla.lua b/compat/vanilla.lua index cc4a20dc..ec8bd8fa 100644 --- a/compat/vanilla.lua +++ b/compat/vanilla.lua @@ -5,6 +5,7 @@ if pfUI.expansion ~= "vanilla" then return end -- [[ Constants ]]-- CASTBAR_EVENT_CAST_DELAY = "SPELLCAST_DELAYED" CASTBAR_EVENT_CHANNEL_DELAY = "SPELLCAST_CHANNEL_UPDATE" +EVENTS_MINIMAP_ZONE_UPDATE = {"PLAYER_ENTERING_WORLD", "MINIMAP_ZONE_CHANGED"} MICRO_BUTTONS = { 'CharacterMicroButton', 'SpellbookMicroButton', 'TalentMicroButton', diff --git a/modules/panel.lua b/modules/panel.lua index 75becf8c..630b4808 100644 --- a/modules/panel.lua +++ b/modules/panel.lua @@ -397,8 +397,9 @@ pfUI:RegisterModule("panel", "vanilla:tbc", function() do -- Zone local widget = CreateFrame("Frame", "pfPanelWidgetZone", UIParent) - widget:RegisterEvent("PLAYER_ENTERING_WORLD") - widget:RegisterEvent("MINIMAP_ZONE_CHANGED") + for _,event in pairs(EVENTS_MINIMAP_ZONE_UPDATE) do + widget:RegisterEvent(event) + end widget.Tooltip = function() local real = GetRealZoneText() local sub = GetSubZoneText()