Commit 4ae7d51d authored by Simpy's avatar Simpy 🐹

override the GetDisplayPower to remove the limitation

parent 81d0025b
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local UF = E:GetModule('UnitFrames');
local _, ns = ...
local ElvUF = ns.oUF
assert(ElvUF, 'ElvUI was unable to locate oUF.')
local random = random
local CreateFrame = CreateFrame
local UnitPowerType = UnitPowerType
local hooksecurefunc = hooksecurefunc
local _, ns = ...
local ElvUF = ns.oUF
assert(ElvUF, 'ElvUI was unable to locate oUF.')
local GetUnitPowerBarInfo = GetUnitPowerBarInfo
local ALTERNATE_POWER_INDEX = Enum.PowerType.Alternate or 10
function UF:Construct_PowerBar(frame, bg, text, textPos)
local power = CreateFrame('StatusBar', '$parent_PowerBar', frame)
......@@ -31,6 +33,7 @@ function UF:Construct_PowerBar(frame, bg, text, textPos)
power.PostUpdate = self.PostUpdatePower
power.PostUpdateColor = self.PostUpdatePowerColor
power.GetDisplayPower = self.GetDisplayPower
if bg then
power.BG = power:CreateTexture(nil, 'BORDER')
......@@ -233,6 +236,13 @@ function UF:Configure_Power(frame)
UF:ToggleTransparentStatusBar(UF.db.colors.transparentPower, frame.Power, frame.Power.BG, nil, UF.db.colors.invertPower, db.power.reverseFill)
end
function UF:GetDisplayPower()
local barInfo = GetUnitPowerBarInfo(self.__owner.unit)
if barInfo then
return ALTERNATE_POWER_INDEX, barInfo.minPower
end
end
local tokens = {[0]='MANA','RAGE','FOCUS','ENERGY','RUNIC_POWER'}
function UF:PostUpdatePowerColor()
local parent = self.origParent or self:GetParent()
......
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