mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
LibItemPrice
Needs some more work
This commit is contained in:
@@ -399,4 +399,25 @@ function GetItemInfoByName(itemName)
|
||||
if not itemInfoDB[itemName] then return end
|
||||
|
||||
return GetItemInfo(itemInfoDB[itemName])
|
||||
end
|
||||
|
||||
function GetItemCount(itemName)
|
||||
local count = 0
|
||||
for bag = 4, 0, -1 do
|
||||
for slot = 1, GetContainerNumSlots(bag) do
|
||||
local _, itemCount = GetContainerItemInfo(bag, slot);
|
||||
if itemCount then
|
||||
local itemLink = GetContainerItemLink(bag,slot)
|
||||
local _, _, itemParse = strfind(itemLink, "(%d+):")
|
||||
local queryName, _, _, _, _, _ = GetItemInfo(itemParse)
|
||||
if queryName and queryName ~= "" then
|
||||
if queryName == itemName then
|
||||
count = count + itemCount;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return count
|
||||
end
|
||||
Reference in New Issue
Block a user