diff --git a/VPet-Simulator.Windows/App.xaml.cs b/VPet-Simulator.Windows/App.xaml.cs index d233cbc..5e6cef0 100644 --- a/VPet-Simulator.Windows/App.xaml.cs +++ b/VPet-Simulator.Windows/App.xaml.cs @@ -34,6 +34,10 @@ namespace VPet_Simulator.Windows { Args = e.Args; + //旧版本多开bug修复 + if (File.Exists(ExtensionValue.BaseDirectory + @"\Setting-.lps")) + File.Delete(ExtensionValue.BaseDirectory + @"\Setting-.lps"); + foreach (var mss in new DirectoryInfo(ExtensionValue.BaseDirectory).GetFiles("Setting*.lps")) { var n = mss.Name.Substring(7).Trim('-'); diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index b5ed960..9563c5c 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -235,6 +235,10 @@ namespace VPet_Simulator.Windows //timecount = DateTime.Now; } Set.StartRecordLastPoint = new Point(Dispatcher.Invoke(() => Left), Dispatcher.Invoke(() => Top)); + if (PrefixSave == "") + {//对于主设置的备份 + File.Move(ExtensionValue.BaseDirectory + @"\Setting.lps", ExtensionValue.BaseDirectory + @"\Setting.bkp"); + } File.WriteAllText(ExtensionValue.BaseDirectory + @$"\Setting{PrefixSave}.lps", Set.ToString()); if (!Directory.Exists(ExtensionValue.BaseDirectory + @"\Saves")) @@ -1259,6 +1263,10 @@ namespace VPet_Simulator.Windows { Set = new Setting(this, File.ReadAllText(ExtensionValue.BaseDirectory + @$"\Setting{PrefixSave}.lps")); } + else if (PrefixSave == "" && File.Exists(ExtensionValue.BaseDirectory + @"\Setting.lps")) + { + Set = new Setting(this, File.ReadAllText(ExtensionValue.BaseDirectory + @"\Setting.lps")); + } else Set = new Setting(this, "Setting#VPET:|\n");