I made a
quick video to show what is going on. In Colorz if I comment out "UnitSelectionColor = GameTooltip_UnitColor" it will stop the error but as said in my first post it doesn't seem to matter what method you are using.
My nameplate addon hooks CompactUnitFrame_UpdateHealthColor with the following code.
Lua Code:
hooksecurefunc("CompactUnitFrame_UpdateHealthColor", function(frame)
if ( not nPlates.FrameIsNameplate(frame) ) then return end
if ( not UnitIsConnected(frame.unit) ) then
local r, g, b = 0.5, 0.5, 0.5
else
if ( frame.optionTable.healthBarColorOverride ) then
local healthBarColorOverride = frame.optionTable.healthBarColorOverride
r, g, b = healthBarColorOverride.r, healthBarColorOverride.g, healthBarColorOverride.b
else
local localizedClass, englishClass = UnitClass(frame.unit)
local classColor = RAID_CLASS_COLORS[englishClass]
if ( UnitIsPlayer(frame.unit) and classColor and frame.optionTable.useClassColors ) then
r, g, b = classColor.r, classColor.g, classColor.b
elseif ( CompactUnitFrame_IsTapDenied(frame) ) then
r, g, b = 0.1, 0.1, 0.1
elseif ( frame.optionTable.colorHealthBySelection ) then
if ( frame.optionTable.considerSelectionInCombatAsHostile and CompactUnitFrame_IsOnThreatListWithPlayer(frame.displayedUnit) ) then
if ( nPlatesDB.TankMode ) then
local target = frame.displayedUnit.."target"
local isTanking, threatStatus = UnitDetailedThreatSituation("player", frame.displayedUnit)
if ( isTanking and threatStatus ) then
if ( threatStatus >= 3 ) then
r, g, b = 0.0, 1.0, 0.0
elseif ( threatStatus == 2 ) then
r, g, b = 1.0, 0.6, 0.2
end
elseif ( nPlates.UseOffTankColor(target) ) then
r, g, b = nPlatesDB.OffTankColor.r, nPlatesDB.OffTankColor.g, nPlatesDB.OffTankColor.b
else
r, g, b = 1.0, 0.0, 0.0;
end
else
r, g, b = 1.0, 0.0, 0.0;
end
else
r, g, b = UnitSelectionColor(frame.unit, frame.optionTable.colorHealthWithExtendedColors)
end
elseif ( UnitIsFriend("player", frame.unit) ) then
r, g, b = 0.0, 1.0, 0.0
else
r, g, b = 1.0, 0.0, 0.0
end
end
end
-- Execute Range Coloring
if ( nPlatesDB.ShowExecuteRange and nPlates.IsInExecuteRange(frame) ) then
r, g, b = nPlatesDB.ExecuteColor.r, nPlatesDB.ExecuteColor.g, nPlatesDB.ExecuteColor.b
end
if ( r ~= frame.healthBar.r or g ~= frame.healthBar.g or b ~= frame.healthBar.b ) then
frame.healthBar:SetStatusBarColor(r, g, b)
if ( frame.optionTable.colorHealthWithExtendedColors ) then
frame.selectionHighlight:SetVertexColor(r, g, b)
else
frame.selectionHighlight:SetVertexColor(1, 1, 1)
end
frame.healthBar.r, frame.healthBar.g, frame.healthBar.b = r, g, b
end
-- Healthbar Border Coloring
if ( frame.healthBar.beautyBorder ) then
for i = 1, 8 do
if ( UnitIsUnit(frame.displayedUnit, "target") ) then
frame.healthBar.beautyBorder[i]:SetVertexColor(r,g,b,1)
else
frame.healthBar.beautyBorder[i]:SetVertexColor(unpack(borderColor))
end
end
end
end)
If you comment out "frame.healthBar.r, frame.healthBar.g, frame.healthBar.b = r, g, b" from the code the error is gone but since that is the code that actually sets the color it doesn't work without it.