Skip to content

Commit

Permalink
Automatic merge of T1.5.1-1402-g5d79907e1 and 11 pull requests
Browse files Browse the repository at this point in the history
- Pull request #891 at 9a1d6b2: Auto save
- Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH
- Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes
- Pull request #961 at 8a9c8f9: Improvements for Power Supplies
- Pull request #981 at 10d297f: Multiple type trainset lightglows
- Pull request #995 at 992191c: Fix: TrainCarOperations and TrainOperationsViewer windows overlap.
- Pull request #996 at 2fcbcde: Replace dynamic brakes by engine brakes at low speeds
- Pull request #1004 at 1828d97: Bugfix/fix train car operations brakehoses not sync coupling cars
- Pull request #900 at c27f32d: DMI updates
- Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder
- Pull request #1003 at c734592: Clean up logging during loading
  • Loading branch information
openrails-bot committed Nov 27, 2024
13 parents 9fc2c14 + 5d79907 + 9a1d6b2 + 1f5ba4c + a519452 + 8a9c8f9 + 10d297f + 992191c + 2fcbcde + 1828d97 + c27f32d + f92de76 + c734592 commit 9b28377
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -492,15 +492,15 @@ public override void PrepareFrame(ElapsedTime elapsedTime, bool updateFull)
{
// Updates CarPosition
CarPosition = CouplerChanged ? NewCarPosition : CarPosition;

if (CabCameraEnabled)// Displays camera 1
{
CabCameraEnabled = false;
}
else if (OldCarPosition != CarPosition || (trainCarOperations.CarIdClicked && CarPosition == 0))
{
if (Owner.Viewer.FrontCamera.AttachedCar != null && Owner.Viewer.FrontCamera.IsCameraFront)
Owner.Viewer.FrontCamera.Activate();
Owner.Viewer.FrontCamera.Activate();

if (Owner.Viewer.BackCamera.AttachedCar != null && !Owner.Viewer.FrontCamera.IsCameraFront)
Owner.Viewer.BackCamera.Activate();
Expand Down Expand Up @@ -666,7 +666,7 @@ public buttonInitializeBrakes(int x, int y, int size, Viewer viewer, int carPosi
Viewer = viewer;
TrainCarViewer = Viewer.TrainCarOperationsViewerWindow;
WarningCars = warningCars;
Texture = WarningCars > 2 ? ResetBrakesOn : WarningCars > 0 && WarningCars < 3 ? ResetBrakesWarning : ResetBrakesOff;
Texture = WarningCars > 2 ? ResetBrakesOn : WarningCars == 0 ? ResetBrakesOff : ResetBrakesWarning;
Source = new Rectangle(0, 0, size, size);
Click += new Action<Control, Point>(buttonInitializeBrakes_Click);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,19 @@ private void fillStatusArrowLeft(int carPosition)
TrainCarSelected = true;
TrainCarSelectedPosition = Viewer.TrainCarOperationsWindow.SelectedCarPosition;
}
else
{
// select traincar on webpage when traincar operations window (F9) not visible
if (Viewer.Camera.AttachedCar != null && !(Viewer.Camera is CabCamera) && Viewer.Camera != Viewer.ThreeDimCabCamera)
{
var currentCameraCarID = Viewer.Camera.AttachedCar.CarID;
if (Viewer.PlayerTrain != null)
{
TrainCarSelected = true;
TrainCarSelectedPosition = Viewer.PlayerTrain.Cars.TakeWhile(x => x.CarID != currentCameraCarID).Count();
}
}
}

if (TrainCarSelected && (carPosition == TrainCarSelectedPosition))
{
Expand Down

0 comments on commit 9b28377

Please sign in to comment.