diff --git a/ShadowedUnitFrames/modules/portrait.lua b/ShadowedUnitFrames/modules/portrait.lua index 1e06f07..92f3661 100644 --- a/ShadowedUnitFrames/modules/portrait.lua +++ b/ShadowedUnitFrames/modules/portrait.lua @@ -70,10 +70,12 @@ function Portrait:Update(frame, event) -- Use class thingy if( type == "class" ) then local classToken = select(2, UnitClass(frame.unitOwner)) - if( classToken ) then + local coords = classToken and CLASS_ICON_TCOORDS[classToken] + if( coords ) then frame.portrait:SetTexture("Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes") - frame.portrait:SetTexCoord(CLASS_ICON_TCOORDS[classToken][1], CLASS_ICON_TCOORDS[classToken][2], CLASS_ICON_TCOORDS[classToken][3], CLASS_ICON_TCOORDS[classToken][4]) + frame.portrait:SetTexCoord(coords[1], coords[2], coords[3], coords[4]) else + -- CoA custom classes (Witchdoctor/Templar/…) have no CLASS_ICON_TCOORDS entry; blank instead of crash frame.portrait:SetTexture("") end -- Use 2D character image diff --git a/ShadowedUnitFrames/modules/totems.lua b/ShadowedUnitFrames/modules/totems.lua index fd9e92d..6f5373a 100644 --- a/ShadowedUnitFrames/modules/totems.lua +++ b/ShadowedUnitFrames/modules/totems.lua @@ -3,11 +3,23 @@ local totemColors = {} local MAX_TOTEMS = MAX_TOTEMS -- Death Knights untalented ghouls are guardians and are considered totems........... so set it up for them -if( select(2, UnitClass("player")) == "DEATHKNIGHT" ) then +local playerClass = select(2, UnitClass("player")) +if( playerClass == "DEATHKNIGHT" ) then MAX_TOTEMS = 1 ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Guardian bar"], true, "DEATHKNIGHT") else - ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Totem bar"], true, "SHAMAN") + -- CoA: SHAMAN is the vanilla totem class, but CoA custom classes (Witchdoctor, …) also use the + -- multi-cast totem bar. Detect via MAX_TOTEMS > 1 (set by FrameXML for totem classes) or the + -- HasMultiCastActionBar API (Bartender uses the same probe). Register with class=nil so the + -- module is available to any CoA totem class, not just SHAMAN. + local hasTotems = (MAX_TOTEMS and MAX_TOTEMS > 1) + or (type(HasMultiCastActionBar) == "function" and HasMultiCastActionBar()) + or playerClass == "SHAMAN" + if( hasTotems ) then + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Totem bar"], true) + else + ShadowUF:RegisterModule(Totems, "totemBar", ShadowUF.L["Totem bar"], true, "SHAMAN") + end end function Totems:OnEnable(frame) diff --git a/ShadowedUnitFrames/modules/units.lua b/ShadowedUnitFrames/modules/units.lua index 8255da4..f6eb3ad 100644 --- a/ShadowedUnitFrames/modules/units.lua +++ b/ShadowedUnitFrames/modules/units.lua @@ -753,7 +753,15 @@ function Units:SetHeaderAttributes(frame, type) frame:SetAttribute("groupFilter", filter or "1,2,3,4,5,6,7,8") if( config.groupBy == "CLASS" ) then - frame:SetAttribute("groupingOrder", "DEATHKNIGHT,DRUID,HUNTER,MAGE,PALADIN,PRIEST,ROGUE,SHAMAN,WARLOCK,WARRIOR") + -- CoA: build groupingOrder dynamically from RAID_CLASS_COLORS so all 21 CoA custom + -- classes (populated via CUSTOM_CLASS_COLORS) are included. Hardcoding the 10 + -- vanilla classes silently drops Witchdoctor/Templar/… into an unsorted tail. + local orderedClasses = {} + for classToken in pairs(RAID_CLASS_COLORS) do + table.insert(orderedClasses, classToken) + end + table.sort(orderedClasses) + frame:SetAttribute("groupingOrder", table.concat(orderedClasses, ",")) frame:SetAttribute("groupBy", "CLASS") else frame:SetAttribute("groupingOrder", "1,2,3,4,5,6,7,8")