mirror of
https://codeberg.org/Duvelcorp/MetaHunt.git
synced 2026-10-09 10:00:01 +00:00
Fix Beast Lore ability coloring (color chips) and filter-row layout
This commit is contained in:
@@ -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 "-"
|
||||
|
||||
Reference in New Issue
Block a user