Code format

This commit is contained in:
2025-05-15 20:37:50 +02:00
parent 9e6432d0b0
commit 69d1f9fd93
105 changed files with 24069 additions and 28084 deletions

View File

@@ -14,7 +14,7 @@ aura_env.BaseCooldown = {
---@return BaseCooldown
new = function(id, name, playbackSpeed)
local self = setmetatable({}, {
__index = aura_env.BaseCooldown
__index = aura_env.BaseCooldown,
})
self.id = id
self.name = name
@@ -58,8 +58,7 @@ aura_env.BaseCooldown = {
playComplete = function(self)
local soundFile = string.format("Interface\\Sounds\\alerts\\%s.ogg", self.filename)
if aura_env.debug then
print(string.format("%s is off cooldown, playing sound file at %s", self.filename,
soundFile))
print(string.format("%s is off cooldown, playing sound file at %s", self.filename, soundFile))
end
WeakAuras.ScanEvents("PLAY_SOUND", soundFile)
end,
@@ -68,11 +67,10 @@ aura_env.BaseCooldown = {
playSoon = function(self)
local soundFile = string.format("Interface\\Sounds\\alerts\\%s_soon.ogg", self.filename)
if aura_env.debug then
print(string.format("%s is almost off cooldown, playing sound file at %s", self.filename,
soundFile))
print(string.format("%s is almost off cooldown, playing sound file at %s", self.filename, soundFile))
end
WeakAuras.ScanEvents("PLAY_SOUND", soundFile)
end
end,
}
---@class Spell:BaseCooldown
@@ -85,15 +83,13 @@ aura_env.Spell = {
local obj = aura_env.BaseCooldown.new(id, name, playbackSpeed)
---@cast obj Spell
setmetatable(obj, {
__index = aura_env.Spell
__index = aura_env.Spell,
})
return obj
end,
Update = function(self)
aura_env.BaseCooldown.Update(self, GetSpellCooldown)
end,
Update = function(self) aura_env.BaseCooldown.Update(self, GetSpellCooldown) end,
playComplete = aura_env.BaseCooldown.playComplete,
playSoon = aura_env.BaseCooldown.playSoon
playSoon = aura_env.BaseCooldown.playSoon,
}
---@class Item:BaseCooldown
aura_env.Item = {
@@ -105,15 +101,13 @@ aura_env.Item = {
local obj = aura_env.BaseCooldown.new(id, name, playbackSpeed)
---@cast obj Item
setmetatable(obj, {
__index = aura_env.Item
__index = aura_env.Item,
})
return obj
end,
Update = function(self)
aura_env.BaseCooldown.Update(self, GetItemCooldown)
end,
Update = function(self) aura_env.BaseCooldown.Update(self, GetItemCooldown) end,
playComplete = aura_env.BaseCooldown.playComplete,
playSoon = aura_env.BaseCooldown.playSoon
playSoon = aura_env.BaseCooldown.playSoon,
}
---@class Buff:BaseCooldown
---@field isActive boolean
@@ -126,7 +120,7 @@ aura_env.Buff = {
local obj = aura_env.BaseCooldown.new(id, name, playbackSpeed)
---@cast obj Buff
setmetatable(obj, {
__index = aura_env.Buff
__index = aura_env.Buff,
})
obj.isActive = false
return obj
@@ -156,15 +150,19 @@ aura_env.Buff = {
---@param self Buff
playComplete = function(self)
local soundFile = string.format("Interface\\Sounds\\alerts\\%s_expired.ogg", self.filename)
if aura_env.debug then print(string.format("%s expired, playing sound file at %s", self.filename, soundFile)) end
if aura_env.debug then
print(string.format("%s expired, playing sound file at %s", self.filename, soundFile))
end
WeakAuras.ScanEvents("PLAY_SOUND", soundFile)
end,
---@param self Buff
playSoon = function(self)
local soundFile = string.format("Interface\\Sounds\\alerts\\%s_expiring.ogg", self.filename)
if aura_env.debug then print(string.format("%s expiring, playing sound file at %s", self.filename, soundFile)) end
if aura_env.debug then
print(string.format("%s expiring, playing sound file at %s", self.filename, soundFile))
end
WeakAuras.ScanEvents("PLAY_SOUND", soundFile)
end
end,
}
---@type table<BaseCooldown>|nil
@@ -185,5 +183,5 @@ aura_env.Cooldowns = {
aura_env.Spell.new(196098, "Soul Harvest", 1.6),
aura_env.Item.new(5512, "Healthstone", 1.6),
aura_env.Buff.new(0, "Deadwind Harvester", 1.6),
}
},
}