@@ -19,17 +19,19 @@ public sealed class ModGroupEditDrawer(
1919 Configuration config ,
2020 FilenameService filenames ,
2121 DescriptionEditPopup descriptionPopup ,
22- ImcChecker imcChecker ) : IUiService
22+ ImcChecker imcChecker ,
23+ ModGroupConditionDrawer conditionDrawer ) : IUiService
2324{
2425 private static ReadOnlySpan < byte > AcrossGroupsLabel
2526 => "##DragOptionAcross"u8 ;
2627
2728 private static ReadOnlySpan < byte > InsideGroupLabel
2829 => "##DragOptionInside"u8 ;
2930
30- internal readonly ImcChecker ImcChecker = imcChecker ;
31- internal readonly ModManager ModManager = modManager ;
32- internal readonly Queue < Action > ActionQueue = new ( ) ;
31+ internal readonly ModGroupConditionDrawer ConditionDrawer = conditionDrawer ;
32+ internal readonly ImcChecker ImcChecker = imcChecker ;
33+ internal readonly ModManager ModManager = modManager ;
34+ internal readonly Queue < Action > ActionQueue = new ( ) ;
3335
3436 internal Vector2 OptionIdxSelectable ;
3537 internal Vector2 AvailableWidth ;
@@ -82,6 +84,10 @@ private void DrawGroupNameRow(IModGroup group, int idx)
8284 Im . Line . SameInner ( ) ;
8385 DrawGroupDescription ( group ) ;
8486 Im . Line . SameInner ( ) ;
87+ DrawGroupLayout ( group ) ;
88+ Im . Line . SameInner ( ) ;
89+ DrawGroupConditions ( group ) ;
90+ Im . Line . SameInner ( ) ;
8591 DrawGroupDelete ( group ) ;
8692 Im . Line . SameInner ( ) ;
8793 DrawGroupPriority ( group ) ;
@@ -139,6 +145,21 @@ private void DrawGroupDescription(IModGroup group)
139145 descriptionPopup . Open ( group ) ;
140146 }
141147
148+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
149+ private void DrawGroupLayout ( IModGroup group )
150+ {
151+ if ( ImEx . Icon . Button ( LunaStyle . LayoutIcon , "Edit group layout settings."u8 ) )
152+ descriptionPopup . Open ( group ) ;
153+ }
154+
155+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
156+ private void DrawGroupConditions ( IModGroup group )
157+ {
158+ if ( ImEx . Icon . Button ( LunaStyle . ConditionIcon , "Edit group conditions."u8 ,
159+ textColor : group . Condition is not null ? LunaStyle . FavoriteColor : ColorParameter . Default ) )
160+ descriptionPopup . Open ( group ) ;
161+ }
162+
142163 private void DrawGroupMoveButtons ( IModGroup group , int idx )
143164 {
144165 var isFirst = idx is 0 ;
@@ -211,12 +232,37 @@ internal void DrawOptionDefaultMultiBehaviour(IModGroup group, IModOption option
211232 }
212233
213234 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
214- internal void DrawOptionDescription ( IModOption option )
235+ internal void DrawOptionButtons ( IModOption option )
236+ {
237+ DrawOptionDescription ( option ) ;
238+ Im . Line . SameInner ( ) ;
239+ DrawOptionLayout ( option ) ;
240+ Im . Line . SameInner ( ) ;
241+ DrawOptionConditions ( option ) ;
242+ }
243+
244+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
245+ private void DrawOptionDescription ( IModOption option )
215246 {
216247 if ( ImEx . Icon . Button ( LunaStyle . EditIcon , "Edit option description."u8 ) )
217248 descriptionPopup . Open ( option ) ;
218249 }
219250
251+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
252+ private void DrawOptionLayout ( IModOption option )
253+ {
254+ if ( ImEx . Icon . Button ( LunaStyle . LayoutIcon , "Edit option layout settings."u8 ) )
255+ descriptionPopup . Open ( option ) ;
256+ }
257+
258+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
259+ private void DrawOptionConditions ( IModOption option )
260+ {
261+ if ( ImEx . Icon . Button ( LunaStyle . ConditionIcon , "Edit option conditions."u8 ,
262+ textColor : option . Condition is not null ? LunaStyle . FavoriteColor : ColorParameter . Default ) )
263+ descriptionPopup . Open ( option ) ;
264+ }
265+
220266 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
221267 internal void DrawOptionPriority ( MultiSubMod option )
222268 {
@@ -332,11 +378,11 @@ private void PrepareStyle()
332378 var totalWidth = 400f * Im . Style . GlobalScale ;
333379 _buttonSize = new Vector2 ( Im . Style . FrameHeight ) ;
334380 PriorityWidth = 50 * Im . Style . GlobalScale ;
335- AvailableWidth = new Vector2 ( totalWidth + 3 * _spacing + 2 * _buttonSize . X + PriorityWidth , 0 ) ;
336- _groupNameWidth = totalWidth - 3 * ( _buttonSize . X + _spacing ) ;
381+ AvailableWidth = new Vector2 ( totalWidth + 5 * _spacing + 4 * _buttonSize . X + PriorityWidth , 0 ) ;
382+ _groupNameWidth = totalWidth - 5 * ( _buttonSize . X + _spacing ) ;
337383 _spacing = Im . Style . ItemInnerSpacing . X ;
338384 OptionIdxSelectable = Im . Font . CalculateSize ( "Option #88."u8 ) ;
339- _optionNameWidth = totalWidth - OptionIdxSelectable . X - _buttonSize . X - 2 * _spacing ;
385+ _optionNameWidth = totalWidth - OptionIdxSelectable . X - 3 * _buttonSize . X - 4 * _spacing ;
340386 _deleteEnabled = config . DeleteModModifier . IsActive ( ) ;
341387 }
342388}
0 commit comments