Skip to content

Commit

Permalink
💾 Feat: 使用优化的导入插件算法, 避免二次解包
Browse files Browse the repository at this point in the history
  • Loading branch information
Dynesshely committed Dec 4, 2022
1 parent 902b8eb commit c1c1777
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions Services/PluginsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,12 @@ internal static void ImportPlugin(string[] kxpfiles, bool inGraphic = false)
if (workbase == null)
throw new Exception("Can not get path of \"KitX\"");
}
string releaseDir = Path.GetFullPath($"{workbase}/{GlobalInfo.KXPTempReleasePath}");
foreach (var item in kxpfiles)
{
try
{
if (Directory.Exists(releaseDir))
Directory.Delete(releaseDir, true);
_ = Directory.CreateDirectory(releaseDir);

KitX.KXP.Helper.Decoder decoder = new(item);
Tuple<string, string> rst = decoder.Decode(releaseDir);
Directory.Delete(releaseDir, true);
Tuple<string, string> rst = decoder.GetLoaderAndPluginStruct();
LoaderStruct loaderStruct = JsonSerializer.Deserialize<LoaderStruct>(rst.Item1);
PluginStruct pluginStruct = JsonSerializer.Deserialize<PluginStruct>(rst.Item2);
AppConfig? config = null;
Expand Down

0 comments on commit c1c1777

Please sign in to comment.