Cleanup and details

This commit is contained in:
2024-10-14 18:27:30 +02:00
parent 0ce3b54169
commit d4673d8f74
4 changed files with 35 additions and 28 deletions

View File

@@ -5,7 +5,9 @@ function()
if message == nil then return end if message == nil then return end
table.remove(aura_env.messageQueue, 1) table.remove(aura_env.messageQueue, 1)
print(string.format("Processing message; %d in queue", #aura_env.messageQueue)) if aura_env.config.debug then
print(string.format("Processing message; %d in queue", #aura_env.messageQueue))
end
if message.addon then if message.addon then
SendAddonMessage(aura_env.addonprefix, message.message, message.channel, message.to) SendAddonMessage(aura_env.addonprefix, message.message, message.channel, message.to)

View File

@@ -80,18 +80,21 @@ function(allstates, e, prefix, msg, ...)
return return
end end
if not allstates[name] then
PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master")
end
allstates[name] = { allstates[name] = {
show = true, show = true,
changed = true, changed = true,
name = string.format("%-30s", name), name = string.format("%-30s", name),
progressType = "timed", progressType = "timed",
duration = 60, duration = 60,
expirationTime = GetTime() + 60, expirationTime = GetTime() + aura_env.config.alertThrottle,
autohide = true, autohide = true,
index = GetTime(), index = GetTime(),
progress = string.format("%20s", "0s"), progress = string.format("%20s", "0s"),
} }
PlaySoundFile("Interface\\Sounds\\Domination.ogg", "Master")
return true return true
end end

File diff suppressed because one or more lines are too long

View File

@@ -250,7 +250,7 @@ aura_env.localStinkies = {}
---@param name string ---@param name string
aura_env.StinkyDetected = function(name) aura_env.StinkyDetected = function(name)
if not aura_env.localStinkies[name] or aura_env.localStinkies[name] < if not aura_env.localStinkies[name] or aura_env.localStinkies[name] <
GetTime() - aura_env.config.throttle then GetTime() - aura_env.config.messageThrottle then
local stinky = aura_env.stinkies[name] local stinky = aura_env.stinkies[name]
Message.QueueNotifyGuild(stinky) Message.QueueNotifyGuild(stinky)
Message.QueueNotifyWhisper(stinky) Message.QueueNotifyWhisper(stinky)
@@ -260,34 +260,36 @@ aura_env.StinkyDetected = function(name)
aura_env.localStinkies[name] = GetTime() aura_env.localStinkies[name] = GetTime()
end end
local friends = {} if aura_env.config.addFriends and not aura_env.config.addFriends2 then
local numfriends = GetNumFriends() local friends = {}
for i = 1, numfriends do
local name = GetFriendInfo(i)
friends[name] = true
end
for k, v in pairs(WeakAurasSaved.Cyka.Stinkies) do
if not friends[k] then
AddFriend(k)
end
end
C_Timer.After(1, function()
local numfriends = GetNumFriends() local numfriends = GetNumFriends()
for i = 1, numfriends do for i = 1, numfriends do
local name = GetFriendInfo(i) local name = GetFriendInfo(i)
if WeakAurasSaved.Cyka.Stinkies[name] then friends[name] = true
C_Timer.After(1, function() end
-- print(name .. " " .. i .. " Stinky!") for k, v in pairs(WeakAurasSaved.Cyka.Stinkies) do
SetFriendNotes(i, "STINKY") if not friends[k] then
end) AddFriend(k)
else
C_Timer.After(1, function()
-- print(name .. " " .. i .. " Not stinky")
SetFriendNotes(i, "Not stinky?")
end)
end end
end end
end) C_Timer.After(1, function()
local numfriends = GetNumFriends()
for i = 1, numfriends do
local name = GetFriendInfo(i)
if WeakAurasSaved.Cyka.Stinkies[name] then
C_Timer.After(1, function()
-- print(name .. " " .. i .. " Stinky!")
SetFriendNotes(i, "STINKY")
end)
else
C_Timer.After(1, function()
-- print(name .. " " .. i .. " Not stinky")
SetFriendNotes(i, "Not stinky?")
end)
end
end
end)
end
--/run WeakAurasSaved.Cyka.Stinkies["Totleta"] = true --/run WeakAurasSaved.Cyka.Stinkies["Totleta"] = true
-- /dump WeakAurasSaved.Cyka.Stinkies -- /dump WeakAurasSaved.Cyka.Stinkies