Merge pull request #3800 from MaaAssistantArknights/feat/updateStage

feat: 添加4点检查web是否更新关卡
This commit is contained in:
MistEO
2023-02-23 00:41:41 +08:00
committed by GitHub
2 changed files with 8 additions and 6 deletions

View File

@@ -38,7 +38,6 @@ namespace MaaWpfGui
// model references
private readonly TaskQueueViewModel _taskQueueViewModel;
private readonly SettingsViewModel _settingsViewModel;
// datas
private Dictionary<string, StageInfo> _stages;
@@ -50,7 +49,6 @@ namespace MaaWpfGui
public StageManager(IContainer container)
{
_taskQueueViewModel = container.Get<TaskQueueViewModel>();
_settingsViewModel = container.Get<SettingsViewModel>();
UpdateStage(false);
Execute.OnUIThread(async () =>
@@ -68,7 +66,7 @@ namespace MaaWpfGui
});
}
private void UpdateStage(bool fromWeb)
public void UpdateStage(bool fromWeb)
{
var tempStage = new Dictionary<string, StageInfo>
{
@@ -90,7 +88,7 @@ namespace MaaWpfGui
"yyyy/MM/dd HH:mm:ss",
CultureInfo.InvariantCulture).AddHours(-Convert.ToInt32(keyValuePairs?["TimeZone"].ToString() ?? "0"));
var clientType = _settingsViewModel.ClientType;
var clientType = ViewStatusStorage.Get("Start.ClientType", string.Empty);
// 官服和B服使用同样的资源
if (clientType == "Bilibili" || clientType == string.Empty)

View File

@@ -157,8 +157,12 @@ namespace MaaWpfGui
{
if (NeedToUpdateDatePrompt())
{
UpdateDatePrompt();
UpdateStageList(false);
Execute.OnUIThread(() =>
{
_stageManager.UpdateStage(true);
UpdateDatePrompt();
UpdateStageList(false);
});
}
refreshCustomInfrastPlanIndexByPeriod();