Parent unit button registers AnyUp clicks and opens the unit popup via
frame.menu — and was z-above the totem (which sat at frame level 1),
so right-clicks fell through to the popup instead of dismissing the
totem. Lift the totem to topFrameLevel + 5 so it wins the click.
- Right-click on a populated totem slot calls DestroyTotem(slot).
EnableMouse on the strip absorbs clicks (loses click-to-target on
the totem-bar pixels only; health/power bar still targets normally).
- COA_CLASS_TOTEMS table overrides MAX_TOTEMS per class. WITCHDOCTOR
capped to 3 so the 4th unused slot no longer renders. Easy to extend
for any future custom totem classes.
- Integer-seconds countdown text centred on each slot. totemMonitor
only repaints the FontString when the integer changes so OnUpdate
stays cheap. Cleared on expiry / dismiss.
portrait.lua: guard CLASS_ICON_TCOORDS[classToken] lookup. CoA custom
classes (Witchdoctor, Templar, …) have no entry in the vanilla
CLASS_ICON_TCOORDS table, so the old SetTexCoord call crashed with a
nil-index whenever a custom-class unit was shown. Cache the lookup
into a local and fall through to blank texture on miss.
totems.lua: file-level class gate registered the totem bar only for
SHAMAN (and a 1-slot DK guardian variant), locking out Witchdoctor and
any future CoA totem class. Probe MAX_TOTEMS > 1 / HasMultiCastActionBar
(Bartender's pattern) and register without a class filter when the
player has the multi-cast totem bar, so any CoA totem class picks it up.
units.lua: raid-header groupingOrder was the hardcoded 10-class vanilla
string, which dumped the 11 CoA custom classes into an unsorted tail
when GROUP BY CLASS was active. Build the order dynamically from
RAID_CLASS_COLORS (CoA populates this with all 21 classes via the
CUSTOM_CLASS_COLORS mechanism) at the call site.