@@ -486,35 +486,38 @@ private void DrawEditWindow(int windowIndex)
486486 GUILayout . EndHorizontal ( ) ;
487487
488488 var entries = editableWindows [ _selectedWindowId ] . Entries . ToList ( ) ;
489- foreach ( var ( entry , index ) in entries . Select ( ( entry , index ) => ( entry , index ) ) )
489+ for ( int i = 0 ; i < entries . Count ; i ++ )
490490 {
491- GUILayout . BeginHorizontal ( ) ;
492- GUILayout . Label ( entry . Name , Styles . NameLabelStyle ) ;
493- GUI . enabled = entry . NumberOfDecimalDigits < 5 ;
494- if ( entry . Formatting != null && GUILayout . Button ( Styles . IncreaseDecimalDigitsTexture , Styles . OneCharacterBtnStyle ) )
491+ GUIStyle backgroundStyle = i == 0 ? Styles . EntryBackground_First : i < entries . Count - 1 ? Styles . EntryBackground_Middle : Styles . EntryBackground_Last ;
492+
493+ GUILayout . BeginHorizontal ( backgroundStyle ) ;
494+
495+ GUILayout . Label ( entries [ i ] . Name , Styles . NameLabelStyle ) ;
496+ GUI . enabled = entries [ i ] . NumberOfDecimalDigits < 5 ;
497+ if ( entries [ i ] . Formatting != null && GUILayout . Button ( Styles . IncreaseDecimalDigitsTexture , Styles . OneCharacterBtnStyle ) )
495498 {
496- entry . NumberOfDecimalDigits ++ ;
499+ entries [ i ] . NumberOfDecimalDigits ++ ;
497500 }
498- GUI . enabled = entry . NumberOfDecimalDigits > 0 ;
499- if ( entry . Formatting != null && GUILayout . Button ( Styles . DecreaseDecimalDigitsTexture , Styles . OneCharacterBtnStyle ) )
501+ GUI . enabled = entries [ i ] . NumberOfDecimalDigits > 0 ;
502+ if ( entries [ i ] . Formatting != null && GUILayout . Button ( Styles . DecreaseDecimalDigitsTexture , Styles . OneCharacterBtnStyle ) )
500503 {
501- entry . NumberOfDecimalDigits -- ;
504+ entries [ i ] . NumberOfDecimalDigits -- ;
502505 }
503- GUI . enabled = index > 0 ;
506+ GUI . enabled = i > 0 ;
504507 if ( GUILayout . Button ( "↑" , Styles . OneCharacterBtnStyle ) )
505508 {
506- editableWindows [ _selectedWindowId ] . MoveEntryUp ( index ) ;
509+ editableWindows [ _selectedWindowId ] . MoveEntryUp ( i ) ;
507510 }
508- GUI . enabled = index < editableWindows [ _selectedWindowId ] . Entries . Count - 1 ;
511+ GUI . enabled = i < editableWindows [ _selectedWindowId ] . Entries . Count - 1 ;
509512 if ( GUILayout . Button ( "↓" , Styles . OneCharacterBtnStyle ) )
510513 {
511- editableWindows [ _selectedWindowId ] . MoveEntryDown ( index ) ;
514+ editableWindows [ _selectedWindowId ] . MoveEntryDown ( i ) ;
512515 }
513516 GUI . enabled = true ;
514517 if ( GUILayout . Button ( "X" , Styles . OneCharacterBtnStyle ) )
515- editableWindows [ _selectedWindowId ] . RemoveEntry ( index ) ;
518+ editableWindows [ _selectedWindowId ] . RemoveEntry ( i ) ;
516519 GUILayout . EndHorizontal ( ) ;
517- GUILayout . Space ( Styles . NegativeSpacingAfterEntry ) ;
520+ GUILayout . Space ( - 4 ) ;
518521 }
519522 #endregion
520523
@@ -546,35 +549,37 @@ private void DrawEditWindow(int windowIndex)
546549 }
547550 GUILayout . EndHorizontal ( ) ;
548551
549- foreach ( var ( entry , index ) in entriesByCategory . Select ( ( entry , index ) => ( entry , index ) ) )
552+ for ( int i = 0 ; i < entriesByCategory . Count ; i ++ )
550553 {
551- GUILayout . BeginHorizontal ( ) ;
552- GUILayout . Label ( entry . Name , Styles . NameLabelStyle ) ;
554+ GUIStyle backgroundStyle = i == 0 ? Styles . EntryBackground_First : i < entriesByCategory . Count - 1 ? Styles . EntryBackground_Middle : Styles . EntryBackground_Last ;
555+
556+ GUILayout . BeginHorizontal ( backgroundStyle ) ;
557+ GUILayout . Label ( entriesByCategory [ i ] . Name , Styles . NameLabelStyle ) ;
553558 if ( GUILayout . Button ( "?" , Styles . OneCharacterBtnStyle ) )
554559 {
555560 if ( ! _showTooltip . condition )
556- _showTooltip = ( true , index ) ;
561+ _showTooltip = ( true , i ) ;
557562 else
558563 {
559- if ( _showTooltip . index != index )
560- _showTooltip = ( true , index ) ;
564+ if ( _showTooltip . index != i )
565+ _showTooltip = ( true , i ) ;
561566 else
562- _showTooltip = ( false , index ) ;
567+ _showTooltip = ( false , i ) ;
563568 }
564569 }
565570 if ( GUILayout . Button ( "+" , Styles . OneCharacterBtnStyle ) )
566571 {
567- editableWindows [ _selectedWindowId ] . AddEntry ( entry ) ;
572+ editableWindows [ _selectedWindowId ] . AddEntry ( entriesByCategory [ i ] ) ;
568573 }
569574 GUILayout . EndHorizontal ( ) ;
570575
571- if ( _showTooltip . condition && _showTooltip . index == index )
576+ if ( _showTooltip . condition && _showTooltip . index == i )
572577 {
573578 GUILayout . BeginHorizontal ( ) ;
574- GUILayout . Label ( entry . Description , Styles . BlueLabelStyle ) ;
579+ GUILayout . Label ( entriesByCategory [ i ] . Description , Styles . BlueLabelStyle ) ;
575580 GUILayout . EndHorizontal ( ) ;
576581 }
577- GUILayout . Space ( Styles . NegativeSpacingAfterEntry ) ;
582+ GUILayout . Space ( Styles . NegativeSpacingAfterEntry + 7 ) ;
578583 }
579584 GUILayout . Space ( 10 ) ;
580585 #endregion
0 commit comments