From 70b652098d43773ed55ee3ae2274f550bfa97fc2 Mon Sep 17 00:00:00 2001 From: windofxy <52917206+windofxy@users.noreply.github.com> Date: Sun, 20 Aug 2023 21:09:07 +0800 Subject: [PATCH] =?UTF-8?q?mod=E7=AE=A1=E7=90=86=E5=99=A8=E5=86=85mod?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E5=85=A5=E5=8F=A3=E6=98=BE=E7=A4=BA=E5=88=A4?= =?UTF-8?q?=E5=AE=9A=E6=9D=A1=E4=BB=B6=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WinDesign/winGameSetting.xaml.cs | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs index 67255eb..918aa25 100644 --- a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs @@ -18,6 +18,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Threading; using VPet_Simulator.Core; +using VPet_Simulator.Windows.Interface; namespace VPet_Simulator.Windows { @@ -339,11 +340,16 @@ namespace VPet_Simulator.Windows foreach (var mainplug in mw.Plugins) { - if (mainplug.PluginName == mod.Name) + try { - ButtonSetting.Visibility = Visibility.Visible; - return; + if (mainplug.GetType().GetMethod("Setting").DeclaringType != typeof(MainPlugin) + && mainplug.GetType().Assembly.Location.Contains(mod.Path.FullName)) + { + ButtonSetting.Visibility = Visibility.Visible; + return; + } } + finally { } } ButtonSetting.Visibility = Visibility.Collapsed; } @@ -915,11 +921,16 @@ namespace VPet_Simulator.Windows { foreach (var mainplug in mw.Plugins) { - if (mainplug.PluginName == mod.Name) + try { - mainplug.Setting(); - return; + if (mainplug.GetType().GetMethod("Setting").DeclaringType != typeof(MainPlugin) + && mainplug.GetType().Assembly.Location.Contains(mod.Path.FullName)) + { + mainplug.Setting(); + return; + } } + finally { } } }