Exclude Raphael from synth helper
This commit is contained in:
@@ -207,7 +207,7 @@ internal static class DynamicBars
|
|||||||
{
|
{
|
||||||
string tooltip;
|
string tooltip;
|
||||||
if (solver.IsIndeterminate)
|
if (solver.IsIndeterminate)
|
||||||
tooltip = "Initializing Solver";
|
tooltip = "Initializing";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tooltip = $"Solver Progress: {solver.ProgressValue:N0} / {solver.ProgressMax:N0}";
|
tooltip = $"Solver Progress: {solver.ProgressValue:N0} / {solver.ProgressMax:N0}";
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public sealed class Settings : Window, IDisposable
|
|||||||
ImGuiUtils.TooltipWrapped(tooltip);
|
ImGuiUtils.TooltipWrapped(tooltip);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DrawOption<T>(string label, string tooltip, Func<T, string> getName, Func<T, string> getTooltip, T value, Action<T> setter, ref bool isDirty) where T : struct, Enum
|
private static void DrawOption<T>(string label, string tooltip, Func<T, string> getName, Func<T, string> getTooltip, T value, Action<T> setter, ref bool isDirty, params T[] excludedValues) where T : struct, Enum
|
||||||
{
|
{
|
||||||
ImGui.SetNextItemWidth(OptionWidth);
|
ImGui.SetNextItemWidth(OptionWidth);
|
||||||
using (var combo = ImRaii.Combo(label, getName(value)))
|
using (var combo = ImRaii.Combo(label, getName(value)))
|
||||||
@@ -127,6 +127,8 @@ public sealed class Settings : Window, IDisposable
|
|||||||
{
|
{
|
||||||
foreach (var type in Enum.GetValues<T>())
|
foreach (var type in Enum.GetValues<T>())
|
||||||
{
|
{
|
||||||
|
if (excludedValues.Contains(type))
|
||||||
|
continue;
|
||||||
if (ImGui.Selectable(getName(type), value.Equals(type)))
|
if (ImGui.Selectable(getName(type), value.Equals(type)))
|
||||||
{
|
{
|
||||||
setter(type);
|
setter(type);
|
||||||
@@ -504,7 +506,7 @@ public sealed class Settings : Window, IDisposable
|
|||||||
Config.Save();
|
Config.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DrawSolverConfig(ref SolverConfig configRef, SolverConfig defaultConfig, out bool isDirty)
|
private static void DrawSolverConfig(ref SolverConfig configRef, SolverConfig defaultConfig, bool disableOptimal, out bool isDirty)
|
||||||
{
|
{
|
||||||
isDirty = false;
|
isDirty = false;
|
||||||
|
|
||||||
@@ -522,13 +524,14 @@ public sealed class Settings : Window, IDisposable
|
|||||||
"Algorithm",
|
"Algorithm",
|
||||||
"The algorithm to use when solving for a macro. Different " +
|
"The algorithm to use when solving for a macro. Different " +
|
||||||
"algorithms provide different pros and cons for using them. " +
|
"algorithms provide different pros and cons for using them. " +
|
||||||
"By far, the Stepwise Genetic algorithm provides the best " +
|
"By far, the Optimal and Stepwise Genetic algorithms provide " +
|
||||||
"results, especially for very difficult crafts.",
|
"the best results, especially for very difficult crafts.",
|
||||||
GetAlgorithmName,
|
GetAlgorithmName,
|
||||||
GetAlgorithmTooltip,
|
GetAlgorithmTooltip,
|
||||||
config.Algorithm,
|
config.Algorithm,
|
||||||
v => config = config with { Algorithm = v },
|
v => config = config with { Algorithm = v },
|
||||||
ref isDirty
|
ref isDirty,
|
||||||
|
disableOptimal ? [SolverAlgorithm.Raphael] : []
|
||||||
);
|
);
|
||||||
|
|
||||||
if (config.Algorithm != SolverAlgorithm.Raphael)
|
if (config.Algorithm != SolverAlgorithm.Raphael)
|
||||||
@@ -682,9 +685,9 @@ public sealed class Settings : Window, IDisposable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
using (var panel = ImRaii2.GroupPanel("Advanced", -1, out _))
|
if (config.Algorithm != SolverAlgorithm.Raphael)
|
||||||
{
|
{
|
||||||
if (config.Algorithm != SolverAlgorithm.Raphael)
|
using (var panel = ImRaii2.GroupPanel("Advanced", -1, out _))
|
||||||
{
|
{
|
||||||
DrawOption(
|
DrawOption(
|
||||||
"Max Rollout Step Count",
|
"Max Rollout Step Count",
|
||||||
@@ -708,72 +711,74 @@ public sealed class Settings : Window, IDisposable
|
|||||||
ref isDirty
|
ref isDirty
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
// TODO: Provide better option name than this lol
|
||||||
|
//DrawOption(
|
||||||
|
// "Unsound Branch Pruning",
|
||||||
|
// "TBD",
|
||||||
|
// config.UnsoundBranchPruning,
|
||||||
|
// v => config = config with { UnsoundBranchPruning = v },
|
||||||
|
// ref isDirty
|
||||||
|
//);
|
||||||
|
|
||||||
|
if (config.Algorithm != SolverAlgorithm.Raphael)
|
||||||
|
{
|
||||||
|
using (var panel = ImRaii2.GroupPanel("Score Weights (Advanced)", -1, out _))
|
||||||
{
|
{
|
||||||
DrawOption(
|
DrawOption(
|
||||||
"Unsound Branch Pruning",
|
"Progress",
|
||||||
"TBD",
|
"Amount of weight to give to the craft's progress.",
|
||||||
config.UnsoundBranchPruning,
|
config.ScoreProgress,
|
||||||
v => config = config with { UnsoundBranchPruning = v },
|
0,
|
||||||
|
100,
|
||||||
|
v => config = config with { ScoreProgress = v },
|
||||||
|
ref isDirty
|
||||||
|
);
|
||||||
|
|
||||||
|
DrawOption(
|
||||||
|
"Quality",
|
||||||
|
"Amount of weight to give to the craft's quality.",
|
||||||
|
config.ScoreQuality,
|
||||||
|
0,
|
||||||
|
100,
|
||||||
|
v => config = config with { ScoreQuality = v },
|
||||||
|
ref isDirty
|
||||||
|
);
|
||||||
|
|
||||||
|
DrawOption(
|
||||||
|
"Durability",
|
||||||
|
"Amount of weight to give to the craft's remaining durability.",
|
||||||
|
config.ScoreDurability,
|
||||||
|
0,
|
||||||
|
100,
|
||||||
|
v => config = config with { ScoreDurability = v },
|
||||||
|
ref isDirty
|
||||||
|
);
|
||||||
|
|
||||||
|
DrawOption(
|
||||||
|
"CP",
|
||||||
|
"Amount of weight to give to the craft's remaining CP.",
|
||||||
|
config.ScoreCP,
|
||||||
|
0,
|
||||||
|
100,
|
||||||
|
v => config = config with { ScoreCP = v },
|
||||||
|
ref isDirty
|
||||||
|
);
|
||||||
|
|
||||||
|
DrawOption(
|
||||||
|
"Steps",
|
||||||
|
"Amount of weight to give to the craft's number of steps. The lower " +
|
||||||
|
"the step count, the higher the score.",
|
||||||
|
config.ScoreSteps,
|
||||||
|
0,
|
||||||
|
100,
|
||||||
|
v => config = config with { ScoreSteps = v },
|
||||||
ref isDirty
|
ref isDirty
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
using (var panel = ImRaii2.GroupPanel("Score Weights (Advanced)", -1, out _))
|
|
||||||
{
|
|
||||||
DrawOption(
|
|
||||||
"Progress",
|
|
||||||
"Amount of weight to give to the craft's progress.",
|
|
||||||
config.ScoreProgress,
|
|
||||||
0,
|
|
||||||
100,
|
|
||||||
v => config = config with { ScoreProgress = v },
|
|
||||||
ref isDirty
|
|
||||||
);
|
|
||||||
|
|
||||||
DrawOption(
|
|
||||||
"Quality",
|
|
||||||
"Amount of weight to give to the craft's quality.",
|
|
||||||
config.ScoreQuality,
|
|
||||||
0,
|
|
||||||
100,
|
|
||||||
v => config = config with { ScoreQuality = v },
|
|
||||||
ref isDirty
|
|
||||||
);
|
|
||||||
|
|
||||||
DrawOption(
|
|
||||||
"Durability",
|
|
||||||
"Amount of weight to give to the craft's remaining durability.",
|
|
||||||
config.ScoreDurability,
|
|
||||||
0,
|
|
||||||
100,
|
|
||||||
v => config = config with { ScoreDurability = v },
|
|
||||||
ref isDirty
|
|
||||||
);
|
|
||||||
|
|
||||||
DrawOption(
|
|
||||||
"CP",
|
|
||||||
"Amount of weight to give to the craft's remaining CP.",
|
|
||||||
config.ScoreCP,
|
|
||||||
0,
|
|
||||||
100,
|
|
||||||
v => config = config with { ScoreCP = v },
|
|
||||||
ref isDirty
|
|
||||||
);
|
|
||||||
|
|
||||||
DrawOption(
|
|
||||||
"Steps",
|
|
||||||
"Amount of weight to give to the craft's number of steps. The lower " +
|
|
||||||
"the step count, the higher the score.",
|
|
||||||
config.ScoreSteps,
|
|
||||||
0,
|
|
||||||
100,
|
|
||||||
v => config = config with { ScoreSteps = v },
|
|
||||||
ref isDirty
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isDirty)
|
if (isDirty)
|
||||||
configRef = config;
|
configRef = config;
|
||||||
}
|
}
|
||||||
@@ -952,7 +957,7 @@ public sealed class Settings : Window, IDisposable
|
|||||||
ImGuiHelpers.ScaledDummy(5);
|
ImGuiHelpers.ScaledDummy(5);
|
||||||
|
|
||||||
var solverConfig = Config.RecipeNoteSolverConfig;
|
var solverConfig = Config.RecipeNoteSolverConfig;
|
||||||
DrawSolverConfig(ref solverConfig, SolverConfig.RecipeNoteDefault, out var isSolverDirty);
|
DrawSolverConfig(ref solverConfig, SolverConfig.RecipeNoteDefault, false, out var isSolverDirty);
|
||||||
if (isSolverDirty)
|
if (isSolverDirty)
|
||||||
{
|
{
|
||||||
Config.RecipeNoteSolverConfig = solverConfig;
|
Config.RecipeNoteSolverConfig = solverConfig;
|
||||||
@@ -974,7 +979,7 @@ public sealed class Settings : Window, IDisposable
|
|||||||
var isDirty = false;
|
var isDirty = false;
|
||||||
|
|
||||||
var solverConfig = Config.EditorSolverConfig;
|
var solverConfig = Config.EditorSolverConfig;
|
||||||
DrawSolverConfig(ref solverConfig, SolverConfig.EditorDefault, out var isSolverDirty);
|
DrawSolverConfig(ref solverConfig, SolverConfig.EditorDefault, false, out var isSolverDirty);
|
||||||
if (isSolverDirty)
|
if (isSolverDirty)
|
||||||
{
|
{
|
||||||
Config.EditorSolverConfig = solverConfig;
|
Config.EditorSolverConfig = solverConfig;
|
||||||
@@ -1059,7 +1064,7 @@ public sealed class Settings : Window, IDisposable
|
|||||||
ImGuiHelpers.ScaledDummy(5);
|
ImGuiHelpers.ScaledDummy(5);
|
||||||
|
|
||||||
var solverConfig = Config.SynthHelperSolverConfig;
|
var solverConfig = Config.SynthHelperSolverConfig;
|
||||||
DrawSolverConfig(ref solverConfig, SolverConfig.SynthHelperDefault, out var isSolverDirty);
|
DrawSolverConfig(ref solverConfig, SolverConfig.SynthHelperDefault, true, out var isSolverDirty);
|
||||||
if (isSolverDirty)
|
if (isSolverDirty)
|
||||||
{
|
{
|
||||||
Config.SynthHelperSolverConfig = solverConfig;
|
Config.SynthHelperSolverConfig = solverConfig;
|
||||||
|
|||||||
Reference in New Issue
Block a user