Separate auto loot into logic and icon
This commit is contained in:
7
LegionWA/LootDisplay/Event.lua
Normal file
7
LegionWA/LootDisplay/Event.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
-- CHAT_MSG_LOOT
|
||||
function(allstates, e, msg)
|
||||
aura_env.allstates = allstates
|
||||
|
||||
aura_env.drawIcon(msg)
|
||||
return true
|
||||
end
|
||||
1
LegionWA/LootDisplay/Export
Normal file
1
LegionWA/LootDisplay/Export
Normal file
File diff suppressed because one or more lines are too long
32
LegionWA/LootDisplay/Init.lua
Normal file
32
LegionWA/LootDisplay/Init.lua
Normal file
@@ -0,0 +1,32 @@
|
||||
local iconDisplayDuration = 3
|
||||
|
||||
aura_env.getItemInfo = function(msg)
|
||||
DevTools_Dump(msg)
|
||||
local name = msg:match("h%[(.+)%]") or ""
|
||||
local quantity = msg:match("x(%d+)") or 1
|
||||
|
||||
local icon = WeakAurasSaved.Cyka.ItemCache[name].icon or 134400
|
||||
local color = msg:match("%|cff(.){6}") 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
|
||||
Reference in New Issue
Block a user