fix: 修复关卡关闭后导航的问题

fix #3117
This commit is contained in:
uye
2022-12-20 16:42:33 +08:00
parent 7c529f280f
commit b577126eaf

View File

@@ -16,6 +16,7 @@ using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
@@ -285,17 +286,17 @@ namespace MaaWpfGui
StageList = new ObservableCollection<CombData>(_stageManager.GetStageList());
// reset closed stages to "Last/Current"
if (!CustomStageCode && (stage1 == null))
if (!CustomStageCode && !StageList.Any(x => x.Value == stage1))
{
Stage1 = string.Empty;
}
if (stage2 == null)
if (!CustomStageCode && !StageList.Any(x => x.Value == stage2))
{
Stage2 = string.Empty;
}
if (stage3 == null)
if (!CustomStageCode && !StageList.Any(x => x.Value == stage3))
{
Stage3 = string.Empty;
}
@@ -305,6 +306,11 @@ namespace MaaWpfGui
// do nothing
}
}
if (!CustomStageCode && !RemainingSanityStageList.Any(x => x.Value == _remainingSanityStage))
{
RemainingSanityStage = string.Empty;
}
}
private bool NeedToUpdateDatePrompt()
@@ -1450,7 +1456,16 @@ namespace MaaWpfGui
public string RemainingSanityStage
{
get => _remainingSanityStage;
get
{
if (!IsStageOpen(_remainingSanityStage))
{
return string.Empty;
}
return _remainingSanityStage;
}
set
{
SetAndNotify(ref _remainingSanityStage, value);