Skip to content

Commit

Permalink
smal nil error, supporter update, craftqueue recipe duplicate allowed…
Browse files Browse the repository at this point in the history
… for different crafters
  • Loading branch information
derfloh205 committed Jan 25, 2024
1 parent 008ee56 commit 0a3d14d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 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: 14.2.4
## Version: 14.2.5
## X-Curse-Project-ID: 705015
## X-Wago-ID: 0mNwaPKo
## X-WoWI-ID: 26519
Expand Down
11 changes: 3 additions & 8 deletions Data/Classes/CraftQueue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,12 @@ end
---@param recipeData CraftSim.RecipeData
---@return CraftSim.CraftQueueItem | nil craftQueueItem, number? index
function CraftSim.CraftQueue:FindRecipe(recipeData)
-- local craftQueueItem, index = GUTIL:Find(self.craftQueueItems,
-- ---@param cqi CraftSim.CraftQueueItem
-- function (cqi)
-- return cqi.recipeData:EqualCraftSetup(recipeData)
-- end)
-- return craftQueueItem, index

local craftQueueItem, index = GUTIL:Find(self.craftQueueItems,
---@param cqi CraftSim.CraftQueueItem
function(cqi)
return cqi.recipeData.recipeID == recipeData.recipeID
local sameID = cqi.recipeData.recipeID == recipeData.recipeID
local sameCrafter = cqi.recipeData:GetCrafterUID() == recipeData:GetCrafterUID()
return sameID and sameCrafter
end)
return craftQueueItem, index
end
Expand Down
11 changes: 9 additions & 2 deletions Data/News.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@ function CraftSim.NEWS:GET_NEWS(itemMap)
-- minimize names to make manual formatting easier :p
local f = CraftSim.UTIL:GetFormatter()
local function newP(v) return f.l("\n --- Version " .. v .. " ---\n") end
local supporterListUpdate = f.p .. f.patreon("Supporter List Update ") ..
CraftSim.MEDIA:GetAsTextIcon(CraftSim.MEDIA.IMAGES.PIXEL_HEART, 0.15)
local news = {
f.bb(" Hello and thank you for using CraftSim!\n"),
f.bb(" ( You are awesome! )"),
newP("14.2.5"),
f.s .. "It is now possible to queue the same recipe twice for",
f.a .. "different crafter characters into the " .. f.g("CraftQueue"),
f.p .. "Small nil error fix for the statistics table",
supporterListUpdate,
newP("14.2.4"),
f.P .. f.g("CraftQueue"),
f.a .. "- " .. f.bb("Reagent Item Count") .. " you own and craftable count is",
Expand All @@ -39,7 +46,7 @@ function CraftSim.NEWS:GET_NEWS(itemMap)
f.a .. "- Fixed module window flicker when opening",
f.a .. "- crafting window after login",
f.p ..
f.patreon("Supporter List Update ") .. CraftSim.MEDIA:GetAsTextIcon(CraftSim.MEDIA.IMAGES.PIXEL_HEART, 0.2),
supporterListUpdate,
newP("14.0.1"),
f.p .. "Attempting fix for",
f.a .. f.bb("https://github.com/derfloh205/CraftSim/issues/209"),
Expand Down Expand Up @@ -68,7 +75,7 @@ function CraftSim.NEWS:GET_NEWS(itemMap)
f.p .. "Thank you " .. f.bb("https://github.com/SirDester") .. " for",
f.a .. " updating the italian translations!",
f.p ..
f.patreon("Supporter List Update ") .. CraftSim.MEDIA:GetAsTextIcon(CraftSim.MEDIA.IMAGES.PIXEL_HEART, 0.2),
supporterListUpdate,
newP("13.0.1"),
f.p .. "Fixed a bug with non-initialized professionInfoCache",
f.p .. "Updated toc file for 10.2.5",
Expand Down
2 changes: 1 addition & 1 deletion Modules/CraftStatistics/Frames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ function CraftSim.STATISTICS.FRAMES:UpdateDisplay(recipeData)

for qualityID, chance in pairs(recipeData.resultData.chanceByQuality) do
local expectedCrafts = nil
if chance == 0 then
if chance == 0 or recipeData.resultData.expectedCraftsByQuality[qualityID] == nil then
expectedCrafts = "-"
else
expectedCrafts = GUTIL:Round(recipeData.resultData.expectedCraftsByQuality[qualityID], 2)
Expand Down
6 changes: 6 additions & 0 deletions Modules/Supporters/Supporters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ function CraftSim.SUPPORTERS:GetList()
local kofi = CraftSim.MEDIA:GetAsTextIcon(CraftSim.MEDIA.IMAGES.KOFI, 0.45)
local paypal = " " .. CraftSim.MEDIA:GetAsTextIcon(CraftSim.MEDIA.IMAGES.PAYPAL, 0.35)
return {
{
name = f.bb("Holyrain"),
type = kofi,
message = "Thank you for an amazing add-on!",
date = "24.01.2024",
},
{
name = f.bb("Stargrace"),
type = kofi,
Expand Down

0 comments on commit 0a3d14d

Please sign in to comment.