diff --git a/Penumbra/Import/TexToolsImporter.ModPack.cs b/Penumbra/Import/TexToolsImporter.ModPack.cs index 94a5e5ac..7c4b94d8 100644 --- a/Penumbra/Import/TexToolsImporter.ModPack.cs +++ b/Penumbra/Import/TexToolsImporter.ModPack.cs @@ -1,4 +1,5 @@ using Newtonsoft.Json; +using OtterGui; using Penumbra.Api.Enums; using Penumbra.Import.Structs; using Penumbra.Mods; @@ -35,7 +36,8 @@ public partial class TexToolsImporter var modList = modListRaw.Select(m => JsonConvert.DeserializeObject(m, JsonSettings)!).ToList(); - _currentModDirectory = ModCreator.CreateModFolder(_baseDirectory, Path.GetFileNameWithoutExtension(modPackFile.Name), _config.ReplaceNonAsciiOnImport, true); + _currentModDirectory = ModCreator.CreateModFolder(_baseDirectory, Path.GetFileNameWithoutExtension(modPackFile.Name), + _config.ReplaceNonAsciiOnImport, true); // Create a new ModMeta from the TTMP mod list info _modManager.DataEditor.CreateMeta(_currentModDirectory, _currentModName, DefaultTexToolsData.Author, DefaultTexToolsData.Description, null, null); @@ -193,15 +195,17 @@ public partial class TexToolsImporter optionIdx += maxOptions; // Handle empty options for single select groups without creating a folder for them. - // We only want one of those at most, and it should usually be the first option. + // We only want one of those at most. if (group.SelectionType == GroupType.Single) { - var empty = group.OptionList.FirstOrDefault(o => o.Name.Length > 0 && o.ModsJsons.Length == 0); - if (empty != null) + var idx = group.OptionList.IndexOf(o => o.Name.Length > 0 && o.ModsJsons.Length == 0); + if (idx >= 0) { - _currentOptionName = empty.Name; - options.Insert(0, ModCreator.CreateEmptySubMod(empty.Name)); - defaultSettings = defaultSettings == null ? 0 : defaultSettings.Value + 1; + var option = group.OptionList[idx]; + _currentOptionName = option.Name; + options.Insert(idx, ModCreator.CreateEmptySubMod(option.Name)); + if (option.IsChecked) + defaultSettings = (uint) idx; } }