From d52a513ef02fcb38e2343062a18d4ea9b24b9f09 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Mon, 2 Oct 2023 20:03:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BB=E6=A1=A3=E5=A4=B1=E8=B4=A5=E6=97=B6?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E4=B8=8A=E4=B8=AA=E5=AD=98=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Windows/MainWindow.xaml.cs | 24 +++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index f1f8bf8..e95be3c 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -287,20 +287,24 @@ namespace VPet_Simulator.Windows return i; return 0; }).ToList(); - var latestsave = ds.LastOrDefault(); - if (latestsave != null) + for (int i = ds.Count - 1; i >= 0; i--) { - try + var latestsave = ds[i]; + if (latestsave != null) { - if (GameLoad(new LPS(File.ReadAllText(latestsave)))) - return; - MessageBoxX.Show("存档损毁,无法加载该存档\n可能是上次储存出错或Steam云同步导致的\n请在设置中加载备份还原存档", "存档损毁".Translate()); - } - catch (Exception ex) - { - MessageBoxX.Show("存档损毁,无法加载该存档\n可能是数据溢出/超模导致的" + '\n' + ex.Message, "存档损毁".Translate()); + try + { + if (GameLoad(new LPS(File.ReadAllText(latestsave)))) + return; + //MessageBoxX.Show("存档损毁,无法加载该存档\n可能是上次储存出错或Steam云同步导致的\n请在设置中加载备份还原存档", "存档损毁".Translate()); + } + catch // (Exception ex) + { + //MessageBoxX.Show("存档损毁,无法加载该存档\n可能是数据溢出/超模导致的" + '\n' + ex.Message, "存档损毁".Translate()); + } } } + } GameSavesData = new GameSave_v2(petname.Translate()); Core.Save = GameSavesData.GameSave;