Modules/NamePlates: Fix class coloring

This commit is contained in:
Andrew6810
2023-02-27 14:22:35 -07:00
parent 41b938f848
commit d19f258ccb
2 changed files with 8 additions and 3 deletions
@@ -29,7 +29,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
]]
local MAJOR_VERSION = "LibActionButton-1.0-ElvUI"
local MINOR_VERSION = 66
local MINOR_VERSION = 67
if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end
local lib, oldversion = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION)
+7 -2
View File
@@ -234,8 +234,8 @@ for class, color in pairs(RAID_CLASS_COLORS) do
end
function NP:UnitClass(frame, unitType)
if frame._class then
return frame._class
if frame:GetParent()._class then
return frame:GetParent()._class
end
if unitType == "FRIENDLY_PLAYER" then
if frame.unit then
@@ -243,6 +243,11 @@ function NP:UnitClass(frame, unitType)
if class then
return class
end
elseif frame:GetParent()._unit then
local _, class = UnitClass(frame.unit)
if class then
return class
end
else
return NP:GetUnitClassByGUID(frame, frame.guid)
end