Skip to content

Commit f870e00

Browse files
committed
Automatic merge of T1.5.1-687-gd279e384a and 10 pull requests
- Pull request #570 at c59c788: Experimental glTF 2.0 support with PBR lighting - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #865 at 67014b7: Dispatcher window improvements - Pull request #874 at f8dbeab: Dynamic brake controller refactoring - Pull request #875 at 43bf33e: Bug fix for https://bugs.launchpad.net/or/+bug/2036346 Player train switching doesn't work with 3D cabs - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #878 at da8978d: Implement Polach Adhesion - Pull request #882 at d8a1c4d: Blueprint/train car operations UI window - Pull request #883 at edcc2dd: SwitchPanel disconnect/connect handling - Pull request #885 at c81447b: feat: Add notifications to Menu
12 parents bcb149e + d279e38 + c59c788 + d00beb9 + 67014b7 + f8dbeab + 43bf33e + f92de76 + da8978d + d8a1c4d + edcc2dd + c81447b commit f870e00

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

Source/RunActivity/Viewer3D/Popups/TrainCarOperationsViewerWindow.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ private void ModifyWindowSize()
226226
if (SymbolsRowCount > 0)
227227
{
228228
var desiredHeight = FontToBold ? Owner.TextFontDefaultBold.Height * RowsCount
229-
: Owner.TextFontDefault.Height * RowsCount + SymbolWidth;
229+
: (Owner.TextFontDefault.Height * RowsCount) + SymbolWidth;
230230
var desiredWidth = (SymbolsRowCount * SymbolWidth) + (SpacerRowCount * (SymbolWidth / 2)) + (LocoRowCount * (SymbolWidth * 2));
231231

232232
var newHeight = (int)MathHelper.Clamp(desiredHeight, 80, WindowHeightMax);
@@ -406,8 +406,8 @@ public override void PrepareFrame(ElapsedTime elapsedTime, bool updateFull)
406406
// Updates power supply status
407407
else if (isElectricDieselLocomotive &&
408408
(PowerSupplyStatus != null && PowerSupplyStatus != Owner.Viewer.PlayerTrain.Cars[CarPosition].GetStatus()
409-
|| BatteryStatus != null && BatteryStatus != Owner.Viewer.PlayerTrain.Cars[CarPosition].GetStatus()
410-
|| CircuitBreakerState != null && CircuitBreakerState != (trainCar as MSTSElectricLocomotive).ElectricPowerSupply.CircuitBreaker.State.ToString()))
409+
|| (BatteryStatus != null && BatteryStatus != Owner.Viewer.PlayerTrain.Cars[CarPosition].GetStatus())
410+
|| (CircuitBreakerState != null && CircuitBreakerState != (trainCar as MSTSElectricLocomotive).ElectricPowerSupply.CircuitBreaker.State.ToString())))
411411
{
412412
Layout();
413413
UpdateWindowSize();
@@ -549,8 +549,6 @@ void buttonHandBrake_Click(Control arg1, Point arg2)
549549
if ((Viewer.PlayerTrain.Cars[CarPosition] as MSTSWagon).GetTrainHandbrakeStatus())
550550
{
551551
Viewer.Simulator.Confirmer.Information(Viewer.Catalog.GetString("Handbrake set"));
552-
553-
554552
Texture = HandBrakeSet;
555553
}
556554
else
@@ -849,7 +847,7 @@ public buttonToggleMU(int x, int y, int size, Viewer viewer, int carPosition)
849847
var multipleUnitsConfiguration = Viewer.PlayerLocomotive.GetMultipleUnitsConfiguration();
850848
if (Viewer.PlayerTrain.Cars[CarPosition] is MSTSDieselLocomotive && multipleUnitsConfiguration != null)
851849
{
852-
Texture = Viewer.TrainCarOperationsWindow.ModifiedSetting || (Viewer.PlayerTrain.Cars[CarPosition] as MSTSLocomotive).RemoteControlGroup == 0 && multipleUnitsConfiguration != "1" ? MUconnected : MUdisconnected;
850+
Texture = Viewer.TrainCarOperationsWindow.ModifiedSetting || ((Viewer.PlayerTrain.Cars[CarPosition] as MSTSLocomotive).RemoteControlGroup == 0 && multipleUnitsConfiguration != "1")? MUconnected : MUdisconnected;
853851
}
854852
else
855853
{

Source/RunActivity/Viewer3D/Popups/TrainCarOperationsWindow.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ public class TrainCarOperationsWindow : Window
7070
internal static Texture2D RearAngleCockClosed;
7171
internal static Texture2D RearAngleCockOpened;
7272

73-
7473
public int DisplaySizeY;
7574
public bool LayoutUpdated = false;
7675
public bool AllSymbolsMode = true;
@@ -266,7 +265,7 @@ private void ModifyWindowSize()
266265

267266
DesiredHeight = FontToBold ? (Owner.TextFontDefaultBold.Height * (RowsCount + 1)) + (separatorSize * (SeparatorCount + 3))
268267
: (Owner.TextFontDefault.Height * (RowsCount + 1)) + (separatorSize * (SeparatorCount + 3));
269-
var desiredWidth = (SymbolsRowCount * SymbolSize) + (SpacerRowCount * (textWidth / 2)) + CarUIDLenght + textWidth * 2;
268+
var desiredWidth = (SymbolsRowCount * SymbolSize) + (SpacerRowCount * (textWidth / 2)) + CarUIDLenght + (textWidth * 2);
270269

271270
// Takes the height of the TrainOperationsViewer as the margin area.
272271
RowHeight = textWidth + separatorSize;
@@ -277,7 +276,7 @@ private void ModifyWindowSize()
277276
: marginTraincarViewer;
278277
WindowHeightMax = DisplaySizeY - marginTraincarViewer;
279278

280-
var newHeight = MathHelper.Clamp(DesiredHeight, (textWidth + separatorSize) * 3 + separatorSize, WindowHeightMax);
279+
var newHeight = MathHelper.Clamp(DesiredHeight, ((textWidth + separatorSize) * 3) + separatorSize, WindowHeightMax);
281280
var newWidth = MathHelper.Clamp(desiredWidth, 100, WindowWidthMax);
282281

283282
// Move the dialog up if we're expanding it, or down if not; this keeps the center in the same place.
@@ -936,7 +935,6 @@ public Texture2D LocomotiveStatus(int CarPosition)
936935
string valuePart = parts?[1];
937936
if (keyPart.Contains(Viewer.Catalog.GetString("Engine")))
938937
{
939-
940938
TrainCarOperations.PowerSupplyStatus = locomotiveStatus;
941939

942940
Texture = valuePart.Contains(Viewer.Catalog.GetString("Running")) ? PowerOn

0 commit comments

Comments
 (0)