Skip to content

Commit

Permalink
Add a message when required reagent(s) are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
b-morgan committed Sep 12, 2024
1 parent 0ea1caa commit 1dd8171
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions SkilletQueue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -651,10 +651,15 @@ function Skillet:ProcessQueue(altMode)
end -- for
end
if command.requiredReagents then
local required = 0
for i,reagent in pairs(command.requiredReagents) do
DA.DEBUG(2,"Required: i= "..tostring(i)..", reagent= "..DA.DUMP1(reagent))
table.insert(self.optionalReagentsArray, reagent)
required = required + 1
end -- for
if required == 0 then
DA.MARK3("Required reagent(s) missing")
end
end
if command.optionalReagents then
for i,reagent in pairs(command.optionalReagents) do
Expand Down Expand Up @@ -689,20 +694,28 @@ function Skillet:ProcessQueue(altMode)
DA.DEBUG(1,"ProcessQueue: recipeLevel= "..tostring(recipeLevel)..", recipeTransaction= "..DA.DUMP(self.recipeTransaction))
local reagentInfoTbl = self.recipeTransaction:CreateCraftingReagentInfoTbl()
DA.DEBUG(1,"ProcessQueue: reagentInfoTbl= "..DA.DUMP(reagentInfoTbl))
if not self.recipeTransaction:HasAllAllocations(command.count) then
DA.MARK3("Insufficient Materials available")
end
end
else
if self.db.profile.queue_one_at_a_time then
C_TradeSkillUI.CraftRecipe(command.recipeID, command.count, command.optionalReagentsArray, recipeLevel)
else
local reagentInfoTbl = self.recipeTransaction:CreateCraftingReagentInfoTbl()
C_TradeSkillUI.CraftRecipe(command.recipeID, command.count, reagentInfoTbl, recipeLevel)
if self.recipeTransaction:HasAllAllocations(command.count) then
DA.DEBUG(1,"ProcessQueue: reagentInfoTbl= "..DA.DUMP(reagentInfoTbl))
C_TradeSkillUI.CraftRecipe(command.recipeID, command.count, reagentInfoTbl, recipeLevel)
else
DA.MARK3("Insufficient (Required) Materials available")
end
end
end
else
--
-- C_TradeSkillUI.GetCraftableCount failed
--
DA.MARK3("Insufficent Materials available, count= "..tostring(command.count)..", numAvailable= "..tostring(numAvailable))
DA.MARK3("Insufficient Materials available, count= "..tostring(command.count)..", numAvailable= "..tostring(numAvailable))
self.queuecasting = false
end
elseif command.recipeType == Enum.TradeskillRecipeType.Enchant then
Expand Down

0 comments on commit 1dd8171

Please sign in to comment.