Add autoloot display weakaura

This commit is contained in:
2024-12-27 08:47:46 +01:00
parent 3db30236ea
commit ccd87ef48f
3 changed files with 43 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
-- CHAT_MSG_ADDON
function(allstates, e, prefix, message, type, target)
if prefix ~= "CYKA_AUTOLOOT" then return end
local name, quantityS, qualityS, icon = strsplit("|", message)
local quality = tonumber(qualityS)
local quantity = tonumber(quantityS)
local formattedName = string.format("\124cff%s[%s]\124r x%s (%s)",
tostring(aura_env.QualityColors[quality+1]),
tostring(name),
tostring(quantity),
tostring(GetItemCount(name) + quantity))
allstates[#allstates + 1] = {
show = true,
changed = true,
index = GetTime(),
resort = true,
icon = icon,
name = formattedName,
progressType = "timed",
expirationTime = GetTime() + aura_env.ttl,
duration = aura_env.ttl,
autoHide = true,
}
return true
end

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,12 @@
RegisterAddonMessagePrefix("CYKA_AUTOLOOT")
aura_env.QualityColors = {
"9C9D9D",
"FFFFFF",
"1EFF00",
"0070DD",
"A335EE",
"FF8000",
"E6CC80",
"00CCFF",
}
aura_env.ttl = 3