From 360d3eb84fa56e6ca7fb13a4da6d3bfab45fa024 Mon Sep 17 00:00:00 2001 From: uye <2396806385@qq.com> Date: Sun, 29 Jan 2023 18:14:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81web=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=85=B3=E5=8D=A1=E5=AF=BC=E8=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/MaaWpfGui/Helper/StageManager.cs | 11 ++++++++++- src/MaaWpfGui/Main/TaskQueueViewModel.cs | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/MaaWpfGui/Helper/StageManager.cs b/src/MaaWpfGui/Helper/StageManager.cs index 5818544370..a87b9e21f3 100644 --- a/src/MaaWpfGui/Helper/StageManager.cs +++ b/src/MaaWpfGui/Helper/StageManager.cs @@ -23,6 +23,7 @@ using MaaWpfGui.Helper; using Newtonsoft.Json.Linq; using Semver; using Stylet; +using StyletIoC; namespace MaaWpfGui { @@ -34,13 +35,16 @@ namespace MaaWpfGui [DllImport("MaaCore.dll")] private static extern IntPtr AsstGetVersion(); + private readonly IContainer _container; + private Dictionary _stages; /// /// Initializes a new instance of the class. /// - public StageManager() + public StageManager(IContainer container) { + _container = container; UpdateStage(false); Execute.OnUIThread(async () => @@ -48,6 +52,11 @@ namespace MaaWpfGui var task = Task.Run(() => { UpdateStage(true); + if (_container != null) + { + _container.Get().UpdateDatePrompt(); + _container.Get().UpdateStageList(true); + } }); await task; }); diff --git a/src/MaaWpfGui/Main/TaskQueueViewModel.cs b/src/MaaWpfGui/Main/TaskQueueViewModel.cs index bdbe86e262..948b8ac48b 100644 --- a/src/MaaWpfGui/Main/TaskQueueViewModel.cs +++ b/src/MaaWpfGui/Main/TaskQueueViewModel.cs @@ -242,7 +242,7 @@ namespace MaaWpfGui TaskItemViewModels = new ObservableCollection(temp_order_list); - _stageManager = new StageManager(); + _stageManager = new StageManager(_container); RemainingSanityStageList = new ObservableCollection(_stageManager.GetStageList()) { // It's Cur/Last option