From f53f3e3f0f9247eee16d94231535593807734c80 Mon Sep 17 00:00:00 2001 From: Florian Berthold Date: Sun, 17 May 2026 16:37:57 +0200 Subject: [PATCH] CoA: mirror RAID_CLASS_COLORS for the 21 custom classes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vanilla Altoholic hardcodes a 10-entry ChatColor table keyed by the englishClass tokens MAGE/WARRIOR/.../DEATHKNIGHT. On the CoA Voljin/PTR realm UnitClass / GetGuildRosterInfo return tokens like BARBARIAN, WITCHDOCTOR, CHRONOMANCER, … so the lookup falls through: * Altoholic:GetClassColor (Altoholic.lua:580) returns WHITE for all 21 CoA classes via the `or WHITE` fallback — guild/character/ profession panes lose their per-class colours. * DataStore_Characters._GetColoredCharacterName had no fallback at all — `ClassColors[englishClass] .. character.name` hard-crashed on nil-concat for any CoA-class character. * Altoholic.lua:710 read CLASS_ICON_TCOORDS[class] for the character portrait without a fallback; CoA classes aren't in the vanilla sprite sheet's coord table, so the next line `tc[1]` crashed. Fix follows the established Exiles addon-port pattern (see coa-omen/CoAClassColors.lua, coa-shadowedunitframes/.../CoAClassColors.lua, coa-kui-nameplates/.../CoAClassColors.lua): mirror _G.RAID_CLASS_COLORS into the addon's private table at load. The CoA client itself ships the realm-authoritative 32-token palette (10 vanilla + HERO + 21 CoA) in Interface/SharedXML/SharedConstants.lua inside patch-B.MPQ, which populates RAID_CLASS_COLORS at FrameXML load time — see db.exil.es /coa/dev for the full table. - Altoholic/CoAClassColors.lua: new file, mirrors source palette into Altoholic.ClassInfo as "|cFFRRGGBB" ChatColor escapes. Never overwrites — preserves the addon's vanilla defaults and any future user overrides. - Altoholic/Altoholic.xml: loads CoAClassColors.lua after Altoholic.lua so Altoholic.ClassInfo exists. - Altoholic/Altoholic.lua: defensive CLASS_ICON_TCOORDS lookup with WARRIOR fallback (wrong icon beats crash; CoA character creation uses its own sprite sheet which doesn't extend the vanilla table). - DataStore_Characters/DataStore_Characters.lua: inline mirror after the local ClassColors table (can't be touched from a sibling file because the table is file-local), plus `or WHITE` defensive fallback in _GetColoredCharacterName and _GetClassColor. Does not touch DataStore_Talents — CoA's MoA system uses C_CharacterAdvancement, not GetNumTalentTabs/GetTalentInfo, so that module needs a full API rewrite rather than a data patch. --- Altoholic-Addon/Altoholic/Altoholic.lua | 5 +- Altoholic-Addon/Altoholic/Altoholic.xml | 3 +- Altoholic-Addon/Altoholic/CoAClassColors.lua | 47 +++++++++++++++++++ .../DataStore_Characters.lua | 42 +++++++++++++---- 4 files changed, 87 insertions(+), 10 deletions(-) create mode 100644 Altoholic-Addon/Altoholic/CoAClassColors.lua diff --git a/Altoholic-Addon/Altoholic/Altoholic.lua b/Altoholic-Addon/Altoholic/Altoholic.lua index cf732e4..24aeb14 100644 --- a/Altoholic-Addon/Altoholic/Altoholic.lua +++ b/Altoholic-Addon/Altoholic/Altoholic.lua @@ -707,7 +707,10 @@ function Altoholic:ShowClassIcons() end) local _, class = DS:GetCharacterClass(character) - local tc = CLASS_ICON_TCOORDS[class] + -- CoA: CLASS_ICON_TCOORDS only carries the vanilla 10 + DK on Voljin. + -- For the 21 CoA custom classes the lookup is nil; fall back to + -- WARRIOR's coords so we render *something* rather than crashing. + local tc = CLASS_ICON_TCOORDS[class] or CLASS_ICON_TCOORDS["WARRIOR"] local itemTexture = _G[itemName .. "IconTexture"] itemTexture:SetTexture("Interface\\Glues\\CharacterCreate\\UI-CharacterCreate-Classes"); itemTexture:SetTexCoord(tc[1], tc[2], tc[3], tc[4]); diff --git a/Altoholic-Addon/Altoholic/Altoholic.xml b/Altoholic-Addon/Altoholic/Altoholic.xml index 7c56f79..ac97f6f 100644 --- a/Altoholic-Addon/Altoholic/Altoholic.xml +++ b/Altoholic-Addon/Altoholic/Altoholic.xml @@ -17,7 +17,8 @@ - + +