mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-01-02 13:53:42 +01:00
Add empty option for single select groups with empty options. More Editor stuff.
This commit is contained in:
parent
81e93e0664
commit
e2a6274b33
21 changed files with 937 additions and 336 deletions
|
|
@ -109,7 +109,8 @@ public partial class TexToolsImporter
|
|||
.Sum( page => page.ModGroups
|
||||
.Where( g => g.GroupName.Length > 0 && g.OptionList.Length > 0 )
|
||||
.Sum( group => group.OptionList
|
||||
.Count( o => o.Name.Length > 0 && o.ModsJsons.Length > 0 ) ) );
|
||||
.Count( o => o.Name.Length > 0 && o.ModsJsons.Length > 0 )
|
||||
+ ( group.OptionList.Any( o => o.Name.Length > 0 && o.ModsJsons.Length == 0 ) ? 1 : 0 ) ) );
|
||||
|
||||
// Extended V2 mod packs contain multiple options that need to be handled separately.
|
||||
private DirectoryInfo ImportExtendedV2ModPack( ZipFile extractedModPack, string modRaw )
|
||||
|
|
@ -173,6 +174,18 @@ public partial class TexToolsImporter
|
|||
++_currentOptionIdx;
|
||||
}
|
||||
|
||||
// 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.
|
||||
if( group.SelectionType == SelectType.Single )
|
||||
{
|
||||
var empty = group.OptionList.FirstOrDefault( o => o.Name.Length > 0 && o.ModsJsons.Length == 0 );
|
||||
if( empty != null )
|
||||
{
|
||||
_currentOptionName = empty.Name;
|
||||
options.Insert( 0, Mod.CreateEmptySubMod( empty.Name ) );
|
||||
}
|
||||
}
|
||||
|
||||
Mod.CreateOptionGroup( _currentModDirectory, group, groupPriority, groupPriority, description.ToString(), options );
|
||||
++groupPriority;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue