From 3f4cd67dae0c23a7023b73ab744a119b196be435 Mon Sep 17 00:00:00 2001 From: Sebastina Date: Fri, 7 Apr 2023 09:40:52 -0500 Subject: [PATCH] Add ExternalModImporter.cs allows access to ModFileSystemSelector actions to HTTP API --- Penumbra/Api/ExternalModImporter.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Penumbra/Api/ExternalModImporter.cs diff --git a/Penumbra/Api/ExternalModImporter.cs b/Penumbra/Api/ExternalModImporter.cs new file mode 100644 index 00000000..49005c50 --- /dev/null +++ b/Penumbra/Api/ExternalModImporter.cs @@ -0,0 +1,22 @@ +using Dalamud.Game.ClientState.Keys; +using OtterGui.Filesystem; +using OtterGui.FileSystem.Selector; +using Penumbra.Mods; +using Penumbra.UI.Classes; +using Penumbra.UI.ModsTab; +using System; +using System.IO; +using System.Linq; + +namespace Penumbra.Api { + public class ExternalModImporter { + private static ModFileSystemSelector modFileSystemSelectorInstance; + + public static ModFileSystemSelector ModFileSystemSelectorInstance { get => modFileSystemSelectorInstance; set => modFileSystemSelectorInstance = value; } + + public static void UnpackMod(string modPackagePath) + { + modFileSystemSelectorInstance.ImportStandaloneModPackage(modPackagePath); + } + } +}