Let options keep visual ordering.

This commit is contained in:
Ottermandias 2022-04-30 23:04:39 +02:00
parent f24ec8ebe2
commit 81e93e0664
9 changed files with 105 additions and 28 deletions

View file

@ -59,7 +59,7 @@ public partial class Mod
// Create a file for an option group from given data.
internal static void CreateOptionGroup( DirectoryInfo baseFolder, ModGroup groupData,
int priority, string desc, IEnumerable< ISubMod > subMods )
int priority, int index, string desc, IEnumerable< ISubMod > subMods )
{
switch( groupData.SelectionType )
{
@ -72,7 +72,7 @@ public partial class Mod
Priority = priority,
};
group.PrioritizedOptions.AddRange( subMods.OfType< SubMod >().Select( ( s, idx ) => ( s, idx ) ) );
IModGroup.SaveModGroup( group, baseFolder );
IModGroup.SaveModGroup( group, baseFolder, index );
break;
}
case SelectType.Single:
@ -84,7 +84,7 @@ public partial class Mod
Priority = priority,
};
group.OptionData.AddRange( subMods.OfType< SubMod >() );
IModGroup.SaveModGroup( group, baseFolder );
IModGroup.SaveModGroup( group, baseFolder, index );
break;
}
}