Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
derfloh205 committed Feb 6, 2024
1 parent 2e737e9 commit 738207e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 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: 15.0.0
## Version: 15.0.1
## X-Curse-Project-ID: 705015
## X-Wago-ID: 0mNwaPKo
## X-WoWI-ID: 26519
Expand Down
2 changes: 1 addition & 1 deletion Data/Classes/CooldownData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ end
function CraftSim.CooldownData:GetAllChargesFullDateFormatted()
local allchargesFullTime = self:GetAllChargesFullTimestamp()

local date = date("!*t", allchargesFullTime)
local date = date("*t", allchargesFullTime) -- with local time support = *t instead of !*T ?

return string.format("%02d.%02d.%d %02d:%02d", date.day, date.month, date.year, date.hour, date.min),
GetServerTime() <= allchargesFullTime
Expand Down
6 changes: 2 additions & 4 deletions Data/Classes/PriceData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,11 @@ end

function CraftSim.PriceData:Copy(recipeData)
local copy = CraftSim.PriceData(recipeData)
copy.qualityPriceList = CopyTable(self.qualityPriceList)
copy.qualityPriceList = CopyTable(self.qualityPriceList or {})
copy.craftingCosts = self.craftingCosts
copy.craftingCostsFixed = self.craftingCostsFixed
copy.craftingCostsRequired = self.craftingCostsRequired
copy.expectedCostsByQuality = CopyTable(self.expectedCostsByQuality)
copy.optimizedReagentsExpectedCraftingCosts = CopyTable(self.optimizedReagentsExpectedCraftingCosts)
copy.reagentPriceInfoByItemID = CopyTable(self.reagentPriceInfoByItemID)
copy.expectedCostsByQuality = CopyTable(self.expectedCostsByQuality or {})
return copy
end

Expand Down
10 changes: 9 additions & 1 deletion Data/News.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,22 @@ function CraftSim.NEWS:GET_NEWS(itemMap)
local news = {
f.bb(" Hello and thank you for using CraftSim!\n"),
f.bb(" ( You are awesome! )"),
newP("15.0.0"),
newP("15.0.1"),
f.P .. "Introducing " .. f.bb("Sub Recipes Optimization"),
f.a .. "- " .. f.l("CraftSim") .. " is now able to optimize and cache",
f.a .. " crafting cost details for reagents",
f.P .. f.g("Cost Details"),
f.a .. "- Now shows the lowest expected crafting costs for an item",
f.a .. " if you or one of your alts are able to craft it (and its cached)",
f.a .. "- Subcrafting costs are considered if you enable it in the module",
f.P .. f.g("Recipe Scan"),
f.a .. "- Added a Recipe Scan Option to toggle",
f.a .. f.bb(" optimization of sub recipes"),
f.p .. f.bb("Cooldowns"),
f.a .. "- Fixed a bug when displaying a cooldown that is fully charged",
f.p .. f.bb("CraftResults"),
f.a .. "- Fixed a Typo in the Item Result Log saying 'Profit: :'",
f.a .. " instead of 'Saved Reagents:",
newP("14.4.1"),
f.P .. "Updated Russian Localizations",
f.a .. "- Thanks to " .. f.bb("https://github.com/SerGlushko") .. " !",
Expand Down
7 changes: 5 additions & 2 deletions Modules/Cooldowns/Frames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ function CraftSim.COOLDOWNS.FRAMES:Init()
anchorA = "LEFT", anchorB = "RIGHT",
}
chargesColumn.SetCharges = function(self, current, max)
current = math.min(current, max)
if current == max and max > 0 then
chargesColumn.current:SetText(f.g(current))
chargesColumn.max:SetText(f.g(max))
Expand Down Expand Up @@ -235,10 +236,12 @@ function CraftSim.COOLDOWNS.FRAMES:UpdateList()
print("Updating Timers for " .. tostring(recipeInfo.name))
local cooldownData = self.cooldownData
chargesColumn:SetCharges(cooldownData:GetCurrentCharges(), cooldownData.maxCharges)
nextColumn.text:SetText(f.bb(cooldownData:GetFormattedTimerNextCharge()))
local allFullTS, ready = cooldownData:GetAllChargesFullTimestamp()
local cdReady = ready or cooldownData:GetCurrentCharges() >= cooldownData.maxCharges
nextColumn.text:SetText(cdReady and f.grey("-") or
f.bb(cooldownData:GetFormattedTimerNextCharge()))
row.allchargesFullTimestamp = allFullTS
if ready then
if cdReady then
allColumn.text:SetText(f.g("Ready"))
else
allColumn.text:SetText(f.g(cooldownData:GetAllChargesFullDateFormatted()))
Expand Down
2 changes: 1 addition & 1 deletion Modules/CraftResults/Frames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ function CraftSim.CRAFT_RESULTS.FRAMES:UpdateItemList()
-- add saved reagents
local savedReagentsText = ""
if #CraftSim.CRAFT_RESULTS.currentSessionData.totalSavedReagents > 0 then
savedReagentsText = "\n" .. CraftSim.LOCAL:GetText(CraftSim.CONST.TEXT.CRAFT_RESULTS_STATISTICS_11) .. ":\n"
savedReagentsText = "\n" .. CraftSim.LOCAL:GetText(CraftSim.CONST.TEXT.CRAFT_RESULTS_SAVED_REAGENTS) .. "\n"
for _, savedReagent in pairs(CraftSim.CRAFT_RESULTS.currentSessionData.totalSavedReagents) do
savedReagentsText = savedReagentsText ..
(savedReagent.quantity or 1) .. " x " .. (savedReagent.item:GetItemLink() or "") .. "\n"
Expand Down

0 comments on commit 738207e

Please sign in to comment.