修复存档冲突导致的出错bug

This commit is contained in:
ZouJin 2023-06-21 05:30:26 +10:00
parent 670588adce
commit 58b504222a
2 changed files with 11 additions and 10 deletions

View File

@ -75,7 +75,8 @@ namespace VPet_Simulator.Windows
var ds = Directory.GetFiles(AppDomain.CurrentDomain.BaseDirectory + @"\UserData");
if (ds.Length > 20)
File.Delete(ds[0]);
if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + $"\\UserData\\Save_{st}.lps"))
File.Delete(AppDomain.CurrentDomain.BaseDirectory + $"\\UserData\\Save_{st}.lps");
File.Move(AppDomain.CurrentDomain.BaseDirectory + @"\Save.lps", AppDomain.CurrentDomain.BaseDirectory + $"\\UserData\\Save_{st}.lps");
if (Core != null && Core.Save != null)
File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + @"\Save.lps", Core.Save.ToLine().ToString());
@ -314,6 +315,6 @@ namespace VPet_Simulator.Windows
}
}
}
}
}

View File

@ -194,7 +194,7 @@ namespace VPet_Simulator.Windows
MessageBoxX.Show($"模组 {cm.Name} 的代码插件损坏\n虚拟桌宠模拟器未能成功加载该插件\n请联系作者修复该问题", $"{cm.Name} 未加载代码插件");
else if (Set.IsMSGMOD(cm.Name))
MessageBoxX.Show($"由于 {cm.Name} 包含代码插件\n虚拟桌宠模拟器已自动停止加载该插件\n请手动前往设置允许启用该mod 代码插件", $"{cm.Name} 未加载代码插件");
CoreMOD.NowLoading = null;
//判断是否需要清空缓存
if (Set.LastCacheDate < CoreMODs.Max(x => x.CacheDate))
{//需要清理缓存
@ -366,7 +366,7 @@ namespace VPet_Simulator.Windows
winSetting.Show();
};
if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial.html") && Set["SingleTips"].GetDateTime("tutorial") <= new DateTime(2023, 2, 23))
if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial.html") && Set["SingleTips"].GetDateTime("tutorial") <= new DateTime(2023, 6, 20))
{
Set["SingleTips"].SetDateTime("tutorial", DateTime.Now);
Process.Start(AppDomain.CurrentDomain.BaseDirectory + @"\Tutorial.html");
@ -383,13 +383,13 @@ namespace VPet_Simulator.Windows
Main.Say("欢迎使用虚拟桌宠模拟器\n这是个中期的测试版,若有bug请多多包涵\n欢迎加群虚拟主播模拟器430081239或在菜单栏-管理-反馈中提交bug或建议", GraphCore.Helper.SayType.Shining);
});
}
else if (Set["SingleTips"].GetDateTime("update") <= new DateTime(2023, 6, 15))
else if (Set["SingleTips"].GetDateTime("update") <= new DateTime(2023, 6, 21))
{
// if (Set["SingleTips"].GetDateTime("update") > new DateTime(2023, 6, 8))
// notifyIcon.ShowBalloonTip(10, "更新通知 06/16",
//"修复频繁喝水的bug,更好买新增查看详细信息\n更新了新的状态动画文件", ToolTipIcon.Info);
// else
notifyIcon.ShowBalloonTip(10, "更新通知 06/16",
if (Set["SingleTips"].GetDateTime("update") > new DateTime(2023, 6, 19)) // 上次更新日期时间
notifyIcon.ShowBalloonTip(10, "更新通知 06/21", //本次更新内容
"添加喝水,口渴,睡觉,肚子饿,喂食,等动画\n新增低状态的说话文本,更新食物图片\n提高了学习收益和降低了学习消耗", ToolTipIcon.Info);
else// 累计更新内容
notifyIcon.ShowBalloonTip(10, "更新通知 06/21",
"现已支持数据计算,桌宠现在需要进行吃饭喝水等\n更新了新的状态动画文件\n新增自动备份存档功能\n数据计算数据相关优化", ToolTipIcon.Info);
Set["SingleTips"].SetDateTime("update", DateTime.Now);
}