Skip to content

Commit

Permalink
Add Warband Bank
Browse files Browse the repository at this point in the history
  • Loading branch information
b-morgan committed Aug 9, 2024
1 parent 27ce581 commit 4376b07
Show file tree
Hide file tree
Showing 25 changed files with 109 additions and 100 deletions.
16 changes: 8 additions & 8 deletions Inventory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ local PT = LibStub("LibPeriodicTable-3.1")
-- does consider queued recipes
--
function Skillet:InventoryReagentCraftability(reagentID)
--DA.DEBUG(1,"InventoryReagentCraftability("..tostring(reagentID)..") -- "..tostring((GetItemInfo(reagentID))))
--DA.DEBUG(1,"InventoryReagentCraftability("..tostring(reagentID)..") -- "..tostring((C_Item.GetItemInfo(reagentID))))
if not reagentID or type(reagentID) == "table" or reagentID == 0 then
return 0, 0
end
Expand All @@ -39,7 +39,7 @@ function Skillet:InventoryReagentCraftability(reagentID)
local skillIndexLookup = self.data.skillIndexLookup
local recipeSource = self.db.global.itemRecipeSource[reagentID]
if recipeSource then
--DA.DEBUG(2," ReagentCraftability: reagentID= "..tostring(reagentID).."("..tostring((GetItemInfo(reagentID))).."), recipeSource= "..DA.DUMP1(recipeSource))
--DA.DEBUG(2," ReagentCraftability: reagentID= "..tostring(reagentID).."("..tostring((C_Item.GetItemInfo(reagentID))).."), recipeSource= "..DA.DUMP1(recipeSource))
for childRecipeID in pairs(recipeSource) do
local childRecipe = self:GetRecipe(childRecipeID)
local childSkillIndex = skillIndexLookup[childRecipeID]
Expand All @@ -49,7 +49,7 @@ function Skillet:InventoryReagentCraftability(reagentID)
local numCraftableVendor = 100000
for i=1,#childRecipe.reagentData,1 do
local childReagent = childRecipe.reagentData[i]
local numReagentOnHand = GetItemCount(childReagent.reagentID,true,false,true)
local numReagentOnHand = C_Item.GetItemCount(childReagent.reagentID,true,false,true,true)
local numReagentCraftable, numReagentCraftableVendor = self:InventoryReagentCraftability(childReagent.reagentID)
numReagentCraftable = numReagentCraftable + numReagentOnHand
numReagentCraftableVendor = numReagentCraftableVendor + numReagentOnHand
Expand All @@ -65,7 +65,7 @@ function Skillet:InventoryReagentCraftability(reagentID)
end
end
else
--DA.DEBUG(2," ReagentCraftability: reagentID= "..tostring(reagentID).."("..tostring((GetItemInfo(reagentID))).."), recipeSource= nil")
--DA.DEBUG(2," ReagentCraftability: reagentID= "..tostring(reagentID).."("..tostring((C_Item.GetItemInfo(reagentID))).."), recipeSource= nil")
end
local queued = 0
if self.db.realm.reagentsInQueue[player] then
Expand Down Expand Up @@ -189,10 +189,10 @@ function Skillet:InventoryScan()
local numInBoth
if self.db.global.itemRecipeUsedIn then
for reagentID in pairs(self.db.global.itemRecipeUsedIn) do
--DA.DEBUG(2,"reagent "..tostring(GetItemInfo(reagentID)).." "..tostring(inventoryData[reagentID]))
--DA.DEBUG(2,"reagent "..tostring(C_Item.GetItemInfo(reagentID)).." "..tostring(inventoryData[reagentID]))
if reagentID and not inventoryData[reagentID] then -- have we calculated this one yet?
--DA.DEBUG(2,"Using API")
numInBoth = GetItemCount(reagentID,true,false,true) -- both bank and bags
numInBoth = C_Item.GetItemCount(reagentID,true,false,true,true) -- both bank and bags
inventoryData[reagentID] = tostring(numInBoth) -- only what we have for now (no craftability info)
--DA.DEBUG(2,"inventoryData["..reagentID.."]="..inventoryData[reagentID])
end
Expand Down Expand Up @@ -257,12 +257,12 @@ function Skillet:GetInventory(player, reagentID)
end
if player == self.currentPlayer then
if type(reagentID) ~= "table" then
have = GetItemCount(reagentID,true,false,true) or 0
have = C_Item.GetItemCount(reagentID,true,false,true,true) or 0
else
--DA.DEBUG(2,"GetInventory(C): #reagentID= "..tostring(#reagentID)..", reagentID= "..DA.DUMP1(reagentID))
for i = 1, #reagentID do
--DA.DEBUG(2,"GetInventory: itemID= "..tostring(reagentID[i].itemID))
have = have + (GetItemCount(reagentID[i].itemID,true,false,true) or 0)
have = have + (C_Item.GetItemCount(reagentID[i].itemID,true,false,true,true) or 0)
end
end
return have, 0, 0
Expand Down
34 changes: 17 additions & 17 deletions Plugins/Auctionator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ local function GetReagentData(reagent)
else
id = reagent.id
end
name = GetItemInfo(id) or id
name = C_Item.GetItemInfo(id) or id
if Atr_GetAuctionBuyout then
value = (Atr_GetAuctionBuyout(id) or 0)
elseif Auctionator and Auctionator.API.v1.GetAuctionPriceByItemID then
Expand Down Expand Up @@ -559,7 +559,7 @@ local function GetReagentData(reagent)
if Skillet.db.profile.plugins.ATR.buyablePrices then
if Skillet.db.profile.plugins.ATR.useVendorCalc then
local buyFactor = Skillet.db.profile.plugins.ATR.buyFactor or buyFactorDef
value = ( select(11,GetItemInfo(id)) or 0 ) * needed * buyFactor
value = ( select(11,C_Item.GetItemInfo(id)) or 0 ) * needed * buyFactor
end
else
value = 0
Expand All @@ -583,7 +583,7 @@ local function AddExtraText(value, needed, id, name, custom)
-- If this reagent is sold by a vendor, then use that (calculated) price instead
--
local buyFactor = Skillet.db.profile.plugins.ATR.buyFactor or buyFactorDef
value = ( select(11,GetItemInfo(id)) or 0 ) * needed * buyFactor
value = ( select(11,C_Item.GetItemInfo(id)) or 0 ) * needed * buyFactor
toConcatExtra[#toConcatExtra+1] = Skillet:FormatMoneyFull(value, true)
else
--
Expand Down Expand Up @@ -749,14 +749,14 @@ function plugin.SortMostSold(skill,a,b)
recipeB = Skillet:GetRecipe(b.recipeID)
--DA.DEBUG(0,"SortMostSold: recipeB= "..DA.DUMP1(recipeB))
if recipeA.scrollID then
itemNameA = GetItemInfo(recipeA.scrollID)
itemNameA = C_Item.GetItemInfo(recipeA.scrollID)
elseif recipeA.itemID then
itemNameA = GetItemInfo(recipeA.itemID)
itemNameA = C_Item.GetItemInfo(recipeA.itemID)
end
if recipeB.scrollID then
itemNameB = GetItemInfo(recipeB.scrollID)
itemNameB = C_Item.GetItemInfo(recipeB.scrollID)
elseif recipeB.itemID then
itemNameB = GetItemInfo(recipeB.itemID)
itemNameB = C_Item.GetItemInfo(recipeB.itemID)
end
--DA.DEBUG(0,"SortMostSold: itemNameA= "..tostring(itemNameA)..", itemNameB= "..tostring(itemNameB))
successCountA = 0
Expand Down Expand Up @@ -788,14 +788,14 @@ function plugin.SortSalesRate(skill,a,b)
recipeB = Skillet:GetRecipe(b.recipeID)
--DA.DEBUG(0,"SortSalesRate: recipeB= "..DA.DUMP1(recipeB))
if recipeA.scrollID then
itemNameA = GetItemInfo(recipeA.scrollID)
itemNameA = C_Item.GetItemInfo(recipeA.scrollID)
elseif recipeA.itemID then
itemNameA = GetItemInfo(recipeA.itemID)
itemNameA = C_Item.GetItemInfo(recipeA.itemID)
end
if recipeB.scrollID then
itemNameB = GetItemInfo(recipeB.scrollID)
itemNameB = C_Item.GetItemInfo(recipeB.scrollID)
elseif recipeB.itemID then
itemNameB = GetItemInfo(recipeB.itemID)
itemNameB = C_Item.GetItemInfo(recipeB.itemID)
end
--DA.DEBUG(0,"SortSalesRate: itemNameA= "..tostring(itemNameA)..", itemNameB= "..tostring(itemNameB))
salesRateA = 0
Expand Down Expand Up @@ -1001,7 +1001,7 @@ function plugin.GetExtraText(skill, recipe)
if addonName and Journalator and Skillet.db.profile.plugins.ATR.journalatorE then
label = label.."\n"
extra_text = extra_text.."\n"
local itemName = GetItemInfo(itemID)
local itemName = C_Item.GetItemInfo(itemID)
local salesRate, successCount, failedCount, lastSold, lastBought
if Journalator.API and itemName then
successCount = Journalator.API.v1.GetRealmSuccessCountByItemName(addonName, itemName)
Expand Down Expand Up @@ -1071,7 +1071,7 @@ function plugin.RecipeNameSuffix(skill, recipe)
--DA.DEBUG(0,"RecipeNameSuffix: Change to scrollID, itemID= "..tostring(itemID))
end
local itemName
if itemID then itemName = GetItemInfo(itemID) end
if itemID then itemName = C_Item.GetItemInfo(itemID) end
--DA.DEBUG(0,"RecipeNameSuffix: itemName= "..tostring(itemName)..", type= "..type(itemName))
if Skillet.db.profile.plugins.ATR.enabled and itemID then
buyout = GetBuyout(recipe)
Expand Down Expand Up @@ -1208,7 +1208,7 @@ function Skillet:AuctionatorSearch(whichOne)
end
for i=1,#list,1 do
local id = list[i].id
local name = GetItemInfo(id)
local name = C_Item.GetItemInfo(id)
if name and not Skillet:VendorSellsReagent(id) then
table.insert (items, name)
DA.DEBUG(1, "AuctionatorSearch: Item["..tostring(i).."] "..name.." ("..tostring(id)..") added")
Expand All @@ -1226,14 +1226,14 @@ function Skillet:AuctionatorSearch(whichOne)
itemID = Skillet.EnchantSpellToItem[itemID] or 0
end
if itemID ~= 0 then
shoppingListName = GetItemInfo(itemID)
shoppingListName = C_Item.GetItemInfo(itemID)
else
shoppingListName = recipe.name
end
if (shoppingListName) then
if recipe.tradeID == 7411 and not Skillet.isCraft then
if recipe.scrollID then
local scrollName = GetItemInfo(recipe.scrollID)
local scrollName = C_Item.GetItemInfo(recipe.scrollID)
table.insert(items, scrollName)
end
elseif not recipe.salvage then
Expand All @@ -1257,7 +1257,7 @@ function Skillet:AuctionatorSearch(whichOne)
id = reagent.id
end
if id then
local reagentName = GetItemInfo(id)
local reagentName = C_Item.GetItemInfo(id)
if (reagentName) then
if not Skillet:VendorSellsReagent(id) then
table.insert (items, reagentName)
Expand Down
2 changes: 1 addition & 1 deletion Plugins/BeanCounter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ function plugin.GetExtraText(skill, recipe)
local itemID = recipe.itemID
if BeanCounterDB and itemID and Skillet.db.profile.plugins.beancounter.enabled then
if BeanCounter and BeanCounterUiFrame and BeanCounterUiFrame:IsVisible() then
local name = GetItemInfo(itemID)
local name = C_Item.GetItemInfo(itemID)
if name then
BeanCounter.API.search(name)
end
Expand Down
2 changes: 1 addition & 1 deletion Plugins/CanIMogIt.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ end
function plugin.RecipeNamePrefix(skill, recipe)
if not skill or not recipe then return end
if CanIMogIt and CanIMogIt.GetIconText and Skillet.db.profile.plugins.CIMI.enabled then
local itemLink = select(2, GetItemInfo(recipe.itemID))
local itemLink = select(2, C_Item.GetItemInfo(recipe.itemID))
if itemLink then
local icon = CanIMogIt:GetIconText(itemLink)
if icon ~= "" then
Expand Down
4 changes: 2 additions & 2 deletions Plugins/DataStoreAuctions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function plugin.RecipeNamePrefix(skill, recipe)
if Skillet.db.profile.plugins.DSA.enabled and DataStore then
itemID = recipe.itemID
if itemID and itemID ~= 0 then
itemName = GetItemInfo(itemID)
itemName = C_Item.GetItemInfo(itemID)
end
--DA.DEBUG(0,"RecipeNamePrefix: itemID = "..tostring(itemID).." ("..tostring(itemName)..")")
--
Expand All @@ -86,7 +86,7 @@ function plugin.RecipeNamePrefix(skill, recipe)
if not Skillet.isCraft and recipe.tradeID == 7411 and itemID == 0 then
itemID = recipe.scrollID
if itemID and itemID ~= 0 then
itemName = GetItemInfo(itemID)
itemName = C_Item.GetItemInfo(itemID)
end
--DA.DEBUG(0,"RecipeNamePrefix: scrollID = "..tostring(itemID).." ("..tostring(itemName)..")")
end
Expand Down
2 changes: 1 addition & 1 deletion Plugins/OribosExchange.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
o={}
OEMarketInfo(item,o)
The item can be identified by anything GetItemInfo takes (itemid, itemstring, itemlink) or a battlepet itemstring/itemlink.
The item can be identified by anything C_Item.GetItemInfo takes (itemid, itemstring, itemlink) or a battlepet itemstring/itemlink.
Prices are returned in copper, but accurate to the last *silver* (with coppers always 0).
o['input'] -> the item/battlepet parameter you just passed in, verbatim
Expand Down
2 changes: 1 addition & 1 deletion Plugins/TheUndermineJournal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
o={}
TUJMarketInfo(item,o)
The item can be identified by anything GetItemInfo takes (itemid, itemstring, itemlink) or a battlepet itemstring/itemlink.
The item can be identified by anything C_Item.GetItemInfo takes (itemid, itemstring, itemlink) or a battlepet itemstring/itemlink.
Prices are returned in copper, but accurate to the last *silver* (with coppers always 0).
o['input'] -> the item/battlepet parameter you just passed in, verbatim
Expand Down
4 changes: 2 additions & 2 deletions Skillet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ end

function Skillet:ITEM_DATA_LOAD_RESULT(event, itemID, result)
if itemID then
local name = GetItemInfo(itemID)
local name = C_Item.GetItemInfo(itemID)
DA.TRACE2("ITEM_DATA_LOAD_RESULT("..tostring(itemID)..", "..tostring(result).."), "..tostring(name))
else
DA.TRACE2("ITEM_DATA_LOAD_RESULT")
Expand Down Expand Up @@ -1109,7 +1109,7 @@ end

function Skillet:GET_ITEM_INFO_RECEIVED(event, itemID, result)
if itemID then
local name = GetItemInfo(itemID)
local name = C_Item.GetItemInfo(itemID)
DA.TRACE2("GET_ITEM_INFO_RECEIVED("..tostring(itemID)..", "..tostring(result).."), "..tostring(name))
else
DA.TRACE2("GET_ITEM_INFO_RECEIVED")
Expand Down
12 changes: 6 additions & 6 deletions SkilletData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ function Skillet:GetAutoTargetItem(addSpellID)
--DA.DEBUG(0,"itemID= "..tostring(itemID))
if itemID then
local limit = Skillet.TradeSkillAutoTarget[addSpellID][itemID]
local count = GetItemCount(itemID)
local count = C_Item.GetItemCount(itemID)
if count >= limit then
return itemID
end
end
for itemID,limit in pairs(Skillet.TradeSkillAutoTarget[addSpellID]) do
local count = GetItemCount(itemID)
local count = C_Item.GetItemCount(itemID)
--DA.DEBUG(0,"itemID= "..tostring(itemID)..", limit= "..tostring(limit)..", count= "..tostring(count))
if count >= limit then
lastAutoTarget[addSpellID] = itemID
Expand All @@ -126,7 +126,7 @@ function Skillet:GetAutoTargetMacro(addSpellID, toy, pet, petGUID)
else
local itemID = Skillet:GetAutoTargetItem(addSpellID)
if itemID then
return "/cast "..(GetSpellInfo(addSpellID) or "").."\n/use "..(GetItemInfo(itemID) or "")
return "/cast "..(GetSpellInfo(addSpellID) or "").."\n/use "..(C_Item.GetItemInfo(itemID) or "")
else
return "/cast "..(GetSpellInfo(addSpellID) or "")
end
Expand Down Expand Up @@ -1310,8 +1310,8 @@ recipeSchematic= {
itemID = 0
end
recipe.itemID = itemID
recipe.itemType = select(2,GetItemInfoInstant(itemID))
recipe.classID = select(6,GetItemInfoInstant(itemID)) or 0
recipe.itemType = select(2,C_Item.GetItemInfoInstant(itemID))
recipe.classID = select(6,C_Item.GetItemInfoInstant(itemID)) or 0
recipeInfo.itemID = itemID -- save a copy for our records
if not recipeInfo.alternateVerb then
local minMade = recipeSchematic.quantityMin
Expand Down Expand Up @@ -1402,7 +1402,7 @@ recipeSchematic= {
basicData[numBasic] = {}
basicData[numBasic].reagentID = reagentID
basicData[numBasic].numNeeded = numNeeded
basicData[numBasic].name = GetItemInfo(reagentID)
basicData[numBasic].name = C_Item.GetItemInfo(reagentID)
basicData[numBasic].schematic = schematic
Skillet:ItemDataAddUsedInRecipe(reagentID, recipeID) -- add a cross reference for where a particular item is used
elseif schematic.dataSlotType == Enum.TradeskillSlotDataType.ModifiedReagent then -- 2
Expand Down
9 changes: 9 additions & 0 deletions SkilletNewsData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ local isCata = WOW_PROJECT_ID == WOW_PROJECT_CATACLYSM_CLASSIC

Skillet.NewsName = "Skillet News"
Skillet.NewsData = {
{ version = "5.31",
data = {
{ name = "Fixes",
data = {
{ header = "Inventory", body = "Add Warband Bank" },
},
},
},
},
{ version = "5.30",
data = {
{ name = "Changes",
Expand Down
2 changes: 1 addition & 1 deletion SkilletOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,7 @@ Skillet.options =
else
id = tonumber(item)
end
name, link = GetItemInfo(id)
name, link = C_Item.GetItemInfo(id)
price = tonumber(price)
DA.DEBUG(0,"id= "..tostring(id)..", name= "..tostring(name)..", price= "..tostring(price)..", link= "..tostring(link))
Skillet.db.global.customPrice[server][id] = { ["name"] = name, ["value"] = price }
Expand Down
Loading

0 comments on commit 4376b07

Please sign in to comment.