Skip to content

Commit 8d69a73

Browse files
committed
Automatic merge of T1.5.1-689-g9d41208f0 and 19 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 855d0e2: Implement Polach Adhesion - Pull request #882 at 8c8c938: 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 228f0f0: Scene viewer extension to TrackViewer - Pull request #888 at d7daf62: docs: Document player application model - Pull request #889 at 43341cf: No speed update - 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
21 parents fc3aa16 + 9d41208 + c59c788 + d00beb9 + 67014b7 + f8dbeab + 43bf33e + f92de76 + 855d0e2 + 8c8c938 + edcc2dd + c81447b + 228f0f0 + d7daf62 + 43341cf + 39a9fa4 + 1f5ba4c + bf8876b + 794fddf + 5866028 + 64a29c8 commit 8d69a73

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1403
-5
lines changed

Source/RunActivity/Viewer3D/Cameras.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,18 +1278,18 @@ protected override void OnActivate(bool sameCamera)
12781278
var carPosition = !(TrainCarViewer.CarPosition < trainCars.Count()) ? TrainCarViewer.CarPosition - 1 : TrainCarViewer.CarPosition;
12791279
var isDownCameraOutsideFront = UserInput.IsDown(UserCommand.CameraOutsideFront);
12801280
var isDownCameraOutsideRear = UserInput.IsDown(UserCommand.CameraOutsideRear);
1281-
var isVisibleTrainCarViewer = Viewer.TrainCarOperationsViewerWindow.Visible;
1281+
var isVisibleTrainCarViewerOrWebpage = Viewer.TrainCarOperationsViewerWindow.Visible || (Viewer.TrainCarOperationsWebpage.TrainCarSelected);
12821282

12831283
if (attachedCar == null || attachedCar.Train != Viewer.SelectedTrain || carPosition != oldCarPosition || isDownCameraOutsideFront || isDownCameraOutsideRear)
12841284
{
12851285
if (Front)
12861286
{
1287-
if (!isVisibleTrainCarViewer && isDownCameraOutsideFront)
1287+
if (!isVisibleTrainCarViewerOrWebpage && isDownCameraOutsideFront)
12881288
{
12891289
SetCameraCar(GetCameraCars().First());
12901290
oldCarPosition = 0;
12911291
}
1292-
else if (isVisibleTrainCarViewer && carPosition >= 0)
1292+
else if (isVisibleTrainCarViewerOrWebpage && carPosition >= 0)
12931293
{
12941294
SetCameraCar(trainCars[carPosition]);
12951295
oldCarPosition = carPosition;
@@ -1304,12 +1304,12 @@ protected override void OnActivate(bool sameCamera)
13041304
}
13051305
else
13061306
{
1307-
if (!isVisibleTrainCarViewer && isDownCameraOutsideRear)
1307+
if (!isVisibleTrainCarViewerOrWebpage && isDownCameraOutsideRear)
13081308
{
13091309
SetCameraCar(GetCameraCars().Last());
13101310
oldCarPosition = 0;
13111311
}
1312-
else if (isVisibleTrainCarViewer && carPosition >= 0)
1312+
else if (isVisibleTrainCarViewerOrWebpage && carPosition >= 0)
13131313
{
13141314
SetCameraCar(trainCars[carPosition]);
13151315
oldCarPosition = carPosition;

Source/RunActivity/Viewer3D/Viewer.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
using Orts.Viewer3D.Processes;
4141
using Orts.Viewer3D.RollingStock;
4242
using Orts.Viewer3D.WebServices.SwitchPanel;
43+
using Orts.Viewer3D.WebServices;
4344
using ORTS.Common;
4445
using ORTS.Common.Input;
4546
using ORTS.Scripting.Api;
@@ -95,6 +96,7 @@ public class Viewer
9596
public TrainOperationsWindow TrainOperationsWindow { get; private set; } // F9 window
9697
public TrainCarOperationsWindow TrainCarOperationsWindow { get; private set; } // Alt-F9 window
9798
public TrainCarOperationsViewerWindow TrainCarOperationsViewerWindow { get; private set; } // From TrainCarOperationWindow
99+
public TrainCarOperationsWebpage TrainCarOperationsWebpage { get; set; }
98100
public CarOperationsWindow CarOperationsWindow { get; private set; } // F9 sub-window for car operations
99101
public TrainDpuWindow TrainDpuWindow { get; private set; } // Shift + F9 train distributed power window
100102
public NextStationWindow NextStationWindow { get; private set; } // F10 window
@@ -896,6 +898,20 @@ public void Update(RenderFrame frame, float elapsedRealTime)
896898
WindowManager?.PrepareFrame(frame, elapsedTime);
897899

898900
SwitchPanelModule.SendSwitchPanelIfChanged();
901+
902+
try
903+
{
904+
if ((PlayerTrain != null) && (TrainCarOperationsWebpage != null))
905+
{
906+
TrainCarOperationsWebpage.handleReceiveAndSend();
907+
}
908+
}
909+
catch (Exception error)
910+
{
911+
// some timing error causes an exception sometimes
912+
// just silently ignore but log the exception
913+
Trace.TraceWarning(error.ToString());
914+
}
899915
}
900916

901917
private void LoadDefectCarSound(TrainCar car, string filename)

0 commit comments

Comments
 (0)