Add bar overlays for absorb and heal absorb

This commit is contained in:
omicron committed 2025-08-24 12:27:56 +02:00
1 parent ff9d8b2289
commit 1fce6017bd
4 files changed
+83 -10

No files matched your search

+15 -7
View File
@@ -20,7 +20,7 @@ local types = omi.GetModule("types")
types.StatusBar = types.CreateClass("StatusBar")
local StatusBar = types.StatusBar
function StatusBar:Init(parent, width, height, level, top)
function StatusBar:Init(parent, width, height, level, top, texture, bgtexture)
if top == nil then top = true end
level = level or 0
-- parent: the parent frame
@@ -38,15 +38,17 @@ function StatusBar:Init(parent, width, height, level, top)
end
bar:SetSize(width, height)
bar:SetStatusBarTexture("Interface\\Addons\\OmicronFrames\\media\\textures\\bar_subtle_diagonal")
bar:SetStatusBarTexture(texture)
bar:GetStatusBarTexture():SetHorizTile(false)
bar:GetStatusBarTexture():SetVertTile(false)
self.bar = bar
local bg = bar:CreateTexture(nil, "BACKGROUND")
bg:SetTexture("Interface\\Addons\\OmicronFrames\\media\\textures\\bar_subtle_diagonal")
bg:SetAllPoints(true)
self.bg = bg
if bgtexture ~= nil then
local bg = bar:CreateTexture(nil, "BACKGROUND")
bg:SetTexture(bgtexture)
bg:SetAllPoints(true)
self.bg = bg
end
self:SetRange(0, 1)
self:SetValue(1)
@@ -61,6 +63,10 @@ function StatusBar:SetValue(value)
self.bar:SetValue(value)
end
function StatusBar:SetFillStyle(style)
self.bar:SetFillStyle(style)
end
function StatusBar:Show()
self.bar:Show()
end
@@ -78,5 +84,7 @@ end
function StatusBar:SetColor(r, g, b)
self.bar:SetStatusBarColor(r, g, b)
self.bg:SetVertexColor(0.2 * r, 0.2 * g, 0.2 * b)
if self.bg ~= nil then
self.bg:SetVertexColor(0.2 * r, 0.2 * g, 0.2 * b)
end
end