// Simple V2 mod packs are basically the same as V1 mod packs. private DirectoryInfo ImportSimpleV2ModPack(ZipFile extractedModPack, SimpleModPack modList) { _currentOptionIdx = 0; _currentNumOptions = 1; _currentModName = modList.Name; _currentGroupName = string.Empty; _currentOptionName = DefaultTexToolsData.DefaultOption; PluginLog.Log(" -> Importing Simple V2 ModPack"); _currentModDirectory = Mod.CreateModFolder(_baseDirectory, _currentModName); Mod.CreateMeta(_currentModDirectory, _currentModName, modList.Author, string.IsNullOrEmpty(modList.Description) ? "Mod imported from TexTools mod pack" : modList.Description, modList.Version, modList.Url); // Open the mod data file from the mod pack as a SqPackStream _streamDisposer = GetSqPackStreamStream(extractedModPack, "TTMPD.mpd"); ExtractSimpleModList(_currentModDirectory, modList.SimpleModsList); Mod.CreateDefaultFiles(_currentModDirectory); ResetStreamDisposer(); return(_currentModDirectory); }
private void ImportSimpleV2ModPack(ZipFile extractedModPack, SimpleModPack modList) { PluginLog.Log(" -> Importing Simple V2 ModPack"); // Create a new ModMeta from the TTMP modlist info var modMeta = new ModMeta { Author = modList.Author ?? "Unknown", Name = modList.Name ?? "New Mod", Description = string.IsNullOrEmpty(modList.Description) ? "Mod imported from TexTools mod pack" : modList.Description !, }; // Open the mod data file from the modpack as a SqPackStream using var modData = GetMagicSqPackDeleterStream(extractedModPack, "TTMPD.mpd"); var newModFolder = CreateModFolder(modList.Name ?? "New Mod"); File.WriteAllText(Path.Combine(newModFolder.FullName, "meta.json"), JsonConvert.SerializeObject(modMeta)); ExtractSimpleModList(newModFolder, modList.SimpleModsList ?? Enumerable.Empty <SimpleMod>(), modData); }