@@ -34,8 +34,6 @@ public enum ModOptionChangeType
34
34
35
35
public class ModOptionEditor ( CommunicatorService communicator , SaveService saveService , Configuration config )
36
36
{
37
-
38
-
39
37
/// <summary> Change the type of a group given by mod and index to type, if possible. </summary>
40
38
public void ChangeModGroupType ( Mod mod , int groupIdx , GroupType type )
41
39
{
@@ -86,7 +84,7 @@ public void AddModGroup(Mod mod, GroupType type, string newName, SaveType saveTy
86
84
if ( ! VerifyFileName ( mod , null , newName , true ) )
87
85
return ;
88
86
89
- var maxPriority = mod . Groups . Count == 0 ? 0 : mod . Groups . Max ( o => o . Priority ) + 1 ;
87
+ var maxPriority = mod . Groups . Count == 0 ? ModPriority . Default : mod . Groups . Max ( o => o . Priority ) + 1 ;
90
88
91
89
mod . Groups . Add ( type == GroupType . Multi
92
90
? new MultiModGroup
@@ -169,7 +167,7 @@ public void ChangeOptionDescription(Mod mod, int groupIdx, int optionIdx, string
169
167
}
170
168
171
169
/// <summary> Change the internal priority of the given option group. </summary>
172
- public void ChangeGroupPriority ( Mod mod , int groupIdx , int newPriority )
170
+ public void ChangeGroupPriority ( Mod mod , int groupIdx , ModPriority newPriority )
173
171
{
174
172
var group = mod . Groups [ groupIdx ] ;
175
173
if ( group . Priority == newPriority )
@@ -186,7 +184,7 @@ public void ChangeGroupPriority(Mod mod, int groupIdx, int newPriority)
186
184
}
187
185
188
186
/// <summary> Change the internal priority of the given option. </summary>
189
- public void ChangeOptionPriority ( Mod mod , int groupIdx , int optionIdx , int newPriority )
187
+ public void ChangeOptionPriority ( Mod mod , int groupIdx , int optionIdx , ModPriority newPriority )
190
188
{
191
189
switch ( mod . Groups [ groupIdx ] )
192
190
{
@@ -240,7 +238,7 @@ public void AddOption(Mod mod, int groupIdx, string newName, SaveType saveType =
240
238
s . OptionData . Add ( subMod ) ;
241
239
break ;
242
240
case MultiModGroup m :
243
- m . PrioritizedOptions . Add ( ( subMod , 0 ) ) ;
241
+ m . PrioritizedOptions . Add ( ( subMod , ModPriority . Default ) ) ;
244
242
break ;
245
243
}
246
244
@@ -263,8 +261,12 @@ public void AddOption(Mod mod, int groupIdx, string newName, SaveType saveType =
263
261
return ( ( SubMod ) group [ ^ 1 ] , true ) ;
264
262
}
265
263
266
- /// <summary> Add an existing option to a given group with a given priority. </summary>
267
- public void AddOption ( Mod mod , int groupIdx , ISubMod option , int priority = 0 )
264
+ /// <summary> Add an existing option to a given group with default priority. </summary>
265
+ public void AddOption ( Mod mod , int groupIdx , ISubMod option )
266
+ => AddOption ( mod , groupIdx , option , ModPriority . Default ) ;
267
+
268
+ /// <summary> Add an existing option to a given group with a given priority. </summary>
269
+ public void AddOption ( Mod mod , int groupIdx , ISubMod option , ModPriority priority )
268
270
{
269
271
if ( option is not SubMod o )
270
272
return ;
0 commit comments