Skip to content

Commit cd59e15

Browse files
committed
Update CompactUnitFrame_UpdateHealthColor hook (resolves #4)
1 parent b9f81a7 commit cd59e15

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### Version 7.0.3.3
22

33
- Fixed an error when opening the Mythic Dungeons window
4+
- Fixed enemy NPC nameplates using the warrior class color
45

56
### Version 7.0.3.2
67

ClassColorsBlizz.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,20 +95,22 @@ end
9595
-- CompactUnitFrame.lua
9696

9797
do
98-
local UnitClass, UnitIsConnected = UnitClass, UnitIsConnected
98+
local UnitClass, UnitIsConnected, UnitIsPlayer = UnitClass, UnitIsConnected, UnitIsPlayer
9999

100100
hooksecurefunc("CompactUnitFrame_UpdateHealthColor", function(frame)
101-
if frame.optionTable.useClassColors and UnitIsConnected(frame.unit) then
101+
if UnitIsConnected(frame.unit) and UnitIsPlayer(frame.unit) and frame.optionTable.useClassColors then
102102
local _, class = UnitClass(frame.unit)
103-
if class then
104-
local color = CUSTOM_CLASS_COLORS[class]
105-
if color then
106-
frame.healthBar:SetStatusBarColor(color.r, color.g, color.b)
103+
local color = CUSTOM_CLASS_COLORS[class]
104+
if color then
105+
frame.healthBar:SetStatusBarColor(color.r, color.g, color.b)
106+
if frame.optionTable.colorHealthWithExtendedColors then
107+
frame.selectionHighlight:SetStatusBarColor(color.r, color.g, color.b)
107108
end
108109
end
109110
end
110111
end)
111112
end
113+
112114
------------------------------------------------------------------------
113115
-- FriendsFrame.lua
114116

0 commit comments

Comments
 (0)