Various changes #1
1
.stylua.toml
Normal file
1
.stylua.toml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
indent_type = "Spaces"
|
@@ -88,7 +88,7 @@ Commander.RegisterCommand("omi-pstart", {
|
|||||||
PrintLn("To enable the script profiler run `/console scriptProfile 1`, then reload the UI.")
|
PrintLn("To enable the script profiler run `/console scriptProfile 1`, then reload the UI.")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
Commander.RegisterCommand("omi-pstop", {
|
Commander.RegisterCommand("omi-pstop", {
|
||||||
@@ -117,7 +117,9 @@ Commander.RegisterCommand("omi-pstop", {
|
|||||||
time = time * 1000,
|
time = time * 1000,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
table.sort(data, function(a, b) return a.time < b.time end)
|
table.sort(data, function(a, b)
|
||||||
|
return a.time < b.time
|
||||||
|
end)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -136,5 +138,5 @@ Commander.RegisterCommand("omi-pprint", {
|
|||||||
local ms_per_sec = time / total
|
local ms_per_sec = time / total
|
||||||
Printf("% 6.1f%% % 7.2fms %7.2fms/s %s\n", pct, time, ms_per_sec, item.name)
|
Printf("% 6.1f%% % 7.2fms %7.2fms/s %s\n", pct, time, ms_per_sec, item.name)
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
})
|
})
|
||||||
|
@@ -26,13 +26,10 @@ local Indicator = types.CreateClass("Indicator")
|
|||||||
types.Indicator = Indicator
|
types.Indicator = Indicator
|
||||||
|
|
||||||
--- Show the indicator and supply it with data
|
--- Show the indicator and supply it with data
|
||||||
function Indicator:Show(data)
|
function Indicator:Show(data) end
|
||||||
end
|
|
||||||
|
|
||||||
--- Update the indicator with new data
|
--- Update the indicator with new data
|
||||||
function Indicator:Update(data)
|
function Indicator:Update(data) end
|
||||||
end
|
|
||||||
|
|
||||||
--- Hide the indicator
|
--- Hide the indicator
|
||||||
function Indicator:Hide()
|
function Indicator:Hide() end
|
||||||
end
|
|
||||||
|
@@ -21,7 +21,9 @@ types.StatusBar = types.CreateClass("StatusBar")
|
|||||||
local StatusBar = types.StatusBar
|
local StatusBar = types.StatusBar
|
||||||
|
|
||||||
function StatusBar:Init(parent, width, height, level, top, texture, bgtexture)
|
function StatusBar:Init(parent, width, height, level, top, texture, bgtexture)
|
||||||
if top == nil then top = true end
|
if top == nil then
|
||||||
|
top = true
|
||||||
|
end
|
||||||
level = level or 0
|
level = level or 0
|
||||||
-- parent: the parent frame
|
-- parent: the parent frame
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
|
@@ -27,20 +27,13 @@ local Trigger = types.Trigger
|
|||||||
local AuraTrigger = types.CreateClass("AuraTrigger", Trigger)
|
local AuraTrigger = types.CreateClass("AuraTrigger", Trigger)
|
||||||
types.AuraTrigger = AuraTrigger
|
types.AuraTrigger = AuraTrigger
|
||||||
|
|
||||||
|
|
||||||
---Creates a new AuraTrigger from a config description and attaches it to the
|
---Creates a new AuraTrigger from a config description and attaches it to the
|
||||||
---correct data source
|
---correct data source
|
||||||
---@param unit UnitFrame
|
---@param unit UnitFrame
|
||||||
---@param config table
|
---@param config table
|
||||||
---@return AuraTrigger
|
---@return AuraTrigger
|
||||||
function AuraTrigger.CreateFromConfig(unit, config)
|
function AuraTrigger.CreateFromConfig(unit, config)
|
||||||
local trigger = AuraTrigger:new(
|
local trigger = AuraTrigger:new(config.spellId, config.own, config.requiredCount, config.invert, config.defaultData)
|
||||||
config.spellId,
|
|
||||||
config.own,
|
|
||||||
config.requiredCount,
|
|
||||||
config.invert,
|
|
||||||
config.defaultData
|
|
||||||
)
|
|
||||||
unit.auras:AddTrigger(trigger)
|
unit.auras:AddTrigger(trigger)
|
||||||
return trigger
|
return trigger
|
||||||
end
|
end
|
||||||
|
@@ -73,7 +73,7 @@ function MultiTrigger:AddTrigger(trigger)
|
|||||||
end,
|
end,
|
||||||
Hide = function(_, data)
|
Hide = function(_, data)
|
||||||
self:OnChildDeactivate(idx, trigger, data)
|
self:OnChildDeactivate(idx, trigger, data)
|
||||||
end
|
end,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -141,4 +141,3 @@ end
|
|||||||
function MultiTrigger:Reset()
|
function MultiTrigger:Reset()
|
||||||
self:SetState(false)
|
self:SetState(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -29,8 +29,7 @@ types.StatusTrigger = StatusTrigger
|
|||||||
---@param unit UnitFrame
|
---@param unit UnitFrame
|
||||||
---@param config table
|
---@param config table
|
||||||
function StatusTrigger.CreateFromConfig(unit, config)
|
function StatusTrigger.CreateFromConfig(unit, config)
|
||||||
local trigger = StatusTrigger:new(config.status, config.requiredCount,
|
local trigger = StatusTrigger:new(config.status, config.requiredCount, config.invert, config.defaultData)
|
||||||
config.invert, config.defaultData)
|
|
||||||
unit.auras:AddTrigger(trigger)
|
unit.auras:AddTrigger(trigger)
|
||||||
return trigger
|
return trigger
|
||||||
end
|
end
|
||||||
|
@@ -28,7 +28,6 @@ local types = omi.GetModule("types")
|
|||||||
local Trigger = types.CreateClass("Trigger")
|
local Trigger = types.CreateClass("Trigger")
|
||||||
types.Trigger = Trigger
|
types.Trigger = Trigger
|
||||||
|
|
||||||
|
|
||||||
---@param unit UnitFrame
|
---@param unit UnitFrame
|
||||||
---@param config table
|
---@param config table
|
||||||
---@return Trigger
|
---@return Trigger
|
||||||
@@ -91,4 +90,3 @@ end
|
|||||||
function Trigger:Reset()
|
function Trigger:Reset()
|
||||||
self:SetState(false, false)
|
self:SetState(false, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@ local function CreateClassRaw(name, parent)
|
|||||||
c.__typeInfo = {
|
c.__typeInfo = {
|
||||||
name = name,
|
name = name,
|
||||||
class = c,
|
class = c,
|
||||||
parent = parent
|
parent = parent,
|
||||||
}
|
}
|
||||||
c.__index = c
|
c.__index = c
|
||||||
if parent ~= nil then
|
if parent ~= nil then
|
||||||
@@ -49,6 +49,5 @@ function types.IsDerivedFrom(a, b)
|
|||||||
end
|
end
|
||||||
current = current.__typeInfo.parent
|
current = current.__typeInfo.parent
|
||||||
until current == nil
|
until current == nil
|
||||||
;
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
@@ -36,7 +36,6 @@ local BorderIndicator = types.BorderIndicator
|
|||||||
local UnitFrame = types.CreateClass("UnitFrame")
|
local UnitFrame = types.CreateClass("UnitFrame")
|
||||||
types.UnitFrame = UnitFrame
|
types.UnitFrame = UnitFrame
|
||||||
|
|
||||||
|
|
||||||
local colors = {
|
local colors = {
|
||||||
hostile = { 0.5, 0.0, 0.0 },
|
hostile = { 0.5, 0.0, 0.0 },
|
||||||
neutral = { 0.7, 0.7, 0.0 },
|
neutral = { 0.7, 0.7, 0.0 },
|
||||||
@@ -54,8 +53,8 @@ local colors = {
|
|||||||
bomb = { 1.0, 0.7, 0.7 },
|
bomb = { 1.0, 0.7, 0.7 },
|
||||||
cyan = { 0.0, 0.8, 0.8 },
|
cyan = { 0.0, 0.8, 0.8 },
|
||||||
white = { 1.0, 1.0, 1.0 },
|
white = { 1.0, 1.0, 1.0 },
|
||||||
shield = { 0.85, .95, 1.0 },
|
shield = { 0.85, 0.95, 1.0 },
|
||||||
absorb = { 0.5, .4, .75 },
|
absorb = { 0.5, 0.4, 0.75 },
|
||||||
}
|
}
|
||||||
|
|
||||||
-- This trucates _codepoints_ not graphemes. If combination codepoints are
|
-- This trucates _codepoints_ not graphemes. If combination codepoints are
|
||||||
@@ -112,7 +111,6 @@ function UnitFrame:Init(unit, config)
|
|||||||
|
|
||||||
self.auras = AuraList:new(self)
|
self.auras = AuraList:new(self)
|
||||||
|
|
||||||
|
|
||||||
local overlays = CreateFrame("Frame", nil, secure)
|
local overlays = CreateFrame("Frame", nil, secure)
|
||||||
overlays:SetFrameStrata("MEDIUM")
|
overlays:SetFrameStrata("MEDIUM")
|
||||||
overlays:SetFrameLevel(100)
|
overlays:SetFrameLevel(100)
|
||||||
@@ -292,9 +290,15 @@ function UnitFrame:PrepareWheelBinds(bindings)
|
|||||||
if bind.button == "wheel-up" or bind.button == "wheel-down" then
|
if bind.button == "wheel-up" or bind.button == "wheel-down" then
|
||||||
local prefix = ModifiersToPrefix(bind.mods)
|
local prefix = ModifiersToPrefix(bind.mods)
|
||||||
local button = bind.button == "wheel-up" and "MOUSEWHEELUP" or "MOUSEWHEELDOWN"
|
local button = bind.button == "wheel-up" and "MOUSEWHEELUP" or "MOUSEWHEELDOWN"
|
||||||
table.insert(bindScript,
|
table.insert(
|
||||||
string.format([[self:SetBindingClick(false, "%s%s", "OmicronSecureFrame%s", "%s%s")]],
|
bindScript,
|
||||||
prefix, button, unit, prefix, bind.button
|
string.format(
|
||||||
|
[[self:SetBindingClick(false, "%s%s", "OmicronSecureFrame%s", "%s%s")]],
|
||||||
|
prefix,
|
||||||
|
button,
|
||||||
|
unit,
|
||||||
|
prefix,
|
||||||
|
bind.button
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user