Fix Beast Lore ability coloring (color chips) and filter-row layout

This commit is contained in:
DuvelCorp
2026-10-02 21:46:11 +02:00
parent 60171b559e
commit af1a01ac2e
3 changed files with 14 additions and 31 deletions
-27
View File
@@ -24,33 +24,6 @@ function MTH_BOOK_GetBeastAbilitiesSummary(beast)
return tostring(beast.abilities)
end
-- Like the summary, but colours each ability green when the hunter already knows
-- that exact rank and red when it is still unlearned, to spot tameable upgrades.
function MTH_BOOK_GetBeastAbilitiesColored(beast)
if not beast or not beast.abilities or beast.abilities == "" or beast.abilities == "None" then
return "-"
end
local tokens = MTH_BOOK_SplitAbilities(beast.abilities)
if table.getn(tokens) == 0 then
return "-"
end
local canCheck = type(MTH_IsPetAbilityKnownByHunter) == "function"
local parts = {}
for i = 1, table.getn(tokens) do
local text = tostring(tokens[i])
if canCheck then
local _, label, rank = MTH_BOOK_ParseAbilityToken(tokens[i])
if MTH_IsPetAbilityKnownByHunter(label, rank) then
text = "|cff40ff40" .. text .. "|r"
else
text = "|cffff4040" .. text .. "|r"
end
end
table.insert(parts, text)
end
return table.concat(parts, ", ")
end
function MTH_BOOK_GetBeastZoneSummary(beast)
if not beast or not beast.coords or table.getn(beast.coords) == 0 then
return "-"