Commit dceea324 authored by Trond A Ekseth's avatar Trond A Ekseth

Make unit reaction work on beta.

This is a layout breaking commit. It however only effect wotlk, so it's considered non-breaking.
parent 50d4acfe
......@@ -28,6 +28,8 @@ local global = GetAddOnMetadata(parent, 'X-oUF')
assert(global, 'X-oUF needs to be defined in the parent add-on.')
local oUF = _G[global]
local wotlk = select(4, GetBuildInfo()) >= 3e4
local OnHealthUpdate
do
local UnitHealth = UnitHealth
......@@ -68,7 +70,11 @@ function oUF:UNIT_MAXHEALTH(event, unit)
local _, class = UnitClass(unit)
t = self.colors.class[class]
elseif(bar.colorReaction) then
t = self.colors.reaction[UnitReaction(unit, "player")]
if(not wotlk) then
t = self.colors.reaction[UnitReaction(unit, "player")]
else
r, g, b = UnitSelectionColor(unit)
end
elseif(bar.colorSmooth and max ~= 0) then
r, g, b = self.ColorGradient(min / max, unpack(bar.smoothGradient or self.colors.smooth))
end
......
......@@ -85,7 +85,11 @@ function oUF:UNIT_MAXMANA(event, unit)
local _, class = UnitClass(unit)
t = self.colors.class[class]
elseif(bar.colorReaction) then
t = self.colors.reaction[UnitReaction(unit, "player")]
if(not wotlk) then
t = self.colors.reaction[UnitReaction(unit, "player")]
else
r, g, b = UnitSelectionColor(unit)
end
elseif(bar.colorSmooth) then
r, g, b = self.ColorGradient(min / max, unpack(bar.smoothGradient or self.colors.smooth))
end
......
......@@ -42,8 +42,10 @@ for eclass, color in pairs(RAID_CLASS_COLORS) do
colors.class[eclass] = {color.r, color.g, color.b}
end
for eclass, color in ipairs(UnitReactionColor) do
colors.reaction[eclass] = {color.r, color.g, color.b}
if(not wotlk) then
for eclass, color in ipairs(UnitReactionColor) do
colors.reaction[eclass] = {color.r, color.g, color.b}
end
end
if(wotlk) then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment