You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
3.6 KiB

local SLE, T, E, L, V, P, G = unpack(ElvUI_SLE)
local SUF = SLE.UnitFrames
local UF = E.UnitFrames
4 years ago
function SUF:PostUpdateBar_AuraBars(a, statusBar, b, c, d, e, debuffType)
if not statusBar then return end
local db = E.db.sle.unitframe.statusbarTextures.aurabar
if not db.enable then return end
4 years ago
local texture = E.LSM:Fetch('statusbar', db.texture)
statusBar:SetStatusBarTexture(texture)
end
4 years ago
function SUF:Update_StatusBars()
local db = E.db.sle.unitframe.statusbarTextures
4 years ago
for statusbar in pairs(UF.statusbars) do
-- if statusbar:GetParent().slBarID then print(statusbar:GetName(), statusbar:GetParent().slBarID, 'maybe i can do it here') end -- another place classbars i found at the end of my changes ....
if statusbar and statusbar.slBarID and db[statusbar.slBarID].enable then
local powerTexture = E.LSM:Fetch('statusbar', E.db.sle.unitframe.statusbarTextures[statusbar.slBarID].texture)
local useBlank = statusbar.isTransparent
if statusbar.parent then
useBlank = statusbar.parent.isTransparent
end
if statusbar:GetObjectType() == 'StatusBar' then
if not useBlank then
statusbar:SetStatusBarTexture(powerTexture)
end
elseif statusbar:GetObjectType() == 'Texture' then
statusbar:SetTexture(powerTexture)
end
UF:Update_StatusBar(statusbar.bg or statusbar.BG, (not useBlank and powerTexture) or E.media.blankTex)
end
4 years ago
if statusbar.slBarID == 'classbar' and db[statusbar.slBarID].enable then
SUF:Configure_ClassBar(_G.ElvUF_Player)
end
end
end
4 years ago
function SUF:Update_StatusBar(statusbar)
if not statusbar or not statusbar:GetParent().slBarID then return end
local slBarID = statusbar:GetParent().slBarID
if not E.db.sle.unitframe.statusbarTextures[slBarID].enable then return end
4 years ago
local texture = E.LSM:Fetch('statusbar', E.db.sle.unitframe.statusbarTextures[slBarID].texture)
if statusbar:IsObjectType('StatusBar') then
statusbar:SetStatusBarTexture(texture)
elseif statusbar:IsObjectType('Texture') then
statusbar:SetTexture(texture)
end
4 years ago
end
4 years ago
function SUF:ToggleTransparentStatusBar(isTransparent, statusBar, backdropTex, adjustBackdropPoints, invertColors, reverseFill)
if not statusBar or not statusBar.slBarID then return end
local slBarID = statusBar.slBarID
if not E.db.sle.unitframe.statusbarTextures[slBarID].enable then return end
4 years ago
local parent = statusBar:GetParent()
local orientation = statusBar:GetOrientation()
if isTransparent then
if statusBar.backdrop then
statusBar.backdrop:SetTemplate('Transparent', nil, nil, nil, true)
elseif parent.template then
parent:SetTemplate('Transparent', nil, nil, nil, true)
end
4 years ago
statusBar:SetStatusBarTexture(0, 0, 0, 0)
UF:Update_StatusBar(statusBar.bg or statusBar.BG, E.media.blankTex)
4 years ago
local barTexture = statusBar:GetStatusBarTexture()
barTexture:SetInside(nil, 0, 0) --This fixes Center Pixel offset problem
UF:SetStatusBarBackdropPoints(statusBar, barTexture, backdropTex, orientation, reverseFill)
else
if statusBar.backdrop then
statusBar.backdrop:SetTemplate(nil, nil, nil, nil, true)
elseif parent.template then
parent:SetTemplate(nil, nil, nil, nil, true)
end
4 years ago
local texture = E.LSM:Fetch('statusbar', E.db.sle.unitframe.statusbarTextures[slBarID].texture)
statusBar:SetStatusBarTexture(texture)
SUF:Update_StatusBar(statusBar.bg or statusBar.BG, texture)
4 years ago
local barTexture = statusBar:GetStatusBarTexture()
barTexture:SetInside(nil, 0, 0)
if adjustBackdropPoints then
UF:SetStatusBarBackdropPoints(statusBar, barTexture, backdropTex, orientation, reverseFill)
end
end
4 years ago
end