Code format

This commit is contained in:
2025-05-15 21:19:10 +02:00
parent 4220b4d0bd
commit 635147c29b
7 changed files with 141 additions and 168 deletions

View File

@@ -1,13 +1,6 @@
local function getItemLink(container, slot)
return select(7, GetContainerItemInfo(container, slot)) or ""
end
local function getBindType(container, slot)
return select(14, GetItemInfo(getItemLink(container, slot))) or 0
end
local function isBoe(container, slot)
return getBindType(container, slot) == 1
end
local function getItemLink(container, slot) return select(7, GetContainerItemInfo(container, slot)) or "" end
local function getBindType(container, slot) return select(14, GetItemInfo(getItemLink(container, slot))) or 0 end
local function isBoe(container, slot) return getBindType(container, slot) == 1 end
local showGlow = function(container, slot)
ActionButton_ShowOverlayGlow(_G["ElvUI_ContainerFrameBag" .. container .. "Slot" .. slot])

View File

@@ -8,16 +8,12 @@ local CooldownType = {
}
local NullType = CooldownType:New()
NullType.GetActiveInfo = function(self)
return false, 0, 0
end
NullType.GetActiveInfo = function(self) return false, 0, 0 end
local TotemType = CooldownType:New()
TotemType.GetActiveInfo = function(self)
for i = 1, 4 do
local present, name, start, duration = GetTotemInfo(i)
if present and name == self.name then
return true, start, duration
end
if present and name == self.name then return true, start, duration end
end
return false, 0, 0
end
@@ -41,9 +37,7 @@ local Cooldown = {
return start > 0 and duration > aura_env.gcdThreshold, start, duration
end,
GetActiveInfo = function(self)
return self.type:GetActiveInfo()
end
GetActiveInfo = function(self) return self.type:GetActiveInfo() end,
}
aura_env.cooldowns = {

View File

@@ -37,9 +37,9 @@ aura_env.processEvent = function(allstates)
for k, spellId in pairs(aura_env.trackedSpells) do
-- Handle spells with charges
local isReady
if (aura_env.cache[spellId].hasCharges) then
if aura_env.cache[spellId].hasCharges then
local charges = select(1, GetSpellCharges(spellId))
if (charges > aura_env.cache[spellId].charges) then
if charges > aura_env.cache[spellId].charges then
isReady = true
aura_env.cache[spellId].charges = charges
else
@@ -50,8 +50,7 @@ aura_env.processEvent = function(allstates)
isReady = select(2, GetSpellCooldown(spellId)) < gcdDuration
end
if (not aura_env.cache[spellId].ready and isReady) then
if not aura_env.cache[spellId].ready and isReady then
local icon = select(3, GetSpellInfo(spellId))
allstates[spellId] = {
show = true,

View File

@@ -7,9 +7,7 @@ for _, group in ipairs(groups) do
local playerFrames = { playerFrame1, playerFrame2, playerFrame3, playerFrame4, playerFrame5 }
for _, player in ipairs(playerFrames) do
if player.Name:IsVisible() then
aura_env.players[#aura_env.players + 1] = player
end
if player.Name:IsVisible() then aura_env.players[#aura_env.players + 1] = player end
end
end

View File

@@ -8,38 +8,31 @@ local allianceRaces = {
"Gnome",
"Human",
"Night Elf",
"Worgen"
"Worgen",
}
PlayerController = {
nearbyPlayers = {},
addPlayer = function(self, name)
self.nearbyPlayers[name] = Player:New(name)
end,
getPlayers = function(self)
end,
addPlayer = function(self, name) self.nearbyPlayers[name] = Player:New(name) end,
getPlayers = function(self) end,
process = function(guid)
if (self.nearbyPlayers[guid] == nil) then
if self.nearbyPlayers[guid] == nil then
self.addPlayer(guid)
else
end
end
end,
}
Player = {
guid = nil,
lastSighted = nil,
info = nil,
update = function(self)
self.lastSighted = GetTime()
end,
update = function(self) self.lastSighted = GetTime() end,
getFormatted = function(self)
-- Color by class
-- Format time
return info.name .. " " .. self.lastSighted
end
end,
}
PlayerInfo = {
class = nil,
@@ -73,7 +66,7 @@ function PlayerInfo:New(guid)
class = info.class,
race = info.race,
name = info.name,
isHostile = allianceRaces[race] ~= nil
isHostile = allianceRaces[race] ~= nil,
}
end
o.class = info.class or ""

View File

@@ -1,5 +1,3 @@
aura_env.getCharges = function()
return select(1, GetSpellCharges(53600))
end
aura_env.getCharges = function() return select(1, GetSpellCharges(53600)) end
aura_env.currentCharges = 0

View File

@@ -1,8 +1,6 @@
aura_env.findAura = function(LFname)
for i = 1, 40 do
local name = UnitAura("player", i)
if (name == LFname) then
return i
end
if name == LFname then return i end
end
end