feat: 常驻关卡备选提示

This commit is contained in:
uye
2026-06-25 10:56:18 +08:00
parent 5bfbd22215
commit d31ca81e83
6 changed files with 36 additions and 0 deletions

View File

@@ -849,6 +849,7 @@ Do not adjust the proxy multiplier setting in the game</system:String>
<system:String x:Key="UseCustomAnnihilation">Custom {key=AnnihilationStage}</system:String>
<system:String x:Key="AnnihilationMode">Annihilation Mode</system:String>
<system:String x:Key="Annihilation.Current">Current Annihilation</system:String>
<system:String x:Key="PermanentStageBlocksStages">The selected stage 「{0}」 is a permanent stage or Current/Last; subsequent stages will not be selected</system:String>
<system:String x:Key="Chernobog">Chernobog</system:String>
<system:String x:Key="LungmenOutskirts">Lungmen Outskirts</system:String>
<system:String x:Key="LungmenDowntown">Lungmen Downtown</system:String>

View File

@@ -850,6 +850,7 @@ C:\\leidian\\LDPlayer9
<system:String x:Key="UseCustomAnnihilation">カスタム{key=AnnihilationStage}</system:String>
<system:String x:Key="AnnihilationMode">殲滅作戦</system:String>
<system:String x:Key="Annihilation.Current">今期の殲滅作戦</system:String>
<system:String x:Key="PermanentStageBlocksStages">選択されたステージ 「{0}」 は常設ステージまたは現在/最後のため、後続のステージは選択されません</system:String>
<system:String x:Key="Chernobog">チェルノボーグ</system:String>
<system:String x:Key="LungmenOutskirts">龍門郊外</system:String>
<system:String x:Key="LungmenDowntown">龍門市街</system:String>

View File

@@ -851,6 +851,7 @@ C:\\leidian\\LDPlayer9
<system:String x:Key="UseCustomAnnihilation">커스텀 {key=AnnihilationStage}</system:String>
<system:String x:Key="AnnihilationMode">섬멸 모드</system:String>
<system:String x:Key="Annihilation.Current">이번 섬멸 작전</system:String>
<system:String x:Key="PermanentStageBlocksStages">선택된 스테이지 「{0}」 는 상설 스테이지 또는 현재/마지막이므로 이후 스테이지는 선택되지 않습니다</system:String>
<system:String x:Key="Chernobog">체르노보그</system:String>
<system:String x:Key="LungmenOutskirts">용문 외곽</system:String>
<system:String x:Key="LungmenDowntown">용문 시내</system:String>

View File

@@ -850,6 +850,7 @@ C:\\leidian\\LDPlayer9。\n
<system:String x:Key="UseCustomAnnihilation">自定义{key=AnnihilationStage}</system:String>
<system:String x:Key="AnnihilationMode">剿灭模式</system:String>
<system:String x:Key="Annihilation.Current">当期剿灭</system:String>
<system:String x:Key="PermanentStageBlocksStages">当前选中的关卡 「{0}」 为常驻关卡或当前/上次,其后的关卡不会被选中执行</system:String>
<system:String x:Key="Chernobog">切尔诺伯格</system:String>
<system:String x:Key="LungmenOutskirts">龙门外环</system:String>
<system:String x:Key="LungmenDowntown">龙门市区</system:String>

View File

@@ -850,6 +850,7 @@ C:\\leidian\\LDPlayer9\n
<system:String x:Key="UseCustomAnnihilation">自定義{key=AnnihilationStage}</system:String>
<system:String x:Key="AnnihilationMode">剿滅模式</system:String>
<system:String x:Key="Annihilation.Current">當期剿滅</system:String>
<system:String x:Key="PermanentStageBlocksStages">目前選中的關卡 「{0}」 為常駐關卡或當前/上次,其後的關卡不會被選中執行</system:String>
<system:String x:Key="Chernobog">切爾諾伯格</system:String>
<system:String x:Key="LungmenOutskirts">龍門外環</system:String>
<system:String x:Key="LungmenDowntown">龍門市區</system:String>

View File

@@ -1061,6 +1061,20 @@ public class FightSettingsUserControlModel : TaskSettingsViewModel, FightSetting
return stage;
}
/// <summary>
/// 判断指定关卡是否为常驻关卡(无周期限制且非限时活动,每天都开放)。
/// 资源关(如 LS-6虽有关联活动但 IsResourceCollection 为 true 且无周期限制,同样视为常驻。
/// </summary>
/// <param name="stage">关卡代码。</param>
/// <returns>若该关卡为常驻关卡则返回 <c>true</c>。</returns>
private static bool IsPermanentStage(string stage)
{
var stageInfo = Instances.StageManager.GetStageInfo(stage);
bool noPeriodicLimit = stageInfo.OpenDaysOfWeek == null || !stageInfo.OpenDaysOfWeek.Any();
bool notLimitedActivity = stageInfo.Activity == null || stageInfo.Activity.IsResourceCollection;
return noPeriodicLimit && notLimitedActivity;
}
public override void RefreshUI(BaseTask baseTask)
{
if (baseTask is not FightTask fight)
@@ -1361,6 +1375,23 @@ public class FightSettingsUserControlModel : TaskSettingsViewModel, FightSetting
return (null, []);
}
// 选关逻辑为从上至下找第一个开放关卡,
// 常驻关卡如剿灭、1-7或"当前/上次"(空字符串)一旦被选中便不会继续往下查找,
// 因此其后配置的关卡不会被选中执行
if (taskId is null && (stage == string.Empty || IsPermanentStage(stage)))
{
int stageIndex = fight.StagePlan.IndexOf(stage);
if (stageIndex >= 0 && stageIndex < fight.StagePlan.Count - 1)
{
var stageName = stage == string.Empty
? LocalizationHelper.GetString("DefaultStage")
: Instances.StageManager.GetStageInfo(stage).Display;
Instances.TaskQueueViewModel.AddLog(
LocalizationHelper.GetStringFormat("PermanentStageBlocksStages", stageName),
UiLogColor.Warning);
}
}
var time = DateTimeOffset.Now;
var activityExpireIn2Days = false;
var activityList = Instances.StageManager.ActivityList.Where(ss => ss.Value.Info.StartTimeUtc <= time && time <= ss.Value.Info.ExpireTimeUtc);