mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
修复读取存档可能的错误
This commit is contained in:
parent
e90ad87185
commit
6482eb6fc8
@ -1271,12 +1271,12 @@ namespace VPet_Simulator.Windows
|
|||||||
{
|
{
|
||||||
Set = new Setting(this, File.ReadAllText(ExtensionValue.BaseDirectory + @$"\Setting{PrefixSave}.lps"));
|
Set = new Setting(this, File.ReadAllText(ExtensionValue.BaseDirectory + @$"\Setting{PrefixSave}.lps"));
|
||||||
}
|
}
|
||||||
if (PrefixSave == "" && !Set["SingleTips"].GetBool("helloworld") && File.Exists(ExtensionValue.BaseDirectory + @"\Setting.bkp"))
|
if (PrefixSave == "" && (Set == null || (Set != null && !Set["SingleTips"].GetBool("helloworld"))) && File.Exists(ExtensionValue.BaseDirectory + @"\Setting.bkp"))
|
||||||
{//如果设置是损坏的, 读取备份设置
|
{//如果设置是损坏的, 读取备份设置
|
||||||
Set = new Setting(this, File.ReadAllText(ExtensionValue.BaseDirectory + @"\Setting.bkp"));
|
Set = new Setting(this, File.ReadAllText(ExtensionValue.BaseDirectory + @"\Setting.bkp"));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
Set = new Setting(this, "Setting#VPET:|\n");
|
Set ??= new Setting(this, "Setting#VPET:|\n");
|
||||||
|
|
||||||
var visualTree = new FrameworkElementFactory(typeof(Border));
|
var visualTree = new FrameworkElementFactory(typeof(Border));
|
||||||
visualTree.SetValue(Border.BackgroundProperty, new TemplateBindingExtension(BackgroundProperty));
|
visualTree.SetValue(Border.BackgroundProperty, new TemplateBindingExtension(BackgroundProperty));
|
||||||
|
Loading…
Reference in New Issue
Block a user