From 435b17e2d199926b8950c78486aad51019949587 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Thu, 21 Dec 2023 17:26:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E9=87=8D=E5=A4=8D=E5=90=8D=E7=A7=B0MO?= =?UTF-8?q?D=E8=BF=9B=E8=A1=8C=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Windows/Function/CoreMOD.cs | 8 ++++++++ VPet-Simulator.Windows/MainWindow.cs | 1 + VPet-Simulator.Windows/mod/0000_core/lang/en/Prog2312.lps | 1 + .../mod/0000_core/lang/zh-Hans/Prog2312.lps | 1 + .../mod/0000_core/lang/zh-Hant/Prog2312.lps | 1 + 5 files changed, 12 insertions(+) create mode 100644 VPet-Simulator.Windows/mod/0000_core/lang/en/Prog2312.lps create mode 100644 VPet-Simulator.Windows/mod/0000_core/lang/zh-Hans/Prog2312.lps create mode 100644 VPet-Simulator.Windows/mod/0000_core/lang/zh-Hant/Prog2312.lps diff --git a/VPet-Simulator.Windows/Function/CoreMOD.cs b/VPet-Simulator.Windows/Function/CoreMOD.cs index 180b0a7..4689563 100644 --- a/VPet-Simulator.Windows/Function/CoreMOD.cs +++ b/VPet-Simulator.Windows/Function/CoreMOD.cs @@ -9,6 +9,7 @@ using System.IO; using System.Linq; using System.Reflection; using System.Windows; +using System.Xml.Linq; using VPet_Simulator.Core; using VPet_Simulator.Windows.Interface; @@ -104,6 +105,13 @@ namespace VPet_Simulator.Windows LocalizeCore.AddCulture(line.info, ls); } + if(mw.CoreMODs.FirstOrDefault(x=>x.Name == Name) != null) + { + Name += $"({"MOD名称重复".Translate()})"; + ErrorMessage = "MOD名称重复".Translate(); + return; + } + if (!IsOnMOD(mw)) { Tag.Add("该模组已停用"); diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index 8ba2107..37e48fc 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -1205,6 +1205,7 @@ namespace VPet_Simulator.Windows public async void GameLoad(List Path) { + Path = Path.Distinct().ToList(); await Dispatcher.InvokeAsync(new Action(() => LoadingText.Content = "Loading MOD")); //加载mod foreach (DirectoryInfo di in Path) diff --git a/VPet-Simulator.Windows/mod/0000_core/lang/en/Prog2312.lps b/VPet-Simulator.Windows/mod/0000_core/lang/en/Prog2312.lps new file mode 100644 index 0000000..ace77c6 --- /dev/null +++ b/VPet-Simulator.Windows/mod/0000_core/lang/en/Prog2312.lps @@ -0,0 +1 @@ +MOD名称重复#MOD name duplicated:| \ No newline at end of file diff --git a/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hans/Prog2312.lps b/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hans/Prog2312.lps new file mode 100644 index 0000000..4f7d8de --- /dev/null +++ b/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hans/Prog2312.lps @@ -0,0 +1 @@ +MOD名称重复#MOD名称重复:| \ No newline at end of file diff --git a/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hant/Prog2312.lps b/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hant/Prog2312.lps new file mode 100644 index 0000000..cbf4124 --- /dev/null +++ b/VPet-Simulator.Windows/mod/0000_core/lang/zh-Hant/Prog2312.lps @@ -0,0 +1 @@ +MOD名称重复#MOD名稱重複:| \ No newline at end of file