mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
修复 多开模式不加载代码插件 fix #361
This commit is contained in:
parent
32f11dbe7d
commit
42d989c574
@ -8,6 +8,7 @@ using System.Diagnostics;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Reflection.Metadata;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using VPet_Simulator.Core;
|
using VPet_Simulator.Core;
|
||||||
using VPet_Simulator.Windows.Interface;
|
using VPet_Simulator.Windows.Interface;
|
||||||
@ -28,6 +29,7 @@ namespace VPet_Simulator.Windows
|
|||||||
"VPet-Simulator.Core.dll","VPet-Simulator.Windows.Interface.dll","LinePutScript.Localization.WPF.dll",
|
"VPet-Simulator.Core.dll","VPet-Simulator.Windows.Interface.dll","LinePutScript.Localization.WPF.dll",
|
||||||
"CSCore.dll"
|
"CSCore.dll"
|
||||||
};
|
};
|
||||||
|
public static Dictionary<string, Type> LoadPlug { get; } = new Dictionary<string, Type>();
|
||||||
public static string NowLoading = null;
|
public static string NowLoading = null;
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string Author { get; set; }
|
public string Author { get; set; }
|
||||||
@ -312,6 +314,11 @@ namespace VPet_Simulator.Windows
|
|||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
var path = tmpfi.Name;
|
var path = tmpfi.Name;
|
||||||
|
if (LoadPlug.ContainsKey(path))
|
||||||
|
{
|
||||||
|
mw.Plugins.Add((MainPlugin)Activator.CreateInstance(LoadPlug[path], mw));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (LoadedDLL.Contains(path))
|
if (LoadedDLL.Contains(path))
|
||||||
continue;
|
continue;
|
||||||
LoadedDLL.Add(path);
|
LoadedDLL.Add(path);
|
||||||
@ -358,6 +365,7 @@ namespace VPet_Simulator.Windows
|
|||||||
var n = exportedType.FullName.ToLower();
|
var n = exportedType.FullName.ToLower();
|
||||||
if (!(n.Contains("modmaker") || n.Contains("dlc")))
|
if (!(n.Contains("modmaker") || n.Contains("dlc")))
|
||||||
App.MODType.Add(exportedType.FullName);
|
App.MODType.Add(exportedType.FullName);
|
||||||
|
LoadPlug.Add(path, exportedType);
|
||||||
mw.Plugins.Add((MainPlugin)Activator.CreateInstance(exportedType, mw));
|
mw.Plugins.Add((MainPlugin)Activator.CreateInstance(exportedType, mw));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user