Modules/NamePlates: Fix class coloring
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user