feat: 自定义基建计划自动增序

This commit is contained in:
MistEO
2022-09-20 17:24:30 +08:00
parent 12616d99f3
commit b2aaae5c08
3 changed files with 24 additions and 0 deletions

View File

@@ -447,6 +447,11 @@ namespace MeoAsstGui
break;
case AsstMsg.TaskChainCompleted:
if (taskChain == "Infrast")
{
mainModel.IncreaseCustomInfrastPlanIndex();
}
mainModel.AddLog(Localization.GetString("CompleteTask") + taskChain);
if (taskChain == "Copilot")
{

View File

@@ -43,6 +43,7 @@
<system:String x:Key="CustomInfrastFileParseFailed">自定义基建配置文件解析错误!</system:String>
<system:String x:Key="CustomInfrastTitle">自定义基建配置:</system:String>
<system:String x:Key="CustomInfrastPlan">基建计划</system:String>
<system:String x:Key="CustomInfrastPlanIndexAutoSwitch">自动保存为下个计划</system:String>
<system:String x:Key="General">通用模式</system:String>
<system:String x:Key="BlueStacks">蓝叠模拟器</system:String>

View File

@@ -1535,6 +1535,24 @@ namespace MeoAsstGui
}
}
public void IncreaseCustomInfrastPlanIndex()
{
if (!CustomInfrastEnabled)
{
return;
}
AddLog(Localization.GetString("CustomInfrastPlanIndexAutoSwitch"), LogColor.Message);
if (CustomInfrastPlanIndex >= CustomInfrastPlanList.Count - 1)
{
CustomInfrastPlanIndex = 0;
}
else
{
++CustomInfrastPlanIndex;
}
}
public ObservableCollection<GenericCombData<int>> CustomInfrastPlanList { get; set; } = new ObservableCollection<GenericCombData<int>>();
public struct CustomInfrastPlanInfo