diff --git a/Craftimizer/Utils/RecipeData.cs b/Craftimizer/Utils/RecipeData.cs index a4d21a2..f7bf9fb 100644 --- a/Craftimizer/Utils/RecipeData.cs +++ b/Craftimizer/Utils/RecipeData.cs @@ -18,6 +18,7 @@ public sealed record RecipeData public ClassJob ClassJob { get; } public RecipeInfo RecipeInfo { get; } + public bool IsCollectable => Recipe.ItemResult.Value?.AlwaysCollectable ?? false; public IReadOnlyList? CollectableThresholds { get; } public IReadOnlyList<(Item Item, int Amount)> Ingredients { get; } public int MaxStartingQuality { get; } diff --git a/Craftimizer/Utils/SimulatedMacro.cs b/Craftimizer/Utils/SimulatedMacro.cs index 42ec62a..28fb485 100644 --- a/Craftimizer/Utils/SimulatedMacro.cs +++ b/Craftimizer/Utils/SimulatedMacro.cs @@ -66,7 +66,7 @@ internal sealed class SimulatedMacro public Reliablity(in SimulationState startState, IEnumerable actions, int iterCount, RecipeData recipeData) { Func getParam; - if (recipeData.Recipe.ItemResult.Value!.IsCollectable) + if (recipeData.IsCollectable) getParam = s => s.Collectability; else if (recipeData.Recipe.RequiredQuality > 0) { diff --git a/Craftimizer/Windows/MacroEditor.cs b/Craftimizer/Windows/MacroEditor.cs index 6872622..28e1ba2 100644 --- a/Craftimizer/Windows/MacroEditor.cs +++ b/Craftimizer/Windows/MacroEditor.cs @@ -739,7 +739,7 @@ public sealed class MacroEditor : Window, IDisposable textStarsSize = AxisFont.CalcTextSize(textStars); var textLevel = SqText.LevelPrefix.ToIconChar() + SqText.ToLevelString(RecipeData.RecipeInfo.ClassJobLevel); var isExpert = RecipeData.RecipeInfo.IsExpert; - var isCollectable = RecipeData.Recipe.ItemResult.Value!.IsCollectable; + var isCollectable = RecipeData.IsCollectable; var imageSize = ImGui.GetFrameHeight(); var textSize = ImGui.GetFontSize(); var badgeSize = new Vector2(textSize * (ExpertBadge.AspectRatio ?? 1), textSize); @@ -1080,7 +1080,7 @@ public sealed class MacroEditor : Window, IDisposable new("Durability", Colors.Durability, State.Durability, RecipeData.RecipeInfo.MaxDurability), new("Condition", DrawCondition) }; - if (RecipeData.Recipe.ItemResult.Value!.IsCollectable) + if (RecipeData.IsCollectable) datas.Add(new("Collectability", Colors.Collectability, Reliability.ParamScore, State.Collectability, State.MaxCollectability, RecipeData.CollectableThresholds, $"{State.Collectability}", $"{State.MaxCollectability:0}")); else if (RecipeData.Recipe.RequiredQuality > 0) { diff --git a/Craftimizer/Windows/RecipeNote.cs b/Craftimizer/Windows/RecipeNote.cs index 6fd3020..d716724 100644 --- a/Craftimizer/Windows/RecipeNote.cs +++ b/Craftimizer/Windows/RecipeNote.cs @@ -662,7 +662,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable } var textLevel = SqText.LevelPrefix.ToIconChar() + SqText.ToLevelString(RecipeData.RecipeInfo.ClassJobLevel); var isExpert = RecipeData.RecipeInfo.IsExpert; - var isCollectable = RecipeData.Recipe.ItemResult.Value!.IsCollectable; + var isCollectable = RecipeData.IsCollectable; var imageSize = ImGui.GetFrameHeight(); var textSize = ImGui.GetFontSize(); var badgeSize = new Vector2(textSize * (ExpertBadge.AspectRatio ?? 1), textSize); diff --git a/Craftimizer/Windows/SynthHelper.cs b/Craftimizer/Windows/SynthHelper.cs index 470bfa7..16f638d 100644 --- a/Craftimizer/Windows/SynthHelper.cs +++ b/Craftimizer/Windows/SynthHelper.cs @@ -400,7 +400,7 @@ public sealed unsafe class SynthHelper : Window, IDisposable { new("Durability", Colors.Durability, state.Durability, RecipeData.RecipeInfo.MaxDurability), }; - if (RecipeData.Recipe.ItemResult.Value!.IsCollectable) + if (RecipeData.IsCollectable) halfBars.Add(new("Collectability", Colors.Collectability, reliability.ParamScore, state.Collectability, state.MaxCollectability, RecipeData.CollectableThresholds, $"{state.Collectability}", $"{state.MaxCollectability:0}")); else if (RecipeData.Recipe.RequiredQuality > 0) {