From 68da3d83d86b72bdd62a115ebb67f774feda8a73 Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Sat, 30 Nov 2024 13:31:06 +0100 Subject: [PATCH] totems: Follow priorities used by Blizzard (#700) 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 e6695fc2..ab2ca9f5 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