diff --git a/src/MeoAsstGui/ViewModels/CopilotViewModel.cs b/src/MeoAsstGui/ViewModels/CopilotViewModel.cs index df0159ddf9..53cd66bd3d 100644 --- a/src/MeoAsstGui/ViewModels/CopilotViewModel.cs +++ b/src/MeoAsstGui/ViewModels/CopilotViewModel.cs @@ -133,7 +133,9 @@ namespace MeoAsstGui return; } - asstProxy.AsstStartCopilot(data["stage_name"].ToString(), Filename, Form); + const string _newfilename = "resource/_temp_copilot.json"; + File.WriteAllText(_newfilename, data.ToString()); + asstProxy.AsstStartCopilot(data["stage_name"].ToString(), _newfilename, Form); Idle = false; AddLog("Star Burst Stream!"); } diff --git a/src/MeoAsstGui/ViewModels/RootViewModel.cs b/src/MeoAsstGui/ViewModels/RootViewModel.cs index f087096616..579b932390 100644 --- a/src/MeoAsstGui/ViewModels/RootViewModel.cs +++ b/src/MeoAsstGui/ViewModels/RootViewModel.cs @@ -58,6 +58,7 @@ namespace MeoAsstGui //Items.Add(ivm); Items.Add(cvm); Items.Add(svm); + svm.UpdateWindowTitle(); // 在标题栏上显示模拟器和IP端口 必须在 Items.Add(svm)之后执行。 ActiveItem = tvm; } @@ -88,5 +89,11 @@ namespace MeoAsstGui await task; } } + private string _windowTitle; + public string WindowTitle + { + get => _windowTitle; + set => SetAndNotify(ref _windowTitle, value); + } } } diff --git a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs index 173a84b876..5dee7ee666 100644 --- a/src/MeoAsstGui/ViewModels/SettingsViewModel.cs +++ b/src/MeoAsstGui/ViewModels/SettingsViewModel.cs @@ -812,6 +812,7 @@ namespace MeoAsstGui { SetAndNotify(ref _connectAddress, value); ViewStatusStorage.Set("Connect.Address", value); + UpdateWindowTitle(); /* 姣忔淇敼杩炴帴鍦板潃鏃舵洿鏂癢IndowTitle */ } } @@ -930,6 +931,20 @@ namespace MeoAsstGui } } + /* 鏍囬鏍忔樉绀烘ā鎷熷櫒鍚嶇О鍜孖P绔彛 */ + public void UpdateWindowTitle() + { + var rvm = (RootViewModel)this.Parent; + string ConnectConfigName = ""; + foreach (CombData data in ConnectConfigList) + { + if (data.Value == ConnectConfig) + { + ConnectConfigName = data.Display; + } + } + rvm.WindowTitle = string.Format("MaaAssistantArknights - {0} ({1})", ConnectConfigName, ConnectAddress); + } //public void TryToSetBlueStacksHyperVAddress() //{ // if (AdbPath.Length == 0 || !File.Exists(AdbPath)) diff --git a/src/MeoAsstGui/Views/RootView.xaml b/src/MeoAsstGui/Views/RootView.xaml index 4e8798f2ab..5b4eaa2ab9 100644 --- a/src/MeoAsstGui/Views/RootView.xaml +++ b/src/MeoAsstGui/Views/RootView.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:s="https://github.com/canton7/Stylet" mc:Ignorable="d" - Title="MaaAssistantArknights" Height="595" Width="800"> + Title="{Binding WindowTitle}" Height="595" Width="800">