From 53b728aa148b2c956a68bb9f8d627d1623ba709e Mon Sep 17 00:00:00 2001 From: ZouJin Date: Sat, 9 Mar 2024 19:37:51 +0800 Subject: [PATCH] Fix #332 --- .gitignore | 1 + VPet.Solution/App.xaml.cs | 9 +++------ VPet.Solution/Views/MainWindow.xaml.cs | 7 +------ 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 01dfcf8..13a925e 100644 --- a/.gitignore +++ b/.gitignore @@ -354,3 +354,4 @@ MigrationBackup/ *_PDLC_* *_DLC_* VPet-Simulator.Windows/mod/1111_ChatGPTPlus +VPet.Solution/Properties/launchSettings.json diff --git a/VPet.Solution/App.xaml.cs b/VPet.Solution/App.xaml.cs index bde1717..8e9780c 100644 --- a/VPet.Solution/App.xaml.cs +++ b/VPet.Solution/App.xaml.cs @@ -8,13 +8,10 @@ namespace VPet.Solution; /// public partial class App : Application { - public static bool IsDone { get; set; } = false; - protected override void OnStartup(StartupEventArgs e) { if (e.Args != null && e.Args.Count() > 0) { - IsDone = true; switch (e.Args[0].ToLower()) { case "removestarup": @@ -25,12 +22,12 @@ public partial class App : Application { File.Delete(path); } - return; + break; case "launchsteam": Process.Start("steam://rungameid/1920960"); - return; + break; } + Application.Current.Shutdown(); } - IsDone = false; } } diff --git a/VPet.Solution/Views/MainWindow.xaml.cs b/VPet.Solution/Views/MainWindow.xaml.cs index 770c36a..71cdde2 100644 --- a/VPet.Solution/Views/MainWindow.xaml.cs +++ b/VPet.Solution/Views/MainWindow.xaml.cs @@ -24,12 +24,7 @@ public partial class MainWindow : WindowX public SaveWindow SaveWindow { get; } = new(); public MainWindow() - { - if (App.IsDone) - { - Close(); - return; - } + { InitializeComponent(); this.SetViewModel(); Closed += MainWindow_Closed;