forked from wow/OmicronFrames
Apply auto formatting to all source files
This commit is contained in:
1 parent
e20887d46b
commit
24c571658c
9 files changed
+117
-70
No files matched your search
@@ -1,7 +1,7 @@
|
||||
-- Copyright 2023 <omicron.me@protonmail.com>
|
||||
--
|
||||
-- This file is part of Omicron Frames
|
||||
--
|
||||
--
|
||||
-- Omicron Frames is free software: you can redistribute it and/or modify it
|
||||
-- under the terms of the GNU General Public License as published by the Free
|
||||
-- Software Foundation, either version 3 of the License, or (at your option)
|
||||
@@ -13,7 +13,7 @@
|
||||
-- more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License along with
|
||||
-- Omicron Frames. If not, see <https://www.gnu.org/licenses/>.
|
||||
-- Omicron Frames. If not, see <https://www.gnu.org/licenses/>.
|
||||
local omi = select(2, ...)
|
||||
local types = omi.GetModule("types")
|
||||
|
||||
@@ -30,7 +30,7 @@ function StatusBar:Init(parent, width, height, level, top)
|
||||
local bar = CreateFrame("StatusBar", nil, parentFrame)
|
||||
bar:SetFrameStrata("MEDIUM")
|
||||
bar:SetFrameLevel(level)
|
||||
|
||||
|
||||
if top then
|
||||
bar:SetPoint("TOPLEFT", parentFrame, "TOPLEFT", 0, 0)
|
||||
else
|
||||
@@ -42,12 +42,12 @@ function StatusBar:Init(parent, width, height, level, top)
|
||||
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
|
||||
|
||||
|
||||
self:SetRange(0, 1)
|
||||
self:SetValue(1)
|
||||
bar:Show()
|
||||
@@ -70,13 +70,13 @@ function StatusBar:Hide()
|
||||
end
|
||||
|
||||
function StatusBar:SetInterpolatedColor(start, stop, progress)
|
||||
local r = start[1] + (stop[1] - start[1])*progress
|
||||
local g = start[2] + (stop[2] - start[2])*progress
|
||||
local b = start[3] + (stop[3] - start[3])*progress
|
||||
local r = start[1] + (stop[1] - start[1]) * progress
|
||||
local g = start[2] + (stop[2] - start[2]) * progress
|
||||
local b = start[3] + (stop[3] - start[3]) * progress
|
||||
self:SetColor(r, g, b)
|
||||
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)
|
||||
self.bg:SetVertexColor(0.2 * r, 0.2 * g, 0.2 * b)
|
||||
end
|
||||
Reference in new issue
Block a user