From 623fbfd634e28670b50a2ca44e64d7dd8193033f Mon Sep 17 00:00:00 2001 From: Brad Morgan Date: Mon, 25 Dec 2023 08:47:45 -0700 Subject: [PATCH] Add Ignore queued reagents option --- Skillet.lua | 3 +++ SkilletNewsData.lua | 10 ++++++++++ SkilletOptions.lua | 15 +++++++++++++-- SkilletQueue.lua | 15 +++++++++++---- 4 files changed, 37 insertions(+), 6 deletions(-) diff --git a/Skillet.lua b/Skillet.lua index 8812c9b..e607ea1 100644 --- a/Skillet.lua +++ b/Skillet.lua @@ -57,6 +57,8 @@ local defaults = { queue_craftable_reagents = true, queue_one_at_a_time = true, queue_to_front = false, + ignore_banked_reagents = false, + ignore_queued_reagents = false, queue_glyph_reagents = false, display_required_level = false, display_shopping_list_at_bank = true, @@ -95,6 +97,7 @@ local defaults = { tradeskill_options = {}, include_alts = true, -- Display alt's items in shopping list same_faction = true, -- Display same faction alt items only + ignore_on_hand = false, -- Ignore items in inventory item_order = false, -- Order shopping list by item merge_items = false, -- Merge same shopping list items together include_guild = false, -- Use the contents of the Guild Bank diff --git a/SkilletNewsData.lua b/SkilletNewsData.lua index 49961a3..a1e6d4b 100644 --- a/SkilletNewsData.lua +++ b/SkilletNewsData.lua @@ -25,6 +25,16 @@ local isWrath = WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC Skillet.NewsName = "Skillet News" Skillet.NewsData = { + { version = "5.24", + data = { + { name = "New Features", + data = { + { header = "Queuing", body = "Ignore queued reagents. Queuing recipes which share reagents will queue all of them" }, + { header = "Shopping", body = "Ignore items on hand. The shopping list will reflect everything needed to process the queue" }, + }, + }, + }, + }, { version = "5.23", data = { { name = "Changes", diff --git a/SkilletOptions.lua b/SkilletOptions.lua index bf28c96..fa1b7fa 100644 --- a/SkilletOptions.lua +++ b/SkilletOptions.lua @@ -159,7 +159,6 @@ Skillet.options = width = 1.5, order = 20 }, ---[[ ignore_banked_reagents = { type = "toggle", name = L["IGNOREBANKEDREAGENTSNAME"], @@ -173,7 +172,19 @@ Skillet.options = width = 1.5, order = 21 }, ---]] + ignore_queued_reagents = { + type = "toggle", + name = L["IGNOREQUEUEDREAGENTSNAME"], + desc = L["IGNOREQUEUEDREAGENTSDESC"], + get = function() + return Skillet.db.profile.ignore_queued_reagents + end, + set = function(self,value) + Skillet.db.profile.ignore_queued_reagents = value + end, + width = 1.5, + order = 21 + }, queue_craftable_reagents = { type = "toggle", name = L["QUEUECRAFTABLEREAGENTSNAME"], diff --git a/SkilletQueue.lua b/SkilletQueue.lua index 23de374..0464f65 100644 --- a/SkilletQueue.lua +++ b/SkilletQueue.lua @@ -87,20 +87,27 @@ local function queueAppendReagent(command, reagentID, need, queueCraftables, mre DA.DEBUG(0,"queueAppendReagent("..tostring(reagentID)..", "..tostring(need)..", "..tostring(queueCraftables).."), name= "..tostring(reagentName)) local reagentsInQueue = Skillet.db.realm.reagentsInQueue[Skillet.currentPlayer] local skillIndexLookup = Skillet.data.skillIndexLookup - local have = 0 + local have if not mreagent then local numInBoth = GetItemCount(reagentID,true,false,true) local numInBags = GetItemCount(reagentID) local numInBank = numInBoth - numInBags - --DA.DEBUG(1,"queueAppendReagent: numInBoth= "..tostring(numInBoth)..", numInBags="..tostring(numInBags)..", numInBank="..tostring(numInBank)) - have = numInBoth + (reagentsInQueue[reagentID] or 0) + local numInQueue = reagentsInQueue[reagentID] or 0 + --DA.DEBUG(1,"queueAppendReagent: numInBoth= "..tostring(numInBoth)..", numInBags="..tostring(numInBags)..", numInBank="..tostring(numInBank)..", numInQueue="..tostring(numInQueue)) + if Skillet.db.profile.ignore_queued_reagents then + numInQueue = 0 + end + if Skillet.db.profile.ignore_banked_reagents then + have = numInBags + numInQueue + else + have = numInBoth + numInQueue + end else --DA.DEBUG(2,"queueAppendReagent: mreagent= "..DA.DUMP(mreagent)) for k=1, #mreagent.schematic.reagents, 1 do mitem = mreagent.schematic.reagents[k].itemID have = have + GetItemCount(mitem,true,false,true) end --- have = have + (reagentsInQueue[reagentID] or 0) end reagentsInQueue[reagentID] = (reagentsInQueue[reagentID] or 0) - need DA.DEBUG(1,"queueAppendReagent: queueCraftables= "..tostring(queueCraftables)..", need= "..tostring(need)..", have= "..tostring(have))