对重复名称MOD进行去重

This commit is contained in:
ZouJin 2023-12-21 17:26:43 +08:00
parent 0ebd1285ae
commit 435b17e2d1
5 changed files with 12 additions and 0 deletions

View File

@ -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("该模组已停用");

View File

@ -1205,6 +1205,7 @@ namespace VPet_Simulator.Windows
public async void GameLoad(List<DirectoryInfo> Path)
{
Path = Path.Distinct().ToList();
await Dispatcher.InvokeAsync(new Action(() => LoadingText.Content = "Loading MOD"));
//加载mod
foreach (DirectoryInfo di in Path)

View File

@ -0,0 +1 @@
MOD名称重复#MOD name duplicated:|

View File

@ -0,0 +1 @@
MOD名称重复#MOD名称重复:|

View File

@ -0,0 +1 @@
MOD名称重复#MOD名稱重複:|