mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-17 10:00:44 +08:00
@@ -1615,14 +1615,11 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
Instances.TaskQueueViewModel.RefreshCustomInfrastPlan();
|
||||
|
||||
// SetAndNotify 在值没有变化时不会触发 PropertyChanged 事件,所以这里手动触发一下
|
||||
var index = Instances.TaskQueueViewModel.CustomInfrastPlanIndex;
|
||||
var count = Instances.TaskQueueViewModel.CustomInfrastPlanList.Count;
|
||||
Instances.TaskQueueViewModel.NeedAddCustomInfrastPlanInfo = false;
|
||||
{
|
||||
Instances.TaskQueueViewModel.CustomInfrastPlanIndex = (index + 1) % count;
|
||||
Instances.TaskQueueViewModel.CustomInfrastPlanIndex = index;
|
||||
Instances.TaskQueueViewModel.CustomInfrastPlanIndex--;
|
||||
Instances.TaskQueueViewModel.CustomInfrastPlanIndex++;
|
||||
}
|
||||
|
||||
Instances.TaskQueueViewModel.NeedAddCustomInfrastPlanInfo = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2643,9 +2643,24 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
|
||||
public int CustomInfrastPlanIndex
|
||||
{
|
||||
get => _customInfrastPlanIndex;
|
||||
get
|
||||
{
|
||||
if (_customInfrastPlanIndex >= CustomInfrastPlanInfoList.Count || _customInfrastPlanIndex < 0)
|
||||
{
|
||||
CustomInfrastPlanIndex = _customInfrastPlanIndex;
|
||||
}
|
||||
|
||||
return _customInfrastPlanIndex;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value >= CustomInfrastPlanInfoList.Count || value < 0)
|
||||
{
|
||||
var count = CustomInfrastPlanInfoList.Count;
|
||||
value = (value % count + count) % count;
|
||||
_logger.Warning($"CustomInfrastPlanIndex out of range, reset to Index % Count: {value}");
|
||||
}
|
||||
|
||||
if (value != _customInfrastPlanIndex && NeedAddCustomInfrastPlanInfo)
|
||||
{
|
||||
var plan = CustomInfrastPlanInfoList[value];
|
||||
@@ -2855,14 +2870,7 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
AddLog(prePlanPostDesc);
|
||||
}
|
||||
|
||||
if (CustomInfrastPlanIndex >= CustomInfrastPlanList.Count - 1)
|
||||
{
|
||||
CustomInfrastPlanIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
++CustomInfrastPlanIndex;
|
||||
}
|
||||
++CustomInfrastPlanIndex;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user