Bagnon

Bagnon

122M Downloads

Add class colors to money tooltip

Phanx opened this issue ยท 1 comments

commented

I've long been hacking my local copy of Bagnon to add class coloring in the money tooltip, as I have 11 characters on my main server (and multiples on other servers) and find the colors to be a huge help in quickly locating a character, even though the list is alphabetized. It'd be nice to just have this in Bagnon itself. If you're interested, here is the modified code for the OnEnter function in moneyFrame.lua:

-- Each player
for i, player in ItemCache:IteratePlayers() do
    local money = ItemCache:GetMoney(player)
    if money > 0 then
        local class = ItemCache:GetPlayerInfo(player)
        local color = class and (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[class] or HIGHLIGHT_FONT_COLOR
        GameTooltip:AddDoubleLine(player, self:GetCoinsText(money), color.r, color.g, color.b, 1, 1, 1)
    end
end

It also supports ClassColors and defaults to white if the class is missing/invalid for some reason (I've never seen this happen, but no harm in having the fallback).

commented

Sure, good idea.