64 lines
1.5 KiB
Lua
64 lines
1.5 KiB
Lua
--BAG_UPDATE UPDATE
|
|
function(allstates, e, id)
|
|
if e == "BAG_UPDATE" then
|
|
if id then
|
|
for i = 1, GetContainerNumSlots(id) do
|
|
local iid = GetContainerItemID(id, i)
|
|
if aura_env.herbIDs[iid] then
|
|
local texture = select(1, GetContainerItemInfo(id, i))
|
|
local amount = GetItemCount(iid, false)
|
|
local bank = GetItemCount(iid, true) - amount
|
|
allstates[iid] =
|
|
{
|
|
show = true,
|
|
changed = true,
|
|
amount = amount,
|
|
bank = bank,
|
|
index = amount,
|
|
icon = texture,
|
|
itemId = iid,
|
|
resort = true,
|
|
}
|
|
return true
|
|
end
|
|
end
|
|
end
|
|
elseif e == "UPDATE" then
|
|
for i = 0, 4 do
|
|
for j = 1, GetContainerNumSlots(i) do
|
|
local iid = GetContainerItemID(i, j)
|
|
if aura_env.herbIDs[iid] then
|
|
local texture = select(1, GetContainerItemInfo(i, j))
|
|
local amount = GetItemCount(iid, false)
|
|
local bank = GetItemCount(iid, true) - amount
|
|
allstates[iid] =
|
|
{
|
|
show = true,
|
|
changed = true,
|
|
amount = amount,
|
|
bank = bank,
|
|
index = amount,
|
|
icon = texture,
|
|
itemId = iid,
|
|
resort = true,
|
|
}
|
|
end
|
|
end
|
|
end
|
|
return true
|
|
end
|
|
end
|
|
|
|
--INIT
|
|
aura_env.herbIDs =
|
|
{
|
|
[168487] = "Zin'anthid",
|
|
[152511] = "Sea Stalk",
|
|
[152505] = "Riverbud",
|
|
[152506] = "Star Moss",
|
|
[152507] = "Akunda's Bite",
|
|
[152508] = "Winter's Kiss",
|
|
[152509] = "Siren's Pollen",
|
|
[152510] = "Anchor Weed",
|
|
}
|
|
WeakAuras.ScanEvents("UPDATE") |