mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 18:47:55 +08:00
fix: 连战次数修复, 减少hard code
This commit is contained in:
@@ -103,18 +103,6 @@ public class FightSettingsUserControlModel : TaskViewModel
|
||||
{ "炭", "SK-5" },
|
||||
};
|
||||
|
||||
public Dictionary<string, int> SeriesList { get; } = new()
|
||||
{
|
||||
{ "AUTO", 1000 },
|
||||
{ "6", 6 },
|
||||
{ "5", 5 },
|
||||
{ "4", 4 },
|
||||
{ "3", 6 },
|
||||
{ "2", 2 },
|
||||
{ "1", 1 },
|
||||
{ LocalizationHelper.GetString("NotSelected"), -1 },
|
||||
};
|
||||
|
||||
public string?[] Stages => [Stage1, Stage2, Stage3];
|
||||
|
||||
/// <remarks>Try to fix: issues#5742. 关卡选择为 null 时的一个补丁,可能是 StageList 改变后,wpf binding 延迟更新的问题。</remarks>
|
||||
@@ -472,7 +460,31 @@ public class FightSettingsUserControlModel : TaskViewModel
|
||||
}
|
||||
}
|
||||
|
||||
private int _series = ConfigurationHelper.GetValue(ConfigurationKeys.SeriesQuantity, 1000);
|
||||
public Dictionary<string, int> SeriesList { get; } = new()
|
||||
{
|
||||
{ "AUTO", 0 },
|
||||
{ "6", 6 },
|
||||
{ "5", 5 },
|
||||
{ "4", 4 },
|
||||
{ "3", 3 },
|
||||
{ "2", 2 },
|
||||
{ "1", 1 },
|
||||
{ LocalizationHelper.GetString("NotSelected"), -1 },
|
||||
};
|
||||
|
||||
private int _series = InitFightSeries();
|
||||
|
||||
private static int InitFightSeries()
|
||||
{
|
||||
var series = ConfigurationHelper.GetValue(ConfigurationKeys.SeriesQuantity, 0);
|
||||
if (Enumerable.Range(-1, 8).Contains(series))
|
||||
{
|
||||
return series;
|
||||
}
|
||||
|
||||
ConfigurationHelper.SetValue(ConfigurationKeys.SeriesQuantity, "0");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the max number of times.
|
||||
|
||||
Reference in New Issue
Block a user