Skip to content

Commit

Permalink
Crafting Costs Hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
derfloh205 committed Dec 13, 2023
1 parent 64b3284 commit bcbae4f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CraftSim.toc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Data/News.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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") ..
Expand Down
14 changes: 7 additions & 7 deletions Modules/CraftQueue/Frames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit bcbae4f

Please sign in to comment.