4 Commits

Author SHA1 Message Date
florian.berthold 68701d7d42 feat(TankMode): CoA custom-class role detection via active spec
release / release (push) Successful in 3s
Add CoAClassSpecData.lua (copied from coa-db/data) and wire
GetPlayerCoARole() into TankMode so CoA tokens resolve TANK/HEALER/DAMAGER
from their active spec instead of defaulting to DAMAGER.

- CoAClassSpecData.lua: defines CoAClassSpec keyed by UnitClass token,
  loaded in .toc before Core.xml/Modules.xml
- GetPlayerCoARole(): pcall-guarded helper that calls
  SpecializationUtil.GetActiveSpecialization() (1-based index) to look up
  the current spec in CoAClassSpec[token].specs; TANK > HEALER > DAMAGER
  precedence when a spec carries multiple roles; returns nil for vanilla
  classes so the existing IsTank/IsHealer path is unchanged
- mod:Update(): try GetPlayerCoARole() first; fall through to vanilla
  logic only when nil (vanilla class or unresolvable spec)
- Re-evaluation on spec change already covered: PLAYER_TALENT_UPDATE
  fires on both spec and talent changes, driving mod:Update()

luac -p: TankMode.lua OK, CoAClassSpecData.lua OK
2026-05-30 01:28:59 +02:00
florian.berthold 39370fcf98 fix: guard InterfaceOptionsFrame HookScript, defer TankMode class resolve
On the CoA client the legacy InterfaceOptionsFrame global may be nil (the
reworked Settings panel does not always expose it). The unguarded
HookScript calls in Castbar.lua and ClassColours.lua then threw on
addon load. Wrap both in 'if InterfaceOptionsFrame then ... end',
mirroring the guard already present around InterfaceOptionsCombatPanel
in Castbar.lua. SetCVars() is still called unconditionally afterwards.

TankMode.lua resolved the player's class at file scope with
select(2, UnitClass('player')), which on CoA can run before
PLAYER_LOGIN — UnitClass returns nil and 'class' stays nil for the
whole session, breaking IsTank/IsHealer/Toggle. Move the assignment
into mod:OnEnable() (where it is already re-assigned) and leave the
file-scope local as nil. Also document that IsTank/IsHealer only know
about the vanilla 3.3.5 classes; CoA custom classes fall through to
DAMAGER until a CoA-aware tank/healer table is available.
2026-05-24 17:38:00 +02:00
florian.berthold 7996489a1a fix: guard legacy InterfaceOptions globals for CoA client
The CoA client's reworked Settings panel does not expose
InterfaceOptionsCombatPanelNameplateClassColors or
InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates, causing a nil-index
error whenever the Combat options panel was shown. Guard each access in
ClassColours and Castbar.
2026-05-22 21:05:32 +02:00
andrew6180 a295c68dd4 Initial Commit 2023-05-22 20:03:54 -07:00