34 lines
954 B
Lua
34 lines
954 B
Lua
local iconDisplayDuration = 3
|
|
|
|
aura_env.getItemInfo = function(msg)
|
|
local name = msg:match("h%[(.+)%]") or ""
|
|
local quantity = msg:match("x(%d+)") or 1
|
|
|
|
local icon = 134400
|
|
if WeakAurasSaved.Cyka.ItemCache[name] then
|
|
icon = WeakAurasSaved.Cyka.ItemCache[name].icon
|
|
end
|
|
local color = msg:match("cff(%w%w%w%w%w%w)") or "ffffff"
|
|
|
|
return name, icon, quantity, color
|
|
end
|
|
|
|
aura_env.drawIcon = function(msg)
|
|
local name, icon, quantity, color = aura_env.getItemInfo(msg)
|
|
|
|
local formattedName = "\124cff" .. color .. "[" .. name .. "]\124r x" .. quantity
|
|
aura_env.allstates[#aura_env.allstates + 1] = {
|
|
show = true,
|
|
changed = true,
|
|
index = GetTime(),
|
|
resort = true,
|
|
|
|
icon = icon,
|
|
name = formattedName,
|
|
|
|
progressType = "timed",
|
|
expirationTime = GetTime() + iconDisplayDuration,
|
|
duration = iconDisplayDuration,
|
|
autoHide = true,
|
|
}
|
|
end |