From bcbae4fd33a26a4c11aa1fff27032cdc21918a3b Mon Sep 17 00:00:00 2001 From: Genju Date: Wed, 13 Dec 2023 14:27:53 +0100 Subject: [PATCH] Crafting Costs Hotfix --- CraftSim.toc | 2 +- Data/News.lua | 2 +- Modules/CraftQueue/Frames.lua | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CraftSim.toc b/CraftSim.toc index f50ff374..816e0553 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 dragonflight gold making ## Author: genju -## Version: 11.3.5 +## Version: 11.3.6 ## X-Curse-Project-ID: 705015 ## X-Wago-ID: 0mNwaPKo ## X-WoWI-ID: 26519 diff --git a/Data/News.lua b/Data/News.lua index 3756c379..8054462d 100644 --- a/Data/News.lua +++ b/Data/News.lua @@ -10,7 +10,7 @@ function CraftSim.NEWS:GET_NEWS() return f.bb(" Hello and thank you for using CraftSim!\n") .. f.bb(" ( You are awesome! )") .. - newP("11.3.5") .. + newP("11.3.6") .. f.s .. f.bb("CraftQueue") .. " now shows total average profit and crafting costs" .. f.s .. "Updated Italian Localizations" .. f.a .. "Thanks to " .. f.bb("https://github.com/SirDester") .. diff --git a/Modules/CraftQueue/Frames.lua b/Modules/CraftQueue/Frames.lua index d0bebcf7..55c15e74 100644 --- a/Modules/CraftQueue/Frames.lua +++ b/Modules/CraftQueue/Frames.lua @@ -513,16 +513,16 @@ function CraftSim.CRAFTQ.FRAMES:UpdateFrameListByCraftQueue() switchToRecipeColumn.switchButton:SetEnabled(craftQueueItem.correctProfessionOpen) switchToRecipeColumn.switchButton.recipeID = recipeData.recipeID - local averageProfit = recipeData.averageProfitCached or recipeData:GetAverageProfit() - totalAverageProfit = totalAverageProfit + averageProfit - recipeColumn.text:SetText(recipeData.recipeName) - averageProfitColumn.text:SetText(CraftSim.GUTIL:FormatMoney(select(1, averageProfit), true, recipeData.priceData.craftingCosts)) - -- update price data and profit? recipeData.priceData:Update() recipeData:GetAverageProfit() - local craftingCosts = recipeData.priceData.craftingCosts - totalCraftingCosts = totalCraftingCosts + craftingCosts + local craftingCosts = recipeData.priceData.craftingCosts * craftQueueItem.amount + + local averageProfit = (recipeData.averageProfitCached or recipeData:GetAverageProfit()) * craftQueueItem.amount + totalAverageProfit = totalAverageProfit + averageProfit + recipeColumn.text:SetText(recipeData.recipeName) + averageProfitColumn.text:SetText(CraftSim.GUTIL:FormatMoney(select(1, averageProfit), true, craftingCosts)) + craftingCostsColumn.text:SetText(f.r(CraftSim.GUTIL:FormatMoney(craftingCosts))) reagentInfoColumn.reagentInfoButton:SetText(recipeData.reagentData:GetTooltipText(craftQueueItem.amount))