forked from wow/OmicronFrames
Apply stylua to the entire codebase
This commit is contained in:
1 parent
0cced419a6
commit
f181c0022c
10 files changed
+38
-44
No files matched your search
@@ -27,20 +27,13 @@ local Trigger = types.Trigger
|
||||
local AuraTrigger = types.CreateClass("AuraTrigger", Trigger)
|
||||
types.AuraTrigger = AuraTrigger
|
||||
|
||||
|
||||
---Creates a new AuraTrigger from a config description and attaches it to the
|
||||
---correct data source
|
||||
---@param unit UnitFrame
|
||||
---@param config table
|
||||
---@return AuraTrigger
|
||||
function AuraTrigger.CreateFromConfig(unit, config)
|
||||
local trigger = AuraTrigger:new(
|
||||
config.spellId,
|
||||
config.own,
|
||||
config.requiredCount,
|
||||
config.invert,
|
||||
config.defaultData
|
||||
)
|
||||
local trigger = AuraTrigger:new(config.spellId, config.own, config.requiredCount, config.invert, config.defaultData)
|
||||
unit.auras:AddTrigger(trigger)
|
||||
return trigger
|
||||
end
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -26,7 +26,7 @@ local Trigger = types.Trigger
|
||||
---indicator.
|
||||
---@class MultiTrigger: Trigger
|
||||
---@field active boolean
|
||||
---@field invert boolean
|
||||
---@field invert boolean
|
||||
local MultiTrigger = types.CreateClass("MultiTrigger", Trigger)
|
||||
types.MultiTrigger = MultiTrigger
|
||||
|
||||
@@ -73,7 +73,7 @@ function MultiTrigger:AddTrigger(trigger)
|
||||
end,
|
||||
Hide = function(_, data)
|
||||
self:OnChildDeactivate(idx, trigger, data)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
@@ -141,4 +141,3 @@ end
|
||||
function MultiTrigger:Reset()
|
||||
self:SetState(false)
|
||||
end
|
||||
|
||||
@@ -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")
|
||||
---@class Trigger
|
||||
@@ -29,8 +29,7 @@ types.StatusTrigger = StatusTrigger
|
||||
---@param unit UnitFrame
|
||||
---@param config table
|
||||
function StatusTrigger.CreateFromConfig(unit, config)
|
||||
local trigger = StatusTrigger:new(config.status, config.requiredCount,
|
||||
config.invert, config.defaultData)
|
||||
local trigger = StatusTrigger:new(config.status, config.requiredCount, config.invert, config.defaultData)
|
||||
unit.auras:AddTrigger(trigger)
|
||||
return trigger
|
||||
end
|
||||
@@ -45,7 +44,7 @@ end
|
||||
|
||||
--- Initialize a new AuraTrigger object
|
||||
---@param status string The kind of status to trigger on
|
||||
---@param requiredCount number | nil
|
||||
---@param requiredCount number | nil
|
||||
---@param invert boolean | nil
|
||||
function StatusTrigger:Init(status, requiredCount, invert, defaultData)
|
||||
Trigger.Init(self, invert, defaultData)
|
||||
|
||||
@@ -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,22 +13,21 @@
|
||||
-- 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")
|
||||
|
||||
--- Triggers objects provide a link between indicators and some data source. They
|
||||
-- can pass data from the data source into the indicator. This is a supertype for
|
||||
-- all triggers and should not be constructed on its own.
|
||||
-- can pass data from the data source into the indicator. This is a supertype for
|
||||
-- all triggers and should not be constructed on its own.
|
||||
---@class Trigger: Object
|
||||
---@field active boolean
|
||||
---@field invert boolean
|
||||
---@field invert boolean
|
||||
---@field indicator Indicator
|
||||
---@field data table The most recent data updated by the data source
|
||||
local Trigger = types.CreateClass("Trigger")
|
||||
types.Trigger = Trigger
|
||||
|
||||
|
||||
---@param unit UnitFrame
|
||||
---@param config table
|
||||
---@return Trigger
|
||||
@@ -91,4 +90,3 @@ end
|
||||
function Trigger:Reset()
|
||||
self:SetState(false, false)
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user