Add autoloot display weakaura
This commit is contained in:
30
Weakauras/Autoloot/event.lua
Normal file
30
Weakauras/Autoloot/event.lua
Normal 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
|
1
Weakauras/Autoloot/export
Normal file
1
Weakauras/Autoloot/export
Normal file
File diff suppressed because one or more lines are too long
12
Weakauras/Autoloot/init.lua
Normal file
12
Weakauras/Autoloot/init.lua
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
RegisterAddonMessagePrefix("CYKA_AUTOLOOT")
|
||||||
|
aura_env.QualityColors = {
|
||||||
|
"9C9D9D",
|
||||||
|
"FFFFFF",
|
||||||
|
"1EFF00",
|
||||||
|
"0070DD",
|
||||||
|
"A335EE",
|
||||||
|
"FF8000",
|
||||||
|
"E6CC80",
|
||||||
|
"00CCFF",
|
||||||
|
}
|
||||||
|
aura_env.ttl = 3
|
Reference in New Issue
Block a user