@@ -53,7 +53,7 @@ public struct ListLabel
5353 {
5454 Viewer . Catalog . GetString ( "BP" ) ,
5555 Viewer . Catalog . GetString ( "EQ" ) ,
56- Viewer . Catalog . GetString ( "V" )
56+ Viewer . Catalog . GetParticularString ( "BrakeStatus" , "V" )
5757 } ;
5858
5959 /// <summary>
@@ -298,15 +298,17 @@ protected override ControlLayout Layout(ControlLayout layout)
298298 var vbox = base . Layout ( layout ) . AddLayoutVertical ( ) ;
299299 if ( labels . Count > 0 )
300300 {
301- var colWidth = labels . Max ( x => x . FirstColWidth ) + ( normalTextMode ? 15 : 20 ) ;
301+ var colWidth = labels . Max ( x => x . FirstColWidth ) + ( normalTextMode ? 15 : 20 ) ;
302302 var TimeHboxPositionY = 0 ;
303303
304304 // search wider
305305 var tokenOffset = 0 ;
306306 var tokenWidth = 0 ;
307307 foreach ( var data in tokens . Where ( ( string d ) => ! string . IsNullOrWhiteSpace ( d ) ) )
308308 {
309- tokenWidth = Owner . TextFontDefault . MeasureString ( data ) ;
309+ // Allows alignment of columns
310+ var dataFormated = data . Length > 3 ? data . Substring ( 0 , 3 ) : data ;
311+ tokenWidth = Owner . TextFontDefault . MeasureString ( dataFormated ) ;
310312 tokenOffset = tokenWidth > tokenOffset ? tokenWidth : tokenOffset ;
311313 }
312314
@@ -536,7 +538,7 @@ private void UpdateColsWidth(ListLabel label, bool normalmode)
536538 {
537539 var tempFirstCol = firstCol . Substring ( 0 , firstCol . Length - 3 ) ;
538540 firstColWidth = FontToBold ? Owner . TextFontDefaultBold . MeasureString ( tempFirstCol . TrimEnd ( ) )
539- : ! normalTextMode ? Owner . TextFontMonoSpacedBold . MeasureString ( tempFirstCol . TrimEnd ( ) )
541+ : ! normalTextMode ? Owner . TextFontMonoSpacedBold . MeasureString ( tempFirstCol . TrimEnd ( ) )
540542 : Owner . TextFontDefault . MeasureString ( tempFirstCol . TrimEnd ( ) ) ;
541543 }
542544 else
@@ -791,7 +793,7 @@ void AddSeparator() => AddLabel(new ListLabel
791793 // Booster engine label
792794 if ( locomotive is MSTSSteamLocomotive steamLocomotive4 )
793795 {
794- string boosterEngineIndicator = "" , boosterEngineKey = "" ;
796+ string boosterEngineIndicator = "" , boosterEngineKey = "" ;
795797 if ( BoosterLocked )
796798 {
797799 boosterLabelVisible = true ;
@@ -882,8 +884,8 @@ void AddSeparator() => AddLabel(new ListLabel
882884 } ) ;
883885
884886 index = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "EQ" ) ) ;
885- if ( trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "V" ) , index ) > 0 )
886- brakeInfoValue = trainBrakeStatus . Substring ( index , trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "V" ) , index ) - index ) . TrimEnd ( ) ;
887+ if ( trainBrakeStatus . IndexOf ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "V" ) , index ) > 0 )
888+ brakeInfoValue = trainBrakeStatus . Substring ( index , trainBrakeStatus . IndexOf ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "V" ) , index ) - index ) . TrimEnd ( ) ;
887889 else
888890 brakeInfoValue = trainBrakeStatus . Substring ( index , trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "BC" ) ) - index ) . TrimEnd ( ) ;
889891
@@ -893,21 +895,21 @@ void AddSeparator() => AddLabel(new ListLabel
893895 } ) ;
894896
895897 int endIndex ;
896- if ( trainBrakeStatus . Contains ( Viewer . Catalog . GetString ( "Flow" ) ) )
898+ if ( trainBrakeStatus . Contains ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "Flow" ) ) )
897899 {
898- endIndex = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "Flow" ) ) ;
900+ endIndex = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "Flow" ) ) ;
899901 }
900- else if ( trainBrakeStatus . Contains ( Viewer . Catalog . GetString ( "EOT" ) ) )
902+ else if ( trainBrakeStatus . Contains ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "EOT" ) ) )
901903 {
902- endIndex = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "EOT" ) ) ;
904+ endIndex = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "EOT" ) ) ;
903905 }
904906 else
905907 {
906908 endIndex = trainBrakeStatus . Length ;
907909 }
908910
909- if ( trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "V" ) , index ) > 0 )
910- index = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "V" ) , index ) ;
911+ if ( trainBrakeStatus . IndexOf ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "V" ) , index ) > 0 )
912+ index = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "V" ) , index ) ;
911913 else
912914 index = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "BC" ) ) ;
913915
@@ -916,13 +918,13 @@ void AddSeparator() => AddLabel(new ListLabel
916918 {
917919 LastCol = brakeInfoValue ,
918920 } ) ;
919-
920- if ( trainBrakeStatus . Contains ( Viewer . Catalog . GetString ( "Flow" ) ) )
921+
922+ if ( trainBrakeStatus . Contains ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "Flow" ) ) )
921923 {
922924 index = endIndex ;
923925
924- if ( trainBrakeStatus . Contains ( Viewer . Catalog . GetString ( "EOT" ) ) )
925- endIndex = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "EOT" ) ) ;
926+ if ( trainBrakeStatus . Contains ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "EOT" ) ) )
927+ endIndex = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "EOT" ) ) ;
926928 else
927929 endIndex = trainBrakeStatus . Length ;
928930
@@ -933,11 +935,11 @@ void AddSeparator() => AddLabel(new ListLabel
933935 } ) ;
934936 }
935937
936- if ( trainBrakeStatus . Contains ( Viewer . Catalog . GetString ( "EOT" ) ) )
938+ if ( trainBrakeStatus . Contains ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "EOT" ) ) )
937939 {
938- int indexOffset = Viewer . Catalog . GetString ( "EOT" ) . Length + 1 ;
940+ int indexOffset = Viewer . Catalog . GetParticularString ( "BrakeStatus" , "EOT" ) . Length + 1 ;
939941
940- index = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "EOT" ) ) + indexOffset ;
942+ index = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "EOT" ) ) + indexOffset ;
941943 brakeInfoValue = trainBrakeStatus . Substring ( index , trainBrakeStatus . Length - index ) . TrimStart ( ) ;
942944 AddLabel ( new ListLabel
943945 {
@@ -956,15 +958,15 @@ void AddSeparator() => AddLabel(new ListLabel
956958 } ) ;
957959
958960 index = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "Lead" ) ) + indexOffset ;
959- if ( trainBrakeStatus . Contains ( Viewer . Catalog . GetString ( "EOT" ) ) )
961+ if ( trainBrakeStatus . Contains ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "EOT" ) ) )
960962 {
961- brakeInfoValue = trainBrakeStatus . Substring ( index , trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "EOT" ) ) - index ) . TrimEnd ( ) ;
963+ brakeInfoValue = trainBrakeStatus . Substring ( index , trainBrakeStatus . IndexOf ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "EOT" ) ) - index ) . TrimEnd ( ) ;
962964 AddLabel ( new ListLabel
963965 {
964966 LastCol = brakeInfoValue ,
965967 } ) ;
966968
967- index = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "EOT" ) ) + indexOffset ;
969+ index = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetParticularString ( "BrakeStatus" , "EOT" ) ) + indexOffset ;
968970 brakeInfoValue = trainBrakeStatus . Substring ( index , trainBrakeStatus . Length - index ) . TrimEnd ( ) ;
969971 AddLabel ( new ListLabel
970972 {
@@ -1292,7 +1294,7 @@ void AddSeparator() => AddLabel(new ListLabel
12921294 boosterIdleValveKey = Symbols . ArrowToRight + ColorCode [ Color . Yellow ] ;
12931295 }
12941296 // When shut off the booster system and the air open valve is closed, we set the idle valve from the run position to idle.
1295- if ( steamLocomotive6 . SteamBoosterIdle && ! steamLocomotive6 . SteamBoosterAirOpen )
1297+ if ( steamLocomotive6 . SteamBoosterIdle && ! steamLocomotive6 . SteamBoosterAirOpen )
12961298 {
12971299 steamLocomotive6 . ToggleSteamBoosterIdle ( ) ; // set to idle
12981300 boosterIdleValveIndicator = Viewer . Catalog . GetString ( "Idle" ) + ColorCode [ Color . White ] ;
@@ -1326,7 +1328,7 @@ void AddSeparator() => AddLabel(new ListLabel
13261328 KeyPressed = boosterLatchOnKey ,
13271329 SymbolCol = ""
13281330 } ) ;
1329- AddSeparator ( ) ;
1331+ AddSeparator ( ) ;
13301332 }
13311333 }
13321334
@@ -1363,7 +1365,7 @@ void AddSeparator() => AddLabel(new ListLabel
13631365 {
13641366 AddLabel ( new ListLabel
13651367 {
1366- FirstCol = Viewer . Catalog . GetString ( "EOT" ) ,
1368+ FirstCol = Viewer . Catalog . GetParticularString ( "BrakeStatus" , "EOT" ) ,
13671369 LastCol = $ "{ locomotive . Train . EOT ? . EOTState . ToString ( ) } "
13681370 } ) ;
13691371 AddSeparator ( ) ;
0 commit comments