Castbar: Show cast target in class colors
Backupiseasy opened this issue ยท 2 comments
- https://www.curseforge.com/wow/addons/tidy-plates-threat-plates/issues/419
- I was wondering if it would be possible for you to add an option to allow us to choose class colours as the text colour in the 'Cast Target' section of the 'Castbar' settings by any chance please, similar to the way it is set up in the 'Target' section of the 'Healthbar View' settings.
- https://www.curseforge.com/wow/addons/tidy-plates-threat-plates?comment=4799
- Is it possible to add automatic class coloring to the Cast Target Text?
- https://www.curseforge.com/wow/addons/tidy-plates-threat-plates?comment=5043
- Thanks for the work on this addon. Would it be possible to add an option for the enemy castbar target to automatically be colored by player class rather than a static color? Similar to what you see when someone interrupts and it uses their class color.
- https://www.curseforge.com/wow/addons/tidy-plates-threat-plates/issues/465
- Also would it be possible to colour castbar target name by class colour of the target?
- https://www.curseforge.com/wow/addons/tidy-plates-threat-plates?comment=5445
- Is it possible to have the name of the spellcast target be color-coded for class? If not, I would find that to be a very useful feature.
- https://www.curseforge.com/wow/addons/tidy-plates-threat-plates?comment=5491
- Little suggestion: Use class colors for name, for Cast Target
Took a stab at it, it seems to work fine but I'm not sure what checks are 100% necessary/efficient etc.
@line 865 in TidyPlatesCore.lua
local target_unit = unit.unitid .. "target"
local db = TidyPlatesThreat.db.profile -- for class colors
local cast_name = UnitName(target_unit) -- cast at targets name
local targetguid = UnitGUID(target_unit) -- get guid
local player_name -- variable for checking/passing class
if targetguid then -- check is guid is not nil
_, player_name = GetPlayerInfoByGUID(targetguid) -- check if player
end
if player_name then -- if player than color
cast_name = "|c" .. db.Colors.Classes[player_name].colorStr .. cast_name .. "|r" -- add color
end
castbar.CastTarget:SetText(cast_name) -- new output
--castbar.CastTarget:SetText(UnitName(target_unit)) -- commented out old output