Fix Collectable handling
This commit is contained in:
@@ -18,6 +18,7 @@ public sealed record RecipeData
|
|||||||
|
|
||||||
public ClassJob ClassJob { get; }
|
public ClassJob ClassJob { get; }
|
||||||
public RecipeInfo RecipeInfo { get; }
|
public RecipeInfo RecipeInfo { get; }
|
||||||
|
public bool IsCollectable => Recipe.ItemResult.Value?.AlwaysCollectable ?? false;
|
||||||
public IReadOnlyList<int?>? CollectableThresholds { get; }
|
public IReadOnlyList<int?>? CollectableThresholds { get; }
|
||||||
public IReadOnlyList<(Item Item, int Amount)> Ingredients { get; }
|
public IReadOnlyList<(Item Item, int Amount)> Ingredients { get; }
|
||||||
public int MaxStartingQuality { get; }
|
public int MaxStartingQuality { get; }
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ internal sealed class SimulatedMacro
|
|||||||
public Reliablity(in SimulationState startState, IEnumerable<ActionType> actions, int iterCount, RecipeData recipeData)
|
public Reliablity(in SimulationState startState, IEnumerable<ActionType> actions, int iterCount, RecipeData recipeData)
|
||||||
{
|
{
|
||||||
Func<SimulationState, int> getParam;
|
Func<SimulationState, int> getParam;
|
||||||
if (recipeData.Recipe.ItemResult.Value!.IsCollectable)
|
if (recipeData.IsCollectable)
|
||||||
getParam = s => s.Collectability;
|
getParam = s => s.Collectability;
|
||||||
else if (recipeData.Recipe.RequiredQuality > 0)
|
else if (recipeData.Recipe.RequiredQuality > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -739,7 +739,7 @@ public sealed class MacroEditor : Window, IDisposable
|
|||||||
textStarsSize = AxisFont.CalcTextSize(textStars);
|
textStarsSize = AxisFont.CalcTextSize(textStars);
|
||||||
var textLevel = SqText.LevelPrefix.ToIconChar() + SqText.ToLevelString(RecipeData.RecipeInfo.ClassJobLevel);
|
var textLevel = SqText.LevelPrefix.ToIconChar() + SqText.ToLevelString(RecipeData.RecipeInfo.ClassJobLevel);
|
||||||
var isExpert = RecipeData.RecipeInfo.IsExpert;
|
var isExpert = RecipeData.RecipeInfo.IsExpert;
|
||||||
var isCollectable = RecipeData.Recipe.ItemResult.Value!.IsCollectable;
|
var isCollectable = RecipeData.IsCollectable;
|
||||||
var imageSize = ImGui.GetFrameHeight();
|
var imageSize = ImGui.GetFrameHeight();
|
||||||
var textSize = ImGui.GetFontSize();
|
var textSize = ImGui.GetFontSize();
|
||||||
var badgeSize = new Vector2(textSize * (ExpertBadge.AspectRatio ?? 1), textSize);
|
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("Durability", Colors.Durability, State.Durability, RecipeData.RecipeInfo.MaxDurability),
|
||||||
new("Condition", DrawCondition)
|
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}"));
|
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)
|
else if (RecipeData.Recipe.RequiredQuality > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -662,7 +662,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
|
|||||||
}
|
}
|
||||||
var textLevel = SqText.LevelPrefix.ToIconChar() + SqText.ToLevelString(RecipeData.RecipeInfo.ClassJobLevel);
|
var textLevel = SqText.LevelPrefix.ToIconChar() + SqText.ToLevelString(RecipeData.RecipeInfo.ClassJobLevel);
|
||||||
var isExpert = RecipeData.RecipeInfo.IsExpert;
|
var isExpert = RecipeData.RecipeInfo.IsExpert;
|
||||||
var isCollectable = RecipeData.Recipe.ItemResult.Value!.IsCollectable;
|
var isCollectable = RecipeData.IsCollectable;
|
||||||
var imageSize = ImGui.GetFrameHeight();
|
var imageSize = ImGui.GetFrameHeight();
|
||||||
var textSize = ImGui.GetFontSize();
|
var textSize = ImGui.GetFontSize();
|
||||||
var badgeSize = new Vector2(textSize * (ExpertBadge.AspectRatio ?? 1), textSize);
|
var badgeSize = new Vector2(textSize * (ExpertBadge.AspectRatio ?? 1), textSize);
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ public sealed unsafe class SynthHelper : Window, IDisposable
|
|||||||
{
|
{
|
||||||
new("Durability", Colors.Durability, state.Durability, RecipeData.RecipeInfo.MaxDurability),
|
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}"));
|
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)
|
else if (RecipeData.Recipe.RequiredQuality > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user