From 2c0e243813c9301db02ae5949fe2ab8c30f35255 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Thu, 21 Nov 2024 01:38:12 +0100 Subject: [PATCH] totems: Follow priorities used by Blizzard Ref: https://github.com/Gethe/wow-ui-source/blob/fa3531505e3e2406f9e3d5a0fbd9644bd5c85227/Interface/AddOns/Blizzard_UnitFrame/TotemFrame.lua#L15-L18 --- elements/totems.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/elements/totems.lua b/elements/totems.lua index b85414147..eb0ecb892 100644 --- a/elements/totems.lua +++ b/elements/totems.lua @@ -48,6 +48,11 @@ OnEnter and OnLeave script handlers will be set to display a Tooltip if the `Tot local _, ns = ... local oUF = ns.oUF +local TOTEM_PRIORITIES = _G.STANDARD_TOTEM_PRIORITIES +if(UnitClassBase('player') == 'SHAMAN') then + TOTEM_PRIORITIES = _G.SHAMAN_TOTEM_PRIORITIES +end + local function UpdateTooltip(self) GameTooltip:SetTotem(self:GetID()) end @@ -75,7 +80,7 @@ local function UpdateTotem(self, event, slot) --]] if(element.PreUpdate) then element:PreUpdate(slot) end - local totem = element[slot] + local totem = element[TOTEM_PRIORITIES[slot]] local haveTotem, name, start, duration, icon = GetTotemInfo(slot) if(haveTotem and duration > 0) then if(totem.Icon) then @@ -135,8 +140,7 @@ local function Enable(self) element.ForceUpdate = ForceUpdate for i = 1, #element do - local totem = element[i] - + local totem = element[TOTEM_PRIORITIES[i]] totem:SetID(i) if(totem:IsMouseEnabled()) then