Commit 41d114e8 authored by Merathilis's avatar Merathilis
Browse files

Revert "Additional Power doesn't exist in ElvUI. It's handled by Class Power"

This reverts commit b7d10f74.
parent b7d10f74
......@@ -10,10 +10,20 @@ function UF:Construct_PowerPrediction(frame)
mainBar:SetStatusBarTexture(E["media"].blankTex)
mainBar:Hide()
return {
local PowerPrediction = {
mainBar = mainBar,
parent = frame
}
if frame.AdditionalPower then
local altBar = CreateFrame('StatusBar', nil, frame.AdditionalPower)
altBar:SetStatusBarTexture(E["media"].blankTex)
altBar:Hide()
PowerPrediction.altBar = altBar
end
return PowerPrediction
end
function UF:Configure_PowerPrediction(frame)
......@@ -24,7 +34,7 @@ function UF:Configure_PowerPrediction(frame)
frame:EnableElement('PowerPrediction')
end
local mainBar = powerPrediction.mainBar
local mainBar, altBar = powerPrediction.mainBar, powerPrediction.altBar
local reverseFill = frame.db.power.reverseFill
local r, g, b = frame.Power:GetStatusBarColor()
......@@ -40,6 +50,22 @@ function UF:Configure_PowerPrediction(frame)
mainBar:SetReverseFill(true)
mainBar:SetPoint('RIGHT', frame.Power:GetStatusBarTexture(), 'RIGHT')
end
if altBar then
r, g, b = frame.AdditionalPower:GetStatusBarColor()
altBar:SetPoint('TOP')
altBar:SetPoint('BOTTOM')
altBar:SetWidth(frame.AdditionalPower:GetWidth())
altBar:SetStatusBarColor(r * 1.25, g * 1.25, b * 1.25)
if reverseFill then
altBar:SetReverseFill(false)
altBar:SetPoint('LEFT', frame.AdditionalPower:GetStatusBarTexture(), 'LEFT')
else
altBar:SetReverseFill(true)
altBar:SetPoint('RIGHT', frame.AdditionalPower:GetStatusBarTexture(), 'RIGHT')
end
end
else
if frame:IsElementEnabled('PowerPrediction') then
frame:DisableElement('PowerPrediction')
......
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