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
+11 -1
View File
@@ -4292,7 +4292,7 @@ local function MTH_BOOK_GetRowValues(entry)
if not beast then return { "", "", "", "", "", "", "", "", "", "" } end
local beastDisplayName = (MTH and MTH.GetLocalizedBeastName and MTH:GetLocalizedBeastName(entry, beast.name)) or beast.name
local traits = MTH_BOOK_ParseBeastTraits(beast)
local abilities = MTH_BOOK_GetBeastAbilitiesColored(beast)
local abilities = MTH_BOOK_GetBeastAbilitiesSummary(beast)
local zone = MTH_BOOK_GetBeastZoneSummary(beast)
return {
"|cFF33CCFF" .. tostring(entry) .. "|r",
@@ -4786,6 +4786,16 @@ MTH_BOOK_UpdateResults = function()
label = label .. ","
end
chip.text:SetText(label)
-- Colour by whether the hunter already knows this exact ability rank.
if MTH_BOOK_STATE.mode == "pets" and type(MTH_IsPetAbilityKnownByHunter) == "function" then
if MTH_IsPetAbilityKnownByHunter(ability.tooltipName or ability.name, ability.requestedRank) then
chip.text:SetTextColor(0.30, 1.00, 0.30)
else
chip.text:SetTextColor(1.00, 0.35, 0.35)
end
else
chip.text:SetTextColor(1, 1, 1)
end
local textWidth = chip.text:GetStringWidth() or 24
if textWidth < 16 then textWidth = 16 end
local chipWidth = ((MTH_BOOK_STATE.mode == "families") and 15 or 14) + textWidth