#Editing Custom Code to modify the color of a separator.

6 messages · Page 1 of 1 (latest)

wise jungle
#

The code linked below currently displays what is in photo #1.

Currently the format is Target > Target of Target. The Target color is set using Weakaura's color picker (see 2nd photo). This also changes the color of the separator to the Target's class color. Is there any way to modify the code ensure the " > " is colored white?

Code:

    local tar = UnitName("target")
    if UnitExists("targettarget") and UnitPlayerControlled("targettarget") then
        local tartar = UnitName("targettarget")
        local _, class = UnitClass("targettarget")
        
        local classData = RAID_CLASS_COLORS[class]
            local coloredName = ("|c%s%s|r"):format(classData.colorStr, tartar)
            return tar, " > " .. coloredName -- target + player          
        else
            if UnitExists("targettarget") then 
                local forcedColor = ("|c%s%s|r"):format("ffd2b48c", UnitName("targettarget"))
                return tar, " > " ..  forcedColor -- target + npc
            else
                return tar -- just target
            end
        end
    end```
raven surge
#

cover the separator in an escape sequence in a similar way you're doing it for ToT color.

return tar, "|cFFFFFFFF > |r" .. coloredName
#

!escape for more info

sick mantleBOT
wise jungle
#

Thank you!

#

Any way to edit the above code to set the Target color to change based on the target's class and not be set using the WA color picker?