Commit 177f0cde authored by Benik's avatar Benik

Make the power statusbar option more flexible

parent 5c85a7de
......@@ -35,7 +35,9 @@ function BU:ChangeUnitPowerBarTexture()
frameNameUnit = frameNameUnit:gsub("t(arget)", "T%1")
local unitframe = _G["ElvUF_"..frameNameUnit]
if unitframe and unitframe.Power and not unitframe.Power.isTransparent then unitframe.Power:SetStatusBarTexture(bar) end
if unitframe and unitframe.Power then
unitframe.Power:SetStatusBarTexture(bar)
end
end
end
hooksecurefunc(UF, "Update_AllFrames", BU.ChangeUnitPowerBarTexture)
......@@ -49,7 +51,7 @@ function BU:ChangeRaidPowerBarTexture()
for j = 1, group:GetNumChildren() do
local unitbutton = select(j, group:GetChildren())
if unitbutton.Power and not unitbutton.Power.isTransparent then
if unitbutton.Power then
unitbutton.Power:SetStatusBarTexture(bar)
end
end
......@@ -66,7 +68,7 @@ function BU:ChangeRaid40PowerBarTexture()
for j = 1, group:GetNumChildren() do
local unitbutton = select(j, group:GetChildren())
if unitbutton.Power and not unitbutton.Power.isTransparent then
if unitbutton.Power then
unitbutton.Power:SetStatusBarTexture(bar)
end
end
......@@ -83,7 +85,7 @@ function BU:ChangePartyPowerBarTexture()
for j = 1, group:GetNumChildren() do
local unitbutton = select(j, group:GetChildren())
if unitbutton.Power and not unitbutton.Power.isTransparent then
if unitbutton.Power then
unitbutton.Power:SetStatusBarTexture(bar)
end
end
......@@ -96,7 +98,7 @@ function BU:ChangeArenaPowerBarTexture()
local bar = LSM:Fetch("statusbar", E.db.benikui.unitframes.textures.power)
for i = 1, 5 do
local unitbutton = _G["ElvUF_Arena"..i]
if unitbutton.Power and not unitbutton.Power.isTransparent then
if unitbutton.Power then
unitbutton.Power:SetStatusBarTexture(bar)
end
end
......@@ -108,7 +110,7 @@ function BU:ChangeBossPowerBarTexture()
local bar = LSM:Fetch("statusbar", E.db.benikui.unitframes.textures.power)
for i = 1, 5 do
local unitbutton = _G["ElvUF_Boss"..i]
if unitbutton.Power and not unitbutton.Power.isTransparent then
if unitbutton.Power then
unitbutton.Power:SetStatusBarTexture(bar)
end
end
......
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