Code format
This commit is contained in:
@@ -8,12 +8,12 @@ aura_env.Colorer = {
|
||||
colors = {
|
||||
{ r = 0.62, g = 0.62, b = 0.62 }, -- Grey
|
||||
-- { r = 1, g = 1, b = 1 }, -- White
|
||||
{ r = 0.12, g = 1, b = 0 }, -- Green
|
||||
{ r = 0, g = 0.44, b = 0.87 }, -- Blue
|
||||
{ r = 0.12, g = 1, b = 0 }, -- Green
|
||||
{ r = 0, g = 0.44, b = 0.87 }, -- Blue
|
||||
{ r = 0.64, g = 0.21, b = 0.93 }, -- Purple
|
||||
{ r = 1, g = 0.5, b = 0 }, -- Orange
|
||||
{ r = 0.9, g = 0.8, b = 0.5 }, -- Light Gold
|
||||
{ r = 0, g = 0.8, b = 1.0 }, -- Blizzard Blue
|
||||
{ r = 1, g = 0.5, b = 0 }, -- Orange
|
||||
{ r = 0.9, g = 0.8, b = 0.5 }, -- Light Gold
|
||||
{ r = 0, g = 0.8, b = 1.0 }, -- Blizzard Blue
|
||||
},
|
||||
breakpoints = { 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1000.0 },
|
||||
|
||||
@@ -37,9 +37,7 @@ aura_env.Colorer = {
|
||||
---@type Color
|
||||
local endColor = aura_env.Colorer.colors[bracket[2][1]]
|
||||
|
||||
if startColor == nil or endColor == nil then
|
||||
return color, "Color not found"
|
||||
end
|
||||
if startColor == nil or endColor == nil then return color, "Color not found" end
|
||||
|
||||
local fraction = (value - bracket[1][2]) / (bracket[2][2] - bracket[1][2])
|
||||
|
||||
@@ -54,9 +52,7 @@ aura_env.Colorer = {
|
||||
---@param b number
|
||||
---@param t number
|
||||
---@return number
|
||||
lerp = function(a, b, t)
|
||||
return a * (1 - t) + b * t
|
||||
end
|
||||
lerp = function(a, b, t) return a * (1 - t) + b * t end,
|
||||
}
|
||||
setmetatable(aura_env.Colorer, { __index = aura_env.Colorer })
|
||||
|
||||
@@ -69,7 +65,7 @@ aura_env.ShieldBuffer = {
|
||||
---@return ShieldBuffer
|
||||
new = function(recordsToKeep)
|
||||
local self = setmetatable({}, {
|
||||
__index = aura_env.ShieldBuffer
|
||||
__index = aura_env.ShieldBuffer,
|
||||
})
|
||||
self.recordsToKeep = recordsToKeep
|
||||
self.records = {}
|
||||
@@ -92,9 +88,7 @@ aura_env.ShieldBuffer = {
|
||||
GetMax = function(self)
|
||||
local max = 0
|
||||
for _, value in pairs(self.records) do
|
||||
if value > max then
|
||||
max = value
|
||||
end
|
||||
if value > max then max = value end
|
||||
end
|
||||
if max == nil then return 0 end
|
||||
return max
|
||||
@@ -105,7 +99,7 @@ aura_env.ShieldBuffer = {
|
||||
local val = self.records[(self.pointer + self.recordsToKeep - 2) % self.recordsToKeep + 1]
|
||||
if val == nil then return 0 end
|
||||
return val
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
---@class Shield
|
||||
@@ -117,7 +111,7 @@ aura_env.Shield = {
|
||||
---@return Shield
|
||||
new = function(name)
|
||||
local self = setmetatable({}, {
|
||||
__index = aura_env.Shield
|
||||
__index = aura_env.Shield,
|
||||
})
|
||||
self.name = name
|
||||
self.value = 0
|
||||
@@ -135,7 +129,7 @@ aura_env.Shield = {
|
||||
self.value = 0
|
||||
end
|
||||
self.buffer:Append(self.value)
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
---@class ShieldManager
|
||||
@@ -177,7 +171,7 @@ aura_env.ShieldManager = {
|
||||
return string.format("%.1fM", current / 1e6), string.format("%.1fM", max / 1e6), current, max
|
||||
end
|
||||
return string.format("%.0fk", current / 1000), string.format("%.0fk", max / 1000), current, max
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
---@class Display
|
||||
@@ -202,7 +196,7 @@ aura_env.Display = {
|
||||
aura_env.Display.ofHp = string.format("%.0f%%", aura_env.Display.ofHpRaw)
|
||||
aura_env.Display.color = aura_env.Colorer.Interpolate(aura_env.Display.ofHpRawFraction)
|
||||
return nil
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
---@type table<Shield>
|
||||
|
||||
Reference in New Issue
Block a user