diff --git a/Classes/OptionalReagentSlot.lua b/Classes/OptionalReagentSlot.lua index 787a6b72..135a438b 100644 --- a/Classes/OptionalReagentSlot.lua +++ b/Classes/OptionalReagentSlot.lua @@ -57,24 +57,27 @@ end --- returns wether the player has enough the selected optional reagent ---@param multiplier number? default: 1 ---@param crafterUID string -function CraftSim.OptionalReagentSlot:HasItem(multiplier, crafterUID) +---@param excludeWarbankTemp? boolean +function CraftSim.OptionalReagentSlot:HasItem(multiplier, crafterUID, excludeWarbankTemp) multiplier = multiplier or 1 if not self.activeReagent then return true end - local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, self.activeReagent.item:GetItemID()) + local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, self.activeReagent.item:GetItemID(), + excludeWarbankTemp) return itemCount >= (multiplier * self.maxQuantity) end --- check how many times the player can fulfill the allocated item quantity ---@param crafterUID string -function CraftSim.OptionalReagentSlot:HasQuantityXTimes(crafterUID) +function CraftSim.OptionalReagentSlot:HasQuantityXTimes(crafterUID, excludeWarbankTemp) if not self.activeReagent then return math.huge -- yes I have infinite a number of times yes end - local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, self.activeReagent.item:GetItemID()) + local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, self.activeReagent.item:GetItemID(), + excludeWarbankTemp) return itemCount * self.maxQuantity end diff --git a/Classes/Reagent.lua b/Classes/Reagent.lua index 4b7c7eb6..aee3961e 100644 --- a/Classes/Reagent.lua +++ b/Classes/Reagent.lua @@ -136,13 +136,15 @@ end --- returns wether the player has enough of the given required item's allocations (times the multiplier) ---@param multiplier number? default: 1 -function CraftSim.Reagent:HasItems(multiplier, crafterUID) +---@param crafterUID CrafterUID? +---@param excludeWarbankTemp? boolean +function CraftSim.Reagent:HasItems(multiplier, crafterUID, excludeWarbankTemp) multiplier = multiplier or 1 -- check if the player owns enough of each allocated items's quantity and sum up the allocated quantities local totalQuantity = 0 for _, reagentItem in pairs(self.items) do - local hasItems = reagentItem:HasItem(multiplier, crafterUID) + local hasItems = reagentItem:HasItem(multiplier, crafterUID, excludeWarbankTemp) totalQuantity = totalQuantity + reagentItem.quantity if not hasItems then return false @@ -158,7 +160,7 @@ function CraftSim.Reagent:HasItems(multiplier, crafterUID) end --- check how many times the player can fulfill the allocated item quantity -function CraftSim.Reagent:HasQuantityXTimes(crafterUID) +function CraftSim.Reagent:HasQuantityXTimes(crafterUID, excludeWarbankTemp) local currentMinTimes = math.huge local print = CraftSim.DEBUG:SetDebugPrint(CraftSim.CONST.DEBUG_IDS.CRAFTQ) @@ -169,7 +171,7 @@ function CraftSim.Reagent:HasQuantityXTimes(crafterUID) -- use original item if available local itemID = (reagentItem.originalItem and reagentItem.originalItem:GetItemID()) or reagentItem.item:GetItemID() - local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, itemID) + local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, itemID, excludeWarbankTemp) --print("--player item count: " .. tostring(itemCount)) --print("--reagentItem.quantity: " .. tostring(reagentItem.quantity)) local itemFitCount = math.floor(itemCount / reagentItem.quantity) diff --git a/Classes/ReagentData.lua b/Classes/ReagentData.lua index 4cbe4d53..90e29efd 100644 --- a/Classes/ReagentData.lua +++ b/Classes/ReagentData.lua @@ -358,25 +358,26 @@ end ---comment ---@param multiplier number? ---@param crafterUID string +---@param excludeWarbankTemp? boolean ---@return boolean -function CraftSim.ReagentData:HasEnough(multiplier, crafterUID) +function CraftSim.ReagentData:HasEnough(multiplier, crafterUID, excludeWarbankTemp) multiplier = multiplier or 1 -- check required, optional and finished reagents if the player has enough times multiplier in his inventory and bank local hasRequiredReagents = GUTIL:Every(self.requiredReagents, ---@param requiredReagent CraftSim.Reagent function(requiredReagent) - return requiredReagent:HasItems(multiplier, crafterUID) + return requiredReagent:HasItems(multiplier, crafterUID, excludeWarbankTemp) end) local hasOptionalReagents = GUTIL:Every(GUTIL:Concat({ self.optionalReagentSlots, self.finishingReagentSlots }), ---@param optionalReagentSlot CraftSim.OptionalReagentSlot function(optionalReagentSlot) - return optionalReagentSlot:HasItem(multiplier, crafterUID) + return optionalReagentSlot:HasItem(multiplier, crafterUID, excludeWarbankTemp) end) local hasSparkReagent = true if self:HasSparkSlot() then - hasSparkReagent = self.sparkReagentSlot:HasItem(multiplier, crafterUID) + hasSparkReagent = self.sparkReagentSlot:HasItem(multiplier, crafterUID, excludeWarbankTemp) end -- update item cache for all possible optional reagents if I am the crafter if crafterUID == CraftSim.UTIL:GetPlayerCrafterUID() then @@ -402,7 +403,7 @@ function CraftSim.ReagentData:HasEnough(multiplier, crafterUID) if self.recipeData.isEnchantingRecipe then local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, CraftSim.CONST - .ENCHANTING_VELLUM_ID) + .ENCHANTING_VELLUM_ID, true) hasVellumIfneeded = itemCount >= multiplier end @@ -410,7 +411,9 @@ function CraftSim.ReagentData:HasEnough(multiplier, crafterUID) return hasRequiredReagents and hasOptionalReagents and hasSparkReagent and hasVellumIfneeded end -function CraftSim.ReagentData:GetCraftableAmount(crafterUID) +---@param crafterUID CrafterUID +---@param excludeWarbankTemp? boolean +function CraftSim.ReagentData:GetCraftableAmount(crafterUID, excludeWarbankTemp) local print = CraftSim.DEBUG:SetDebugPrint(CraftSim.CONST.DEBUG_IDS.CRAFTQ) print("getCraftable amount", false, true) @@ -418,17 +421,19 @@ function CraftSim.ReagentData:GetCraftableAmount(crafterUID) local currentMinimumReagentFit = math.huge for _, requiredReagent in pairs(self.requiredReagents) do if not requiredReagent:IsOrderReagentIn(self.recipeData) then - if not requiredReagent:HasItems(1, crafterUID) then + if not requiredReagent:HasItems(1, crafterUID, excludeWarbankTemp) then return 0 end - currentMinimumReagentFit = math.min(requiredReagent:HasQuantityXTimes(crafterUID), currentMinimumReagentFit) + currentMinimumReagentFit = math.min(requiredReagent:HasQuantityXTimes(crafterUID, excludeWarbankTemp), + currentMinimumReagentFit) end end if self:HasSparkSlot() then if self.sparkReagentSlot.activeReagent then if not self.sparkReagentSlot.activeReagent:IsOrderReagentIn(self.recipeData) then - currentMinimumReagentFit = math.min(self.sparkReagentSlot:HasQuantityXTimes(crafterUID), + currentMinimumReagentFit = math.min( + self.sparkReagentSlot:HasQuantityXTimes(crafterUID, excludeWarbankTemp), currentMinimumReagentFit) end else @@ -443,10 +448,11 @@ function CraftSim.ReagentData:GetCraftableAmount(crafterUID) local optionalReagentSlots = GUTIL:Concat({ self.optionalReagentSlots, self.finishingReagentSlots }) for _, optionalReagentSlot in pairs(optionalReagentSlots) do if optionalReagentSlot.activeReagent and not optionalReagentSlot.activeReagent:IsOrderReagentIn(self.recipeData) then - if not optionalReagentSlot:HasItem(1, crafterUID) then + if not optionalReagentSlot:HasItem(1, crafterUID, excludeWarbankTemp) then return 0 end - currentMinimumReagentFitOptional = math.min(optionalReagentSlot:HasQuantityXTimes(crafterUID), + currentMinimumReagentFitOptional = math.min( + optionalReagentSlot:HasQuantityXTimes(crafterUID, excludeWarbankTemp), currentMinimumReagentFitOptional) end end @@ -455,7 +461,7 @@ function CraftSim.ReagentData:GetCraftableAmount(crafterUID) local vellumMinimumFit = math.huge if self.recipeData.isEnchantingRecipe then local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, CraftSim.CONST - .ENCHANTING_VELLUM_ID) + .ENCHANTING_VELLUM_ID, true) vellumMinimumFit = itemCount print("minimum vellum fit: " .. tostring(vellumMinimumFit)) end @@ -484,6 +490,10 @@ function CraftSim.ReagentData:GetTooltipText(multiplier, crafterUID) local iconSize = 25 local text = "" + -- TODO: Remove after 11.0.5 + local excludeWarbankTemp = self.recipeData.orderData and + CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_EXCLUDE_WARBANK") + for _, requiredReagent in pairs(self.requiredReagents) do local reagentIcon = requiredReagent.items[1].item:GetItemIcon() local inlineIcon = GUTIL:IconToText(reagentIcon, iconSize, iconSize) @@ -496,7 +506,7 @@ function CraftSim.ReagentData:GetTooltipText(multiplier, crafterUID) if reagentItem.originalItem then itemID = reagentItem.originalItem:GetItemID() end - local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, itemID) + local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, itemID, excludeWarbankTemp) local quantityText = f.r(tostring(requiredReagent.requiredQuantity * multiplier) .. "(" .. tostring(itemCount) .. ")") @@ -530,7 +540,7 @@ function CraftSim.ReagentData:GetTooltipText(multiplier, crafterUID) if reagentItem.originalItem then itemID = reagentItem.originalItem:GetItemID() end - local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, itemID) + local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, itemID, excludeWarbankTemp) local quantityText = f.r( tostring(reagentItem.quantity * multiplier) .. "(" .. tostring(itemCount) .. ")") @@ -566,7 +576,7 @@ function CraftSim.ReagentData:GetTooltipText(multiplier, crafterUID) local inlineIcon = GUTIL:IconToText(reagentIcon, iconSize, iconSize) text = text .. inlineIcon local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, - itemID) + itemID, excludeWarbankTemp) local requiredQuantity = self.sparkReagentSlot.maxQuantity * multiplier local quantityText = f.r(tostring(requiredQuantity) .. "(" .. tostring(itemCount) .. ")") if itemCount >= requiredQuantity or isOrderReagent then @@ -597,7 +607,7 @@ function CraftSim.ReagentData:GetTooltipText(multiplier, crafterUID) local inlineIcon = GUTIL:IconToText(reagentIcon, iconSize, iconSize) text = text .. inlineIcon local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, - optionalReagentSlot.activeReagent.item:GetItemID()) + optionalReagentSlot.activeReagent.item:GetItemID(), excludeWarbankTemp) local quantityText = f.r(tostring(multiplier) .. "(" .. tostring(itemCount) .. ")") if itemCount >= multiplier then quantityText = f.g(tostring(multiplier)) diff --git a/Classes/ReagentItem.lua b/Classes/ReagentItem.lua index e2516480..bbde2921 100644 --- a/Classes/ReagentItem.lua +++ b/Classes/ReagentItem.lua @@ -58,7 +58,8 @@ end --- returns wether the player has enough of the given required item's allocations (times the multiplier) for crafting ---@param multiplier number? default: 1 ---@param crafterUID string -function CraftSim.ReagentItem:HasItem(multiplier, crafterUID) +---@param excludeWarbankTemp? boolean +function CraftSim.ReagentItem:HasItem(multiplier, crafterUID, excludeWarbankTemp) multiplier = multiplier or 1 if not self.item then return false @@ -66,7 +67,7 @@ function CraftSim.ReagentItem:HasItem(multiplier, crafterUID) -- only count the item actually used in the recipe (originalItem if we have one) -- in the case of e.g. rimefin tuna we want to count the non frosted one only (will be the original) local itemID = (self.originalItem and self.originalItem:GetItemID()) or self.item:GetItemID() - local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, itemID) + local itemCount = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, itemID, excludeWarbankTemp) return itemCount >= (self.quantity * multiplier) end diff --git a/Classes/RecipeData.lua b/Classes/RecipeData.lua index fdc4b0e0..05d67c39 100644 --- a/Classes/RecipeData.lua +++ b/Classes/RecipeData.lua @@ -1253,10 +1253,13 @@ function CraftSim.RecipeData:CanCraft(amount) return false, 0 end + -- TODO: Remove after 11.0.5 + local excludeWarbankTemp = self.orderData and CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_EXCLUDE_WARBANK") + -- check amount of reagents in players inventory + bank - local hasEnoughReagents = self.reagentData:HasEnough(amount, self:GetCrafterUID()) + local hasEnoughReagents = self.reagentData:HasEnough(amount, self:GetCrafterUID(), excludeWarbankTemp) - local craftAbleAmount = self.reagentData:GetCraftableAmount(self:GetCrafterUID()) + local craftAbleAmount = self.reagentData:GetCraftableAmount(self:GetCrafterUID(), excludeWarbankTemp) local isChargeRecipe = self.cooldownData.maxCharges > 0 diff --git a/CraftSim.toc b/CraftSim.toc index 8de5b1cf..cc27f0ad 100644 --- a/CraftSim.toc +++ b/CraftSim.toc @@ -4,7 +4,7 @@ ## Title: CraftSim ## Notes: Calculates the average profit based on your profession stats and other tools for the war within gold making ## Author: genju -## Version: 18.2.9.2 +## Version: 18.3.0 ## X-Curse-Project-ID: 705015 ## X-Wago-ID: 0mNwaPKo ## X-WoWI-ID: 26519 diff --git a/Data/News.lua b/Data/News.lua index f217d547..dd38b6c9 100644 --- a/Data/News.lua +++ b/Data/News.lua @@ -17,6 +17,12 @@ function CraftSim.NEWS:GET_NEWS(itemMap) local news = { f.bb(" Hello and thank you for using CraftSim!\n"), f.bb(" ( You are awesome! )"), + newP("18.3.0"), + f.s .. f.bb("CraftQueue Patron Orders"), + f.a .. "- Added a temporary option to ignore warbank reagents", + f.a .. " as a workaround to the warbank issue until 11.0.5", + f.a .. "- Changed 'Ignore' Options to 'Include' options", + f.a .. " and added augment rune and acuity", newP("18.2.9"), f.P .. f.bb("Recipe Scan"), f.a .. "- Concentration Optimization now frame distributed", diff --git a/Modules/CraftQueue/CraftQueue.lua b/Modules/CraftQueue/CraftQueue.lua index 571798d9..bc5fbf2b 100644 --- a/Modules/CraftQueue/CraftQueue.lua +++ b/Modules/CraftQueue/CraftQueue.lua @@ -174,7 +174,7 @@ function CraftSim.CRAFTQ:QueuePatronOrders() if recipeInfo and recipeInfo.learned then local recipeData = CraftSim.RecipeData({ recipeID = order.spellID }) - if CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_IGNORE_SPARK_RECIPES") then + if not CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_SPARK_RECIPES") then if recipeData.reagentData:HasSparkSlot() then if recipeData.reagentData.sparkReagentSlot.activeReagent then if not recipeData.reagentData.sparkReagentSlot.activeReagent:IsOrderReagentIn(recipeData) then @@ -187,18 +187,35 @@ function CraftSim.CRAFTQ:QueuePatronOrders() recipeData:SetOrder(order) - if CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_KNOWLEDGE_POINTS_ONLY") then - if recipeData.orderData and recipeData.orderData.npcOrderRewards then - local hasKnowledgeReward = GUTIL:Some(recipeData.orderData.npcOrderRewards, - function(reward) - local itemID = GUTIL:GetItemIDByLink(reward.itemLink) - return tContains(CraftSim.CONST.PATRON_ORDERS_KNOWLEDGE_REWARD_ITEMS, - itemID) - end) - if not hasKnowledgeReward then - distributor:Continue() - return - end + if recipeData.orderData and recipeData.orderData.npcOrderRewards then + local rewardAllowed = GUTIL:Every(recipeData.orderData.npcOrderRewards, + function(reward) + local itemID = GUTIL:GetItemIDByLink(reward.itemLink) + local knowledgeAllowed = CraftSim.DB.OPTIONS:Get( + "CRAFTQUEUE_PATRON_ORDERS_KNOWLEDGE_POINTS") + local acuityAllowed = CraftSim.DB.OPTIONS:Get( + "CRAFTQUEUE_PATRON_ORDERS_ACUITY") + local runeAllowed = CraftSim.DB.OPTIONS:Get( + "CRAFTQUEUE_PATRON_ORDERS_POWER_RUNE") + local knowledgeContained = tContains( + CraftSim.CONST.PATRON_ORDERS_KNOWLEDGE_REWARD_ITEMS, + itemID) + local acuityContained = itemID == 210814 + local runeContained = itemID == 224672 + if not acuityAllowed and acuityContained then + return false + end + if not runeAllowed and runeContained then + return false + end + if not knowledgeAllowed and knowledgeContained then + return false + end + return true + end) + if not rewardAllowed then + distributor:Continue() + return end end @@ -558,7 +575,7 @@ function CraftSim.CRAFTQ.CreateAuctionatorShoppingList() end end local activeReagents = craftQueueItem.recipeData.reagentData:GetActiveOptionalReagents() - local quantityMap = {} -- ugly hack.. TODO refactor + local quantityMap = {} if craftQueueItem.recipeData.reagentData:HasSparkSlot() then if craftQueueItem.recipeData.reagentData.sparkReagentSlot.activeReagent then tinsert(activeReagents, craftQueueItem.recipeData.reagentData.sparkReagentSlot.activeReagent) @@ -589,6 +606,9 @@ function CraftSim.CRAFTQ.CreateAuctionatorShoppingList() local crafterUIDs = GUTIL:ToSet(crafterUIDs) + -- TODO: Remove after 11.0.5 + local excludeWarbankTemp = CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_EXCLUDE_WARBANK") + --- convert to Auctionator Search Strings and deduct item count (of all crafters total) local searchStrings = GUTIL:Map(reagentMap, function(info, itemID) itemID = CraftSim.CRAFTQ:GetNonSoulboundAlternativeItemID(itemID) @@ -597,7 +617,8 @@ function CraftSim.CRAFTQ.CreateAuctionatorShoppingList() end -- subtract the total item count of all crafter's cached inventory local totalItemCount = GUTIL:Fold(crafterUIDs, 0, function(itemCount, crafterUID) - local itemCountForCrafter = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, itemID) + local itemCountForCrafter = CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, itemID, + excludeWarbankTemp) return itemCount + itemCountForCrafter end) @@ -631,10 +652,11 @@ end --- only for craft queue display update's flash cache ---@param crafterUID CrafterUID ---@param itemID number -function CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, itemID) +---@param excludeWarbank? boolean +function CraftSim.CRAFTQ:GetItemCountFromCraftQueueCache(crafterUID, itemID, excludeWarbank) local itemCount = (CraftSim.CRAFTQ.itemCountCache and CraftSim.CRAFTQ.itemCountCache[itemID]) or nil if not itemCount then - itemCount = CraftSim.ITEM_COUNT:Get(crafterUID, itemID) + itemCount = CraftSim.ITEM_COUNT:Get(crafterUID, itemID, excludeWarbank) end return itemCount end diff --git a/Modules/CraftQueue/UI.lua b/Modules/CraftQueue/UI.lua index 47369c14..75d050c6 100644 --- a/Modules/CraftQueue/UI.lua +++ b/Modules/CraftQueue/UI.lua @@ -616,30 +616,73 @@ function CraftSim.CRAFTQ.UI:Init() "Force the use of concentration for all patron orders if possible"); end); - local sparkCB = rootDescription:CreateCheckbox("Ignore " .. f.e("Spark") .. " Recipes", + local sparkCB = rootDescription:CreateCheckbox("Include " .. f.e("Spark") .. " Recipes", function() - return CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_IGNORE_SPARK_RECIPES") + return CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_SPARK_RECIPES") end, function() - local value = CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_IGNORE_SPARK_RECIPES") - CraftSim.DB.OPTIONS:Save("CRAFTQUEUE_PATRON_ORDERS_IGNORE_SPARK_RECIPES", not value) + local value = CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_SPARK_RECIPES") + CraftSim.DB.OPTIONS:Save("CRAFTQUEUE_PATRON_ORDERS_SPARK_RECIPES", not value) end) sparkCB:SetTooltip(function(tooltip, elementDescription) GameTooltip_AddInstructionLine(tooltip, - "Ignore recipes that require a spark reagent"); + "Include Orders that use a Spark as Reagent"); end); - local knowledgeCB = rootDescription:CreateCheckbox(f.bb("Knowledge Points") .. " only", + local knowledgeCB = rootDescription:CreateCheckbox( + "Include " .. f.bb("Knowledge Point") .. " Rewards", function() - return CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_KNOWLEDGE_POINTS_ONLY") + return CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_KNOWLEDGE_POINTS") end, function() - local value = CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_KNOWLEDGE_POINTS_ONLY") - CraftSim.DB.OPTIONS:Save("CRAFTQUEUE_PATRON_ORDERS_KNOWLEDGE_POINTS_ONLY", not value) + local value = CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_KNOWLEDGE_POINTS") + CraftSim.DB.OPTIONS:Save("CRAFTQUEUE_PATRON_ORDERS_KNOWLEDGE_POINTS", not value) end) knowledgeCB:SetTooltip(function(tooltip, elementDescription) GameTooltip_AddInstructionLine(tooltip, - "Only try to queue patron orders rewarding knowledge points"); + "Include Orders with Knowledge Point Rewards"); + end); + + local acuityCB = rootDescription:CreateCheckbox( + "Include " .. f.bb("Acuity") .. " Rewards", + function() + return CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_ACUITY") + end, function() + local value = CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_ACUITY") + CraftSim.DB.OPTIONS:Save("CRAFTQUEUE_PATRON_ORDERS_ACUITY", not value) + end) + + acuityCB:SetTooltip(function(tooltip, elementDescription) + GameTooltip_AddInstructionLine(tooltip, + "Include Orders with Acuity Rewards"); + end); + + local powerRuneCB = rootDescription:CreateCheckbox( + "Include " .. f.bb("Augment Rune") .. " Rewards", + function() + return CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_POWER_RUNE") + end, function() + local value = CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_POWER_RUNE") + CraftSim.DB.OPTIONS:Save("CRAFTQUEUE_PATRON_ORDERS_POWER_RUNE", not value) + end) + + powerRuneCB:SetTooltip(function(tooltip, elementDescription) + GameTooltip_AddInstructionLine(tooltip, + "Include Orders with Augment Rune Rewards"); + end); + + local warbankCB = rootDescription:CreateCheckbox( + "Exclude " .. f.bb("Warbank") .. " Reagents from Shopping List (Temp)", + function() + return CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_EXCLUDE_WARBANK") + end, function() + local value = CraftSim.DB.OPTIONS:Get("CRAFTQUEUE_PATRON_ORDERS_EXCLUDE_WARBANK") + CraftSim.DB.OPTIONS:Save("CRAFTQUEUE_PATRON_ORDERS_EXCLUDE_WARBANK", not value) + end) + + warbankCB:SetTooltip(function(tooltip, elementDescription) + GameTooltip_AddInstructionLine(tooltip, + "Ignore Warbank Reagents when creating Shopping List (Temporary Workaround until 11.0.5)"); end); end) end @@ -1561,7 +1604,7 @@ function CraftSim.CRAFTQ.UI:UpdateAddOpenRecipeButton(recipeData) .NON_WORK_ORDER) buttonWO:SetVisible(isTradeSkillAllowed and isRecipeAllowed and exportMode == CraftSim.CONST.EXPORT_MODE.WORK_ORDER) buttonOptionsWO:SetVisible(isTradeSkillAllowed and isRecipeAllowed and - exportMode == CraftSim.CONST.EXPORT_MODE.WORK_ORDER) + exportMode == CraftSim.CONST.EXPORT_MODE.WORK_ORDER) end function CraftSim.CRAFTQ.UI:UpdateQueueDisplay() diff --git a/Modules/ItemCount/ItemCount.lua b/Modules/ItemCount/ItemCount.lua index 784867c1..aa2471a9 100644 --- a/Modules/ItemCount/ItemCount.lua +++ b/Modules/ItemCount/ItemCount.lua @@ -10,10 +10,11 @@ CraftSim.ITEM_COUNT = GUTIL:CreateRegistreeForEvents({ "BAG_UPDATE_DELAYED", "BA ---@param crafterUID string ---@param itemID ItemInfo +---@param excludeWarbank? boolean ---@return number count ---@return ItemID? alternativeItemID ---@return number? alternativeCount -function CraftSim.ITEM_COUNT:Get(crafterUID, itemID) +function CraftSim.ITEM_COUNT:Get(crafterUID, itemID, excludeWarbank) local playerCrafterUID = CraftSim.UTIL:GetPlayerCrafterUID() crafterUID = crafterUID or playerCrafterUID local isPlayer = crafterUID == playerCrafterUID @@ -26,10 +27,10 @@ function CraftSim.ITEM_COUNT:Get(crafterUID, itemID) local altCount = nil -- if player then return inclusive accountBankCount - local itemCount = CraftSim.DB.ITEM_COUNT:Get(crafterUID, itemID, true, true) + local itemCount = CraftSim.DB.ITEM_COUNT:Get(crafterUID, itemID, true, not excludeWarbank) if alternativeItemID then self:UpdateAllCountsForItemID(alternativeItemID) - altCount = CraftSim.DB.ITEM_COUNT:Get(crafterUID, alternativeItemID, true, true) + altCount = CraftSim.DB.ITEM_COUNT:Get(crafterUID, alternativeItemID, true, not excludeWarbank) end return itemCount, alternativeItemID, altCount end diff --git a/Util/Const.lua b/Util/Const.lua index 0f2197d7..ae312239 100644 --- a/Util/Const.lua +++ b/Util/Const.lua @@ -383,8 +383,11 @@ CraftSim.CONST.GENERAL_OPTIONS = { CRAFTQUEUE_FLASH_TASKBAR_ON_CRAFT_FINISHED = "CRAFTQUEUE_FLASH_TASKBAR_ON_CRAFT_FINISHED", CRAFTQUEUE_FIRST_CRAFTS_IGNORE_ACUITY_RECIPES = "CRAFTQUEUE_FIRST_CRAFTS_IGNORE_ACUITY_RECIPES", CRAFTQUEUE_FIRST_CRAFTS_IGNORE_SPARK_RECIPES = "CRAFTQUEUE_FIRST_CRAFTS_IGNORE_SPARK_RECIPES", - CRAFTQUEUE_PATRON_ORDERS_IGNORE_SPARK_RECIPES = "CRAFTQUEUE_PATRON_ORDERS_IGNORE_SPARK_RECIPES", - CRAFTQUEUE_PATRON_ORDERS_KNOWLEDGE_POINTS_ONLY = "CRAFTQUEUE_PATRON_ORDERS_KNOWLEDGE_POINTS_ONLY", + CRAFTQUEUE_PATRON_ORDERS_SPARK_RECIPES = "CRAFTQUEUE_PATRON_ORDERS_SPARK_RECIPES", + CRAFTQUEUE_PATRON_ORDERS_KNOWLEDGE_POINTS = "CRAFTQUEUE_PATRON_ORDERS_KNOWLEDGE_POINTS", + CRAFTQUEUE_PATRON_ORDERS_ACUITY = "CRAFTQUEUE_PATRON_ORDERS_ACUITY", + CRAFTQUEUE_PATRON_ORDERS_POWER_RUNE = "CRAFTQUEUE_PATRON_ORDERS_POWER_RUNE", + CRAFTQUEUE_PATRON_ORDERS_EXCLUDE_WARBANK = "CRAFTQUEUE_PATRON_ORDERS_EXCLUDE_WARBANK", CRAFTQUEUE_PATRON_ORDERS_ALLOW_CONCENTRATION = "CRAFTQUEUE_PATRON_ORDERS_ALLOW_CONCENTRATION", CRAFTQUEUE_PATRON_ORDERS_FORCE_CONCENTRATION = "CRAFTQUEUE_PATRON_ORDERS_FORCE_CONCENTRATION", CRAFTQUEUE_EDIT_RECIPE_OPTIMIZE_PROFESSION_GEAR = "CRAFTQUEUE_EDIT_RECIPE_OPTIMIZE_PROFESSION_GEAR", @@ -506,8 +509,11 @@ CraftSim.CONST.GENERAL_OPTIONS_DEFAULTS = { [CraftSim.CONST.GENERAL_OPTIONS.CRAFTQUEUE_FLASH_TASKBAR_ON_CRAFT_FINISHED] = true, [CraftSim.CONST.GENERAL_OPTIONS.CRAFTQUEUE_FIRST_CRAFTS_IGNORE_ACUITY_RECIPES] = true, [CraftSim.CONST.GENERAL_OPTIONS.CRAFTQUEUE_FIRST_CRAFTS_IGNORE_SPARK_RECIPES] = true, - [CraftSim.CONST.GENERAL_OPTIONS.CRAFTQUEUE_PATRON_ORDERS_IGNORE_SPARK_RECIPES] = true, - [CraftSim.CONST.GENERAL_OPTIONS.CRAFTQUEUE_PATRON_ORDERS_KNOWLEDGE_POINTS_ONLY] = false, + [CraftSim.CONST.GENERAL_OPTIONS.CRAFTQUEUE_PATRON_ORDERS_SPARK_RECIPES] = true, + [CraftSim.CONST.GENERAL_OPTIONS.CRAFTQUEUE_PATRON_ORDERS_KNOWLEDGE_POINTS] = true, + [CraftSim.CONST.GENERAL_OPTIONS.CRAFTQUEUE_PATRON_ORDERS_ACUITY] = true, + [CraftSim.CONST.GENERAL_OPTIONS.CRAFTQUEUE_PATRON_ORDERS_POWER_RUNE] = true, + [CraftSim.CONST.GENERAL_OPTIONS.CRAFTQUEUE_PATRON_ORDERS_EXCLUDE_WARBANK] = true, [CraftSim.CONST.GENERAL_OPTIONS.CRAFTQUEUE_PATRON_ORDERS_ALLOW_CONCENTRATION] = true, [CraftSim.CONST.GENERAL_OPTIONS.CRAFTQUEUE_PATRON_ORDERS_FORCE_CONCENTRATION] = false, [CraftSim.CONST.GENERAL_OPTIONS.CRAFTQUEUE_EDIT_RECIPE_OPTIMIZE_PROFESSION_GEAR] = true,