coa.10: CoA reputation factions (data-driven) + custom-class icons + all-professions Skills
release / release (push) Successful in 5s

- Reputation view rebuilt data-driven from each char's scanned factions grouped
  by in-game category; CoA custom factions (and future ones) appear automatically.
  Old hardcoded tree kept only as an icon lookup.
- CoA custom-class icons (classes 12-32) render from bundled atlas
  Altoholic/images/coa-classes.blp (texcoords from coa-details) instead of the
  Warrior glue-icon fallback in ShowClassIcons.
- Skills tab shows ALL known professions (dynamic list incl Woodcutting/Woodworking),
  not 2 fixed slots; DataStore_Skills scans on PLAYER_ENTERING_WORLD/SKILL_LINES_CHANGED
  (fixes 'no profession data' that only scanned on ghost-release).
This commit is contained in:
2026-05-29 15:55:25 +02:00
parent ec868716ed
commit 0565051302
15 changed files with 428 additions and 177 deletions
@@ -15,9 +15,10 @@ local THIS_ACCOUNT = "Default"
local AddonDB_Defaults = {
global = {
Characters = {
['*'] = { -- ["Account.Realm.Name"]
['*'] = { -- ["Account.Realm.Name"]
lastUpdate = nil,
Factions = {},
Factions = {}, -- [factionName] = "bottom|top|earned"
Headers = {}, -- [factionName] = headerName (in-game category, ex: "Wrath of the Lich King"). Lets the UI group dynamically incl. CoA custom factions.
}
}
}
@@ -59,13 +60,19 @@ local function _GetRawReputationInfo(character, faction)
end
local function _GetReputations(character)
return character.Factions
return character.Factions or {}
end
local function _GetReputationHeaders(character)
-- [factionName] = headerName (in-game category). May be empty for chars scanned before this field existed; UI must guard with "or {}".
return character.Headers or {}
end
local PublicMethods = {
GetReputationInfo = _GetReputationInfo,
GetRawReputationInfo = _GetRawReputationInfo,
GetReputations = _GetReputations,
GetReputationHeaders = _GetReputationHeaders,
}
function addon:OnInitialize()
@@ -75,6 +82,7 @@ function addon:OnInitialize()
DataStore:SetCharacterBasedMethod("GetReputationInfo")
DataStore:SetCharacterBasedMethod("GetRawReputationInfo")
DataStore:SetCharacterBasedMethod("GetReputations")
DataStore:SetCharacterBasedMethod("GetReputationHeaders")
end
function addon:OnEnable()
@@ -125,13 +133,24 @@ local function ScanReputations()
SaveHeaders()
local factions = addon.ThisCharacter.Factions
local headers = addon.ThisCharacter.Headers or {}
addon.ThisCharacter.Headers = headers
wipe(factions)
wipe(headers)
local currentHeader = "" -- track the in-game category so the UI can group factions dynamically (incl. CoA custom factions)
for i = 1, GetNumFactions() do -- 2nd pass, data collection
local name, _, _, bottom, top, earned, _, _, isHeader, _, hasRep = GetFactionInfo(i)
if (not isHeader) or (isHeader and hasRep) then
-- new in 3.0.2, headers may have rep, ex: alliance vanguard + horde expedition
factions[name] = bottom .. "|" .. top .. "|" .. earned
headers[name] = currentHeader
end
if isHeader then
-- any header (pure category like "Classic"/"Wrath of the Lich King", or a rep-bearing
-- header like "Alliance Vanguard") becomes the group for the factions listed beneath it
currentHeader = name or ""
end
end