Skip to content

Commit

Permalink
Add Ignore queued reagents option
Browse files Browse the repository at this point in the history
  • Loading branch information
b-morgan committed Dec 25, 2023
1 parent f1d1649 commit 623fbfd
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 6 deletions.
3 changes: 3 additions & 0 deletions Skillet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions SkilletNewsData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 13 additions & 2 deletions SkilletOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ Skillet.options =
width = 1.5,
order = 20
},
--[[
ignore_banked_reagents = {
type = "toggle",
name = L["IGNOREBANKEDREAGENTSNAME"],
Expand All @@ -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"],
Expand Down
15 changes: 11 additions & 4 deletions SkilletQueue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 623fbfd

Please sign in to comment.