mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-20 02:55:38 +08:00
fix: 活动结束后活动关卡被误判成常驻关卡
This commit is contained in:
@@ -117,5 +117,37 @@ namespace MaaWpfGui.Models
|
||||
// regular stage, always open
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether the stage is open or will open
|
||||
/// </summary>
|
||||
/// <returns>Whether stage is open</returns>
|
||||
public bool IsStageOpenOrWillOpen()
|
||||
{
|
||||
if (Activity != null)
|
||||
{
|
||||
if (!Activity.IsExpired)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// expired activity
|
||||
if (!Activity.IsResourceCollection)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// expired resource activity, check open days
|
||||
}
|
||||
|
||||
// resource stage
|
||||
if (OpenDays != null && OpenDays.Any())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// regular stage, always open
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,10 +237,8 @@ namespace MaaWpfGui.Services
|
||||
UtcExpireTime = GetDateTime(stageObj["Activity"], "UtcExpireTime"),
|
||||
},
|
||||
};
|
||||
if (!stageInfo.Activity.IsExpired)
|
||||
{
|
||||
tempStage.Add(stageInfo.Display, stageInfo);
|
||||
}
|
||||
|
||||
tempStage.Add(stageInfo.Display, stageInfo);
|
||||
}
|
||||
|
||||
continue;
|
||||
@@ -266,10 +264,7 @@ namespace MaaWpfGui.Services
|
||||
},
|
||||
};
|
||||
|
||||
if (!stageInfo.Activity.IsExpired)
|
||||
{
|
||||
tempStage.Add(stageInfo.Display, stageInfo);
|
||||
}
|
||||
tempStage.Add(stageInfo.Display, stageInfo);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -395,12 +390,12 @@ namespace MaaWpfGui.Services
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all stage list
|
||||
/// Gets all open or will open stage list
|
||||
/// </summary>
|
||||
/// <returns>All stage list</returns>
|
||||
/// <returns>Open or will open stage list</returns>
|
||||
public IEnumerable<CombinedData> GetStageList()
|
||||
{
|
||||
return _stages.Values.Where(stage => !stage.IsHidden);
|
||||
return _stages.Values.Where(stage => !stage.IsHidden && stage.IsStageOpenOrWillOpen());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user