I'd like to go back to colored health bars, but can't rember how i did it the last time
Changed:
Code:
r, g, b = self.ColorGradient(min/max, 1,0.29,0.24, 1,0.97,0.33, 0.2,1,0.35)
To: (just a more uptodate way to do this I think)
Code:
r, g, b = oUF.ColorGradient(min/max, unpack(oUF.colors.smooth))
Code:
local function PostUpdateHealth(self, event, unit, bar, min, max)
if(max ~= 0) then
-- r, g, b = self.ColorGradient(min/max, 1,0.29,0.24, 1,0.97,0.33, 0.2,1,0.35)
r, g, b = oUF.ColorGradient(min/max, unpack(oUF.colors.smooth))
end
if(UnitIsDead(unit)) then
bar.value:SetText('Dead')
elseif(UnitIsGhost(unit)) then
bar.value:SetText('Ghost')
elseif(not UnitIsConnected(unit)) then
bar:SetValue(0)
bar.value:SetText('Offline')
else
if(min~=max) then
if(unit=='player' or unit=='pet') then
bar.value:SetFormattedText('%d (|cff%02x%02x%02x%d|r%%)', (min), r*255, g*255, b*255, (min/max)*100)
elseif(unit=='target' or unit=='focus') then
bar.value:SetFormattedText('%s (|cff%02x%02x%02x%.1f|r%%)', letter(min), r*255, g*255, b*255, (min/max)*100)
elseif(self:GetParent():GetName():match'oUF_Raid') then
bar.value:SetFormattedText('|cffff8080%s|r', rletter(min-max))
else
bar.value:SetFormattedText('|cffff8080%s|r', letter(min-max))
end
else
if(unit=='player' or unit=='pet') then
bar.value:SetFormattedText('%s', (max))
elseif(unit=='target' or unit=='focus') then
bar.value:SetFormattedText('%s', letter(max))
else
bar.value:SetText('')
end
end
end
if(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) and not UnitIsPlayer(unit)) then
color = {0.7,0.7,0.7}
bar:SetStatusBarColor(color[1], color[2], color[3])
else
bar:SetStatusBarColor(r*255, g*255, b*255)
-- bar:SetStatusBarColor(.22,.22,.22)
end
self:UNIT_NAME_UPDATE(event, unit)
end
Changed:
Code:
bar:SetStatusBarColor(.22,.22,.22)
to:
Code:
bar:SetStatusBarColor(r*255, g*255, b*255)
But I must be missing something here.
One mor thing, for some odd reason y runepowers won't show the color they need (show up white) . until I used them or do a /rl
thanks