Skip to content

Commit

Permalink
Added gradient color for AltPowerBar.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wetxius committed Oct 18, 2019
1 parent bfbe022 commit 6be7374
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ShestakUI/Modules/Blizzard/AltPowerBar.lua
Expand Up @@ -104,6 +104,9 @@ status.text = status:CreateFontString(nil, "OVERLAY")
status.text:SetFont(C.media.pixel_font, C.media.pixel_font_size, C.media.pixel_font_style)
status.text:SetPoint("CENTER", bar, "CENTER", 0, 0)

local _, ns = ...
local oUF = ns.oUF

-- Update Function
local update = 1
status:SetScript("OnUpdate", function(self, elapsed)
Expand All @@ -119,6 +122,8 @@ status:SetScript("OnUpdate", function(self, elapsed)
end
if blizzColors[texture] then
r, g, b = blizzColors[texture].r, blizzColors[texture].g, blizzColors[texture].b
elseif r == 1 and g == 1 and b == 1 then
r, g, b = oUF:ColorGradient(power, mpower, 0.8, 0, 0, 0.8, 0.8, 0, 0, 0.8, 0)
elseif not texture then
r, g, b = 0.3, 0.7, 0.3
end
Expand Down
2 changes: 1 addition & 1 deletion ShestakUI/Modules/UnitFrames/Layout.lua
Expand Up @@ -659,7 +659,7 @@ local function Shared(self, unit)

self.CounterBar:SetScript("OnValueChanged", function(_, value)
_, max = self.CounterBar:GetMinMaxValues()
r, g, b = oUF:ColorGradient(value, max, 1, 0, 0, 1, 1, 0, 0, 1, 0)
r, g, b = oUF:ColorGradient(value, max, 0.8, 0, 0, 0.8, 0.8, 0, 0, 0.8, 0)
self.CounterBar:SetStatusBarColor(r, g, b)
self.CounterBar.bg:SetVertexColor(r, g, b, 0.2)
self.CounterBar.Text:SetText(floor(value))
Expand Down

0 comments on commit 6be7374

Please sign in to comment.