Skip to content

Commit 78adf32

Browse files
committed
Automatic merge of T1.5.1-719-g89833d44e and 17 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 #882 at be39fc9: 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 - Pull request #886 at cd452ee: Scene viewer extension to TrackViewer - Pull request #888 at d7daf62: docs: Document player application model - Pull request #890 at 39a9fa4: Allow depart early - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #893 at bf8876b: Signal errors - Pull request #894 at 794fddf: Correct Decrease Colour - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #897 at 64a29c8: feat: Improved system information collection
19 parents 6d117d0 + 89833d4 + c59c788 + d00beb9 + 67014b7 + f8dbeab + 43bf33e + f92de76 + be39fc9 + edcc2dd + c81447b + cd452ee + d7daf62 + 39a9fa4 + 1f5ba4c + bf8876b + 794fddf + 5866028 + 64a29c8 commit 78adf32

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

Source/RunActivity/Viewer3D/Popups/TrainCarOperationsWindow.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ public class TrainCarOperationsWindow : Window
9696
public bool IsFullScreen = false;
9797
public int RowHeight;
9898
public int OldPositionHeight;
99+
public bool UpdateTrainCarOperation = false;
100+
public List<int> LabelPositionTop = new List<int>();
99101

100102
//Rectangle carLabelPosition;
101103
public string CarLabelText;
@@ -345,6 +347,16 @@ void AddSpace()
345347
RearBrakes = Enumerable.Repeat(true, PlayerTrain.Cars.Count).ToList();
346348
}
347349

350+
if (LabelPositionTop.Count == 0)
351+
{
352+
var n = scrollbox.Position.Y;// first row
353+
for (var i = 0; i < PlayerTrain.Cars.Count; i++)
354+
{ // Position of each row
355+
LabelPositionTop.Add(n);
356+
n += (textHeight + ControlLayout.SeparatorSize);
357+
}
358+
}
359+
348360
// reset WarningCarPosition
349361
WarningCarPosition = Enumerable.Repeat(false, PlayerTrain.Cars.Count).ToList();
350362

@@ -603,6 +615,15 @@ public override void PrepareFrame(ElapsedTime elapsedTime, bool updateFull)
603615
carOperations.CarOperationChanged = carOperations.Visible && carOperations.CarOperationChanged;
604616
}
605617

618+
if (CarPosition != trainCarViewer.CarPosition)
619+
{
620+
// Required to scroll the main window from the web version
621+
UpdateTrainCarOperation = true;
622+
CarPosition = trainCarViewer.CarPosition;
623+
LabelTop = LabelPositionTop[SelectedCarPosition];
624+
Layout();
625+
localScrollLayout(SelectedCarPosition);
626+
}
606627
//Resize this window after the font has been changed externally
607628
else if (MultiPlayerWindow.FontChanged)
608629
{

0 commit comments

Comments
 (0)