coa.23: correct CoA class names (PROPHET->Venomancer etc.) + fix Skills rank/max
release / release (push) Successful in 5s

- CoA renamed classes but UnitClass returns old tokens; added a token->name map
  (CoAClassColors.lua, from coa-omen) applied in the Skills header + the shared
  AddCharacterTooltipHeader/SetCharacterRowNameLevel helpers (fixes class names everywhere).
- Skills vertical list now shows rank/max (precompute carries maxRank; was showing /0).
This commit is contained in:
2026-05-29 22:27:53 +02:00
parent d1616b4354
commit 996a11dd0a
5 changed files with 32 additions and 6 deletions
+7 -3
View File
@@ -338,7 +338,7 @@ function addon:OnEnable()
-- CoA: use a Lua constant, not GetAddOnMetadata — TOC metadata is cached at game launch -- CoA: use a Lua constant, not GetAddOnMetadata — TOC metadata is cached at game launch
-- and does NOT refresh on /reload, so the .toc version looked stale ("still .18"). A Lua -- and does NOT refresh on /reload, so the .toc version looked stale ("still .18"). A Lua
-- constant re-evaluates on every /reload, giving a truthful loaded-code version. Bump with the .toc. -- constant re-evaluates on every /reload, giving a truthful loaded-code version. Bump with the .toc.
AltoholicFrameName:SetText("Altoholic |cFFFFFFFF3.3.002b-coa.22|r") AltoholicFrameName:SetText("Altoholic |cFFFFFFFF3.3.002b-coa.23|r")
local realm = GetRealmName() local realm = GetRealmName()
local player = UnitName("player") local player = UnitName("player")
@@ -608,13 +608,17 @@ end
-- Fresh alts have partial per-module data, so every field is guarded here once -- Fresh alts have partial per-module data, so every field is guarded here once
-- instead of being copy-pasted (and missed) across the frames. -- instead of being copy-pasted (and missed) across the frames.
function Altoholic:AddCharacterTooltipHeader(character) function Altoholic:AddCharacterTooltipHeader(character)
local locClass, engClass = DS:GetCharacterClass(character)
local className = Altoholic:GetCoAClassName(engClass) or locClass or "" -- CoA: current class name (PROPHET->Venomancer, …)
AltoTooltip:AddDoubleLine(DS:GetColoredCharacterName(character) or "?", DS:GetColoredCharacterFaction(character) or "") AltoTooltip:AddDoubleLine(DS:GetColoredCharacterName(character) or "?", DS:GetColoredCharacterFaction(character) or "")
AltoTooltip:AddLine(format("%s %s |r%s %s", L["Level"], AltoTooltip:AddLine(format("%s %s |r%s %s", L["Level"],
GREEN..(DS:GetCharacterLevel(character) or 0), DS:GetCharacterRace(character) or "", DS:GetCharacterClass(character) or ""), 1, 1, 1) GREEN..(DS:GetCharacterLevel(character) or 0), DS:GetCharacterRace(character) or "", className), 1, 1, 1)
end end
function Altoholic:SetCharacterRowNameLevel(entry, i, icon, character) function Altoholic:SetCharacterRowNameLevel(entry, i, icon, character)
_G[entry..i.."NameNormalText"]:SetText(icon .. format("%s (%s)", DS:GetColoredCharacterName(character) or "?", DS:GetCharacterClass(character) or "")) local locClass, engClass = DS:GetCharacterClass(character)
local className = Altoholic:GetCoAClassName(engClass) or locClass or "" -- CoA: current class name
_G[entry..i.."NameNormalText"]:SetText(icon .. format("%s (%s)", DS:GetColoredCharacterName(character) or "?", className))
_G[entry..i.."Level"]:SetText(GREEN .. (DS:GetCharacterLevel(character) or 0)) _G[entry..i.."Level"]:SetText(GREEN .. (DS:GetCharacterLevel(character) or 0))
end end
+1 -1
View File
@@ -13,7 +13,7 @@
## Author: Thaoky, Telkar-RG ## Author: Thaoky, Telkar-RG
## X-Edited-By: Exiles (Sub-Net) — florian.berthold@sub-net.at ## X-Edited-By: Exiles (Sub-Net) — florian.berthold@sub-net.at
## Version: 3.3.002b-coa.22 ## Version: 3.3.002b-coa.23
## X-Category: Inventory, Tradeskill, Mail ## X-Category: Inventory, Tradeskill, Mail
## X-Localizations: enUS, frFR, zhCN, zhTW, deDE, koKR, esES, esMX, ruRU ## X-Localizations: enUS, frFR, zhCN, zhTW, deDE, koKR, esES, esMX, ruRU
## X-Website: http://wow.curse.com/downloads/wow-addons/details/altoholic.aspx ## X-Website: http://wow.curse.com/downloads/wow-addons/details/altoholic.aspx
+1
View File
@@ -98,6 +98,7 @@ local function AddRealm(AccountName, RealmName)
professions[#professions + 1] = { professions[#professions + 1] = {
name = p.name, name = p.name,
rank = p.rank or 0, rank = p.rank or 0,
maxRank = p.maxRank or 0, -- CoA: needed for the "rank/max" display in the vertical Skills list
spellID = DataStore:GetProfessionSpellID(p.name), spellID = DataStore:GetProfessionSpellID(p.name),
} }
end end
+20
View File
@@ -115,3 +115,23 @@ function Alto:GetCoAClassIcon(token)
if not tc then return end if not tc then return end
return COA_CLASS_ICON_TEXTURE, tc[1], tc[2], tc[3], tc[4] return COA_CLASS_ICON_TEXTURE, tc[1], tc[2], tc[3], tc[4]
end end
-- CoA renamed its classes, but UnitClass()/DataStore still return the OLD tokens
-- (PROPHET, MONK, …). Map them to the current display names. Source: coa-omen/README-CoA.md.
-- Tokens not listed here keep their normal localized name (returns nil).
local COA_CLASS_NAMES = {
HERO = "Hero", BARBARIAN = "Barbarian", WITCHDOCTOR = "Witch Doctor",
DEMONHUNTER = "Felsworn", WITCHHUNTER = "Witch Hunter", STORMBRINGER = "Stormbringer",
FLESHWARDEN = "Knight of Xoroth", GUARDIAN = "Guardian", MONK = "Templar",
SONOFARUGAL = "Bloodmage", RANGER = "Ranger", CHRONOMANCER = "Chronomancer",
NECROMANCER = "Necromancer", PYROMANCER = "Pyromancer", CULTIST = "Cultist",
STARCALLER = "Starcaller", SUNCLERIC = "Sun Cleric", TINKER = "Tinker",
PROPHET = "Venomancer", REAPER = "Reaper", WILDWALKER = "Primalist",
SPIRITMAGE = "Runemaster",
}
-- Current CoA display name for a class token, or nil if unmapped (caller falls back).
function Alto:GetCoAClassName(token)
if type(token) ~= "string" then return end
return COA_CLASS_NAMES[token]
end
+3 -2
View File
@@ -87,8 +87,9 @@ function ns:Update()
_G[e.."NameNormalText"]:SetWidth(680) _G[e.."NameNormalText"]:SetWidth(680)
if item.kind == "header" then if item.kind == "header" then
local _, class = DS:GetCharacterClass(item.character) local locClass, engClass = DS:GetCharacterClass(item.character)
_G[e.."NameNormalText"]:SetText( (DS:GetColoredCharacterName(item.character) or "?") .. " " .. WHITE .. "(" .. (class or "") .. ")" ) local className = Altoholic:GetCoAClassName(engClass) or locClass or "" -- CoA: PROPHET->Venomancer, MONK->Templar, …
_G[e.."NameNormalText"]:SetText( (DS:GetColoredCharacterName(item.character) or "?") .. " " .. WHITE .. "(" .. className .. ")" )
else else
local iconEsc = "" local iconEsc = ""
if item.spellID then if item.spellID then