From 45d197c48d709d9448d3b08b5f51e69b76defe30 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Thu, 17 Aug 2023 04:21:46 +1000 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E6=A8=A1=E6=95=B0=E6=8D=AE=E6=BA=A2?= =?UTF-8?q?=E5=87=BA=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Windows/App.xaml.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/VPet-Simulator.Windows/App.xaml.cs b/VPet-Simulator.Windows/App.xaml.cs index 394c3fe..99815c7 100644 --- a/VPet-Simulator.Windows/App.xaml.cs +++ b/VPet-Simulator.Windows/App.xaml.cs @@ -19,10 +19,17 @@ namespace VPet_Simulator.Windows private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) { e.Handled = true; + + var expt = e.Exception.ToString(); + if (expt.Contains("value") && expt.Contains("Panuon.WPF.UI.Internal.Utils") && expt.Contains("NaN")) + { + MessageBox.Show(expt, "由于修改游戏数据导致数据溢出,存档可能会出错\n开发者提醒您请不要使用过于超模的MOD".Translate()); + } + string errstr = "游戏发生错误,可能是".Translate() + (string.IsNullOrWhiteSpace(CoreMOD.NowLoading) ? "游戏或者MOD".Translate() : $"MOD({CoreMOD.NowLoading})") + "导致的\n如有可能请发送 错误信息截图和引发错误之前的操作 给开发者:service@exlb.net\n感谢您对游戏开发的支持\n".Translate() - + e.Exception.ToString(); + + expt; if (MainWindow == null) { MessageBox.Show(errstr, "游戏致命性错误".Translate());