diff --git a/.luacheckrc b/.luacheckrc index 00f9eac..52887bf 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -48,7 +48,6 @@ globals = { "IsInRaid", "GetNumSubgroupMembers", "GetNumGroupMembers", - "GetClassColoredTextForUnit", "nop", "ActorPoolMixin", diff --git a/WeakAuras/Types.lua b/WeakAuras/Types.lua index 00b704a..6306d36 100644 --- a/WeakAuras/Types.lua +++ b/WeakAuras/Types.lua @@ -263,7 +263,13 @@ WeakAuras.format_types = { if color == "class" then colorFunc = function(unit, text) if unit and UnitPlayerControlled(unit) then - return GetClassColoredTextForUnit(unit, text) + local _, class = UnitClass(unit) + local color = class and RAID_CLASS_COLORS[class] + if color and color.colorStr then + return string.format("|c%s%s|r", color.colorStr, text) + else + return text + end end return text end @@ -384,8 +390,8 @@ WeakAuras.format_types = { if color == "class" then colorFunc = function(class, text) local color = class and RAID_CLASS_COLORS[class] - if color then - return string.format("|c%s%s|r", string.format("ff%.2x%.2x%.2x", color.r * 255, color.g * 255, color.b * 255), text) + if color and color.colorStr then + return string.format("|c%s%s|r", color.colorStr, text) else return text end diff --git a/WeakAuras/compat.lua b/WeakAuras/compat.lua index 68731d4..95fdbc0 100644 --- a/WeakAuras/compat.lua +++ b/WeakAuras/compat.lua @@ -1,22 +1,10 @@ local ipairs = ipairs local pairs = pairs local ceil, floor = math.ceil, math.floor -local format = string.format local GetInstanceInfo = GetInstanceInfo local GetNumPartyMembers = GetNumPartyMembers local GetNumRaidMembers = GetNumRaidMembers -local UnitClass = UnitClass - -function GetClassColoredTextForUnit(unit, text) - local _, classFilename = UnitClass(unit) - local color = RAID_CLASS_COLORS[classFilename] - if color then - return format("|c%s%s|r", format("ff%.2x%.2x%.2x", color.r * 255, color.g * 255, color.b * 255), text) - else - return text - end -end function tInvert(tbl) local inverted = {};