Skip to content

Commit 393773e

Browse files
committed
Automatic merge of T1.5.1-1808-gf2bc634a3 and 13 pull requests
- Pull request #570 at 362e4e7: glTF 2.0 support with PBR lighting - Pull request #1062 at 9a76b26: Train Forces popup Window. - Pull request #1064 at 1be1fc4: Add Train Info tab to Help window (F1) - Pull request #1067 at b471b7c: Traction and dynamic brake retardation - Pull request #1084 at 13454ed: Timetable: Calculate Delay While Stopped at a Station - Pull request #1074 at e9a66c1: Gradient - commit 2024-16-12 - Pull request #1085 at 37e2817: updates key commands for Train Operations window and also Daylight Offset - Pull request #1086 at e10390b: Add Settings Exporter tool (copy settings to INI, etc) - Pull request #1087 at 1f64f02: Improve warning message for signal location mismatch. - Pull request #1088 at 4b3fa4c: Preserve previous log file. - Pull request #1089 at d750bd1: Fix Superelevation on Rigid Frame Rolling Stock Again - Pull request #1082 at 5845a1a: Allow variable water level in glass gauge - Pull request #1081 at 689494b: Brake cuts power unification
15 parents 3b124a9 + f2bc634 + 362e4e7 + 9a76b26 + 1be1fc4 + b471b7c + 13454ed + e9a66c1 + 37e2817 + e10390b + 1f64f02 + 4b3fa4c + d750bd1 + 5845a1a + 689494b commit 393773e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Source/RunActivity/Viewer3D/Popups/TrainForcesWindow.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)