From 82ff63185348f5968c6dd8377650f7437185ebac Mon Sep 17 00:00:00 2001 From: ZouJin Date: Thu, 21 Sep 2023 12:26:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E4=BB=A3=E7=A0=81=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E6=8F=90=E4=BE=9B=E6=8A=A5=E9=94=99=E4=BF=A1=E6=81=AF=20#217?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Windows/Function/CoreMOD.cs | 7 +++++-- VPet-Simulator.Windows/MainWindow.xaml.cs | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/VPet-Simulator.Windows/Function/CoreMOD.cs b/VPet-Simulator.Windows/Function/CoreMOD.cs index 3864e82..6ad72e2 100644 --- a/VPet-Simulator.Windows/Function/CoreMOD.cs +++ b/VPet-Simulator.Windows/Function/CoreMOD.cs @@ -41,6 +41,7 @@ namespace VPet_Simulator.Windows public HashSet Tag = new HashSet(); public bool SuccessLoad = true; public DateTime CacheDate; + public string ErrorMessage; public static string INTtoVER(int ver) => $"{ver / 100}.{ver % 100:00}"; public static void LoadImage(MainWindow mw, DirectoryInfo di) { @@ -257,8 +258,9 @@ namespace VPet_Simulator.Windows } } } - catch + catch (Exception e) { + ErrorMessage = e.Message; SuccessLoad = false; } } @@ -268,8 +270,9 @@ namespace VPet_Simulator.Windows } } } - catch + catch(Exception e) { + ErrorMessage = e.Message; Tag.Add("该模组已损坏"); SuccessLoad = false; } diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index f4665c8..c46ad38 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -761,9 +761,9 @@ namespace VPet_Simulator.Windows foreach (CoreMOD cm in CoreMODs) if (!cm.SuccessLoad) if (cm.Tag.Contains("该模组已损坏")) - MessageBoxX.Show("模组 {0} 插件损坏\n虚拟桌宠模拟器未能成功加载该插件\n请联系作者修复该问题".Translate(cm.Name), "该模组已损坏".Translate()); + MessageBoxX.Show("模组 {0} 插件损坏\n虚拟桌宠模拟器未能成功加载该插件\n请联系作者修复该问题".Translate(cm.Name) + '\n' + cm.ErrorMessage, "该模组已损坏".Translate()); else if (Set.IsPassMOD(cm.Name)) - MessageBoxX.Show("模组 {0} 的代码插件损坏\n虚拟桌宠模拟器未能成功加载该插件\n请联系作者修复该问题".Translate(cm.Name), "{0} 未加载代码插件".Translate(cm.Name)); + MessageBoxX.Show("模组 {0} 的代码插件损坏\n虚拟桌宠模拟器未能成功加载该插件\n请联系作者修复该问题".Translate(cm.Name) + '\n' + cm.ErrorMessage, "{0} 未加载代码插件".Translate(cm.Name)); else if (Set.IsMSGMOD(cm.Name)) MessageBoxX.Show("由于 {0} 包含代码插件\n虚拟桌宠模拟器已自动停止加载该插件\n请手动前往设置允许启用该mod 代码插件".Translate(cm.Name), "{0} 未加载代码插件".Translate(cm.Name));