@@ -118,6 +118,7 @@ public class TrainForcesWindow : Window
118118 private readonly int WindowWidthMin ;
119119 private readonly int WindowWidthMax ;
120120
121+ private bool IsMetric ;
121122
122123 /// <summary>
123124 /// Constructor. Initial window is wide enough for the two current forces in the
@@ -188,6 +189,7 @@ protected override ControlLayout Layout(ControlLayout layout)
188189
189190 if ( PlayerTrain != null )
190191 {
192+ if ( PlayerTrain . LeadLocomotive != null ) { IsMetric = PlayerTrain . LeadLocomotive . IsMetric ; }
191193 SetConsistProperties ( PlayerTrain ) ;
192194
193195 CouplerForceBarGraph = new Image [ PlayerTrain . Cars . Count ] ;
@@ -216,14 +218,14 @@ protected override ControlLayout Layout(ControlLayout layout)
216218 var textLine = vbox . AddLayoutHorizontalLineOfText ( ) ;
217219
218220 textLine . Add ( new Label ( TextHight * 9 , TextHight , Viewer . Catalog . GetString ( "Max Coupler" ) + ": " , LabelAlignment . Right ) ) ;
219- textLine . Add ( MaxCouplerForceForTextBox = new Label ( TextHight * 7 , TextHight , FormatStrings . FormatLargeForce ( 0f , false ) , LabelAlignment . Right ) ) ;
221+ textLine . Add ( MaxCouplerForceForTextBox = new Label ( TextHight * 7 , TextHight , FormatStrings . FormatLargeForce ( 0f , IsMetric ) , LabelAlignment . Right ) ) ;
220222 textLine . Add ( new Label ( TextHight * 9 , TextHight , Viewer . Catalog . GetString ( "Max Derail" ) + ": " , LabelAlignment . Right ) ) ;
221- textLine . Add ( MaxDerailForceForTextBox = new Label ( TextHight * 7 , TextHight , FormatStrings . FormatLargeForce ( 0f , false ) , LabelAlignment . Right ) ) ;
223+ textLine . Add ( MaxDerailForceForTextBox = new Label ( TextHight * 7 , TextHight , FormatStrings . FormatLargeForce ( 0f , IsMetric ) , LabelAlignment . Right ) ) ;
222224
223225 textLine . Add ( new Label ( TextHight * 8 , TextHight , Viewer . Catalog . GetString ( "Low Coupler" ) + ": " , LabelAlignment . Right ) ) ;
224- textLine . Add ( new Label ( TextHight * 5 , TextHight , FormatStrings . FormatLargeForce ( LimitForCouplerStrengthN , false ) , LabelAlignment . Right ) ) ;
226+ textLine . Add ( new Label ( TextHight * 5 , TextHight , FormatStrings . FormatLargeForce ( LimitForCouplerStrengthN , IsMetric ) , LabelAlignment . Right ) ) ;
225227 textLine . Add ( new Label ( TextHight * 8 , TextHight , Viewer . Catalog . GetString ( "Low Derail" ) + ": " , LabelAlignment . Right ) ) ;
226- textLine . Add ( new Label ( TextHight * 5 , TextHight , FormatStrings . FormatLargeForce ( LimitForDerailForceN , false ) , LabelAlignment . Right ) ) ;
228+ textLine . Add ( new Label ( TextHight * 5 , TextHight , FormatStrings . FormatLargeForce ( LimitForDerailForceN , IsMetric ) , LabelAlignment . Right ) ) ;
227229
228230 // no text for brake force
229231 }
@@ -293,13 +295,13 @@ public override void PrepareFrame(ElapsedTime elapsedTime, bool updateFull)
293295 if ( MaxCouplerForceForTextBox != null )
294296 {
295297 // TODO: smooth the downslope
296- MaxCouplerForceForTextBox . Text = FormatStrings . FormatLargeForce ( absMaxCouplerForceN * couplerForceSign , false ) +
298+ MaxCouplerForceForTextBox . Text = FormatStrings . FormatLargeForce ( absMaxCouplerForceN * couplerForceSign , IsMetric ) +
297299 string . Format ( " ({0,3})" , maxCouplerForceCarNum ) ;
298300 }
299301
300302 if ( MaxDerailForceForTextBox != null )
301303 {
302- MaxDerailForceForTextBox . Text = FormatStrings . FormatLargeForce ( absMaxDerailForceN * derailForceSign , false ) +
304+ MaxDerailForceForTextBox . Text = FormatStrings . FormatLargeForce ( absMaxDerailForceN * derailForceSign , IsMetric ) +
303305 string . Format ( " ({0,3})" , maxDerailForceCarNum ) ;
304306 }
305307 }
0 commit comments