#Specific text coloring

6 messages · Page 1 of 1 (latest)

pulsar vapor
#

Bump? kekL
I know its a weird question, only reason i would want to do this is because the 2 auras can overlap depending on the text size.

But im guessing that can be solved by attaching power text to the frame of hp text, so i might just close the question if i manage to do that.

pulsar vapor
#

To update the issue with raw code, maybe some1 is gonna get attracted:

function(_, _, _, _, name)
    local _, class = UnitClass(name)
    local color
    local currentHP = UnitHealth("player")
    local percent = (UnitHealth("player")/UnitHealthMax("player"))*100
    local percentFormatted = ("%.0f"):format(percent)
    local power = UnitPower("player" , powerType);
    
    if class and RAID_CLASS_COLORS[class] then
        color = "|c" .. RAID_CLASS_COLORS[class].colorStr
    else
        color = "|cff4baf4c"
    end
    return color .. power .. ' | ' .. percentFormatted .. '%' .. ' | ' .. currentHP
end

Lets say something like this would yield almost the result i want.
Only issue is that i dont know how to isolate color to power and not the rest of the text.
And i dont know how to shorten the HP value to 12k instead of raw value.

#

Aaaand nevermind i figured it out

trail lotus
#

You should use a power and health trigger to get the information instead @pulsar vapor

pulsar vapor
# trail lotus You should use a power and health trigger to get the information instead <@19130...
function(_, _, _, _, name)
    local _, class = UnitClass(name)
    local color
    
    local currentHP = AbbreviateLargeNumbers(UnitHealth("player"))
    
    local percent = (UnitHealth("player")/UnitHealthMax("player"))*100
    local percentFormatted = ("%.0f"):format(percent)
    
    local power = UnitPower("player" , powerType);
    
    if class and RAID_CLASS_COLORS[class] then
        color = "|c" .. RAID_CLASS_COLORS[class].colorStr
    else
        color = "|cff4baf4c"
    end
    
    return color .. power .. '|r | ' .. percentFormatted .. '%' .. ' | ' .. currentHP
end

Did it like this in the end.
Yeah @trail lotus i realized i can combine custom code with built in WA tags, so i will probably end up deleting everything and just return the colored power.

I didnt know |r is the escape string to stop coloring.