Threat Plates

Threat Plates

30M Downloads

Castbar: Show cast target in class colors

Backupiseasy opened this issue ยท 2 comments

commented
commented

This feature is now available in release 10.3.0

commented

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