mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
新增备份设置 & 旧版本多开bug修复
This commit is contained in:
parent
802af257d6
commit
0c29f37101
@ -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('-');
|
||||
|
@ -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");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user