Skip to content

Commit 220b61e

Browse files
committed
Code clean-up.
1 parent e2064fc commit 220b61e

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Source/RunActivity/Viewer3D/Popups/TrainCarOperationsViewerWindow.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public class TrainCarOperationsViewerWindow : Window
9292
public int WindowHeightMax;
9393
public int WindowWidthMin;
9494
public int WindowWidthMax;
95-
public bool SavedCabCamera;
95+
public bool CabCameraEnabled;
9696
public int windowHeight { get; set; } //required by TrainCarWindow
9797
public int CarPosition
9898
{
@@ -160,9 +160,6 @@ protected internal override void Save(BinaryWriter outf)
160160

161161
outf.Write(CarPosition);
162162
outf.Write(ResetAllSymbols);
163-
164-
var saveCabCamera = Owner.Viewer.Camera is CabCamera || Owner.Viewer.Camera == Owner.Viewer.ThreeDimCabCamera;
165-
outf.Write(saveCabCamera);
166163
}
167164
protected internal override void Restore(BinaryReader inf)
168165
{
@@ -175,7 +172,8 @@ protected internal override void Restore(BinaryReader inf)
175172

176173
CarPosition = inf.ReadInt32();
177174
ResetAllSymbols = inf.ReadBoolean();
178-
SavedCabCamera = inf.ReadBoolean();
175+
176+
CabCameraEnabled = Owner.Viewer.Camera is CabCamera || Owner.Viewer.Camera == Owner.Viewer.ThreeDimCabCamera;
179177

180178
// Display window
181179
SizeTo(LocationRestore.Width, LocationRestore.Height);
@@ -478,9 +476,9 @@ public override void PrepareFrame(ElapsedTime elapsedTime, bool updateFull)
478476
// Updates CarPosition
479477
CarPosition = CouplerChanged ? NewCarPosition : CarPosition;
480478

481-
if (SavedCabCamera)
479+
if (CabCameraEnabled)// Displays camera 1
482480
{
483-
SavedCabCamera = false;
481+
CabCameraEnabled = false;
484482
}
485483
else if (OldCarPosition != CarPosition || (trainCarOperations.CarIdClicked && CarPosition == 0))
486484
{

0 commit comments

Comments
 (0)