Skip to content

Commit 481ed9d

Browse files
solved merge conflicts
2 parents f0010ab + 90255fb commit 481ed9d

File tree

2 files changed

+44
-64
lines changed

2 files changed

+44
-64
lines changed

Source/RunActivity/Viewer3D/Popups/TrainCarOperationsViewerWindow.cs

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -287,43 +287,33 @@ void AddSpace(bool full)
287287

288288
{
289289
var car = PlayerTrain.Cars[CarPosition];
290-
//Front brake hose
291290
if (car != PlayerTrain.Cars.First())
292-
{
293-
AddSpace(false);
294-
line.Add(new buttonFrontBrakeHose(0, 0, textHeight, Owner.Viewer, car, CarPosition));
295-
line.Add(new buttonFrontAngleCock(0, 0, textHeight, Owner.Viewer, car, CarPosition));
296291
AddSpace(false);
297-
line.Add(new buttonCouplerFront(0, 0, textHeight, Owner.Viewer, car, CarPosition));
298-
}
299-
else
300-
{
301-
line.Add(new buttonFrontBrakeHose(0, 0, textHeight, Owner.Viewer, car, CarPosition));
302-
line.Add(new buttonFrontAngleCock(0, 0, textHeight, Owner.Viewer, car, CarPosition));
303-
line.Add(new buttonCouplerFront(0, 0, textHeight, Owner.Viewer, car, CarPosition));
304-
}
305292

306-
line.Add(new buttonLoco(0, 0, textHeight, Owner.Viewer, car));
293+
//Front brake hose
294+
line.Add(new buttonFrontBrakeHose(0, 0, textHeight, Owner.Viewer, car, CarPosition));
295+
// Front angle cock
296+
line.Add(new buttonFrontAngleCock(0, 0, textHeight, Owner.Viewer, car, CarPosition));
307297

308-
if (car != PlayerTrain.Cars.Last())
309-
{
310-
line.Add(new buttonCouplerRear(0, 0, textHeight, Owner.Viewer, car, CarPosition));
311-
AddSpace(false);
312-
line.Add(new buttonRearAngleCock(0, 0, textHeight, Owner.Viewer, car, CarPosition));
313-
line.Add(new buttonRearBrakeHose(0, 0, textHeight, Owner.Viewer, car, CarPosition));
314-
AddSpace(false);
315-
line.Add(new buttonHandBrake(0, 0, textHeight, Owner.Viewer, CarPosition));
316-
}
317-
else
318-
{
319-
line.Add(new buttonCouplerRear(0, 0, textHeight, Owner.Viewer, car, CarPosition));
320-
AddSpace(false);
321-
line.Add(new buttonRearAngleCock(0, 0, textHeight, Owner.Viewer, car, CarPosition));
322-
line.Add(new buttonRearBrakeHose(0, 0, textHeight, Owner.Viewer, car, CarPosition));
298+
if (car != PlayerTrain.Cars.First())
323299
AddSpace(false);
324-
line.Add(new buttonHandBrake(0, 0, textHeight, Owner.Viewer, CarPosition));
325-
}
300+
301+
// Front coupler
302+
line.Add(new buttonCouplerFront(0, 0, textHeight, Owner.Viewer, car, CarPosition));
303+
// Loco label
304+
line.Add(new buttonLoco(0, 0, textHeight, Owner.Viewer, car));
305+
// Rear coupler
306+
line.Add(new buttonCouplerRear(0, 0, textHeight, Owner.Viewer, car, CarPosition));
307+
AddSpace(false);
308+
// Rear angle cock
309+
line.Add(new buttonRearAngleCock(0, 0, textHeight, Owner.Viewer, car, CarPosition));
310+
// Rear brake hose
311+
line.Add(new buttonRearBrakeHose(0, 0, textHeight, Owner.Viewer, car, CarPosition));
312+
AddSpace(false);
313+
// Handbrake
314+
line.Add(new buttonHandBrake(0, 0, textHeight, Owner.Viewer, CarPosition));
326315
AddSpace(false);
316+
// Bleed off valve
327317
line.Add(new buttonBleedOffValve(0, 0, textHeight, Owner.Viewer, CarPosition));
328318
AddSpace(false);
329319

Source/RunActivity/Viewer3D/Popups/TrainCarOperationsWindow.cs

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -350,51 +350,41 @@ void AddSpace()
350350

351351
if (car.BrakesStuck || ((car is MSTSLocomotive) && (car as MSTSLocomotive).PowerReduction > 0)) carLabel.Color = Color.Red;
352352

353+
// Left arrow
353354
line.Add(new buttonArrowLeft(0, 0, SymbolSize, Owner.Viewer, carPosition));
354355
AddSpace();
355-
if (car != PlayerTrain.Cars.First())
356-
{
357-
line.Add(new buttonFrontBrakeHose(0, 0, SymbolSize, Owner.Viewer, car, carPosition));
358-
line.Add(new buttonFrontAngleCock(0, 0, SymbolSize, Owner.Viewer, car, carPosition));
359-
AddSpace();
360-
line.Add(new buttonCouplerFront(0, 0, SymbolSize, Owner.Viewer, car));
361-
}
362-
else
363-
{
364-
line.Add(new buttonFrontBrakeHose(0, 0, SymbolSize, Owner.Viewer, car, carPosition));
365-
line.Add(new buttonFrontAngleCock(0, 0, SymbolSize, Owner.Viewer, car, carPosition));
366-
AddSpace();
367-
line.Add(new buttonCouplerFront(0, 0, SymbolSize, Owner.Viewer, car));
368-
}
356+
357+
// Front brake hose
358+
line.Add(new buttonFrontBrakeHose(0, 0, SymbolSize, Owner.Viewer, car, carPosition));
359+
// Front angle cock
360+
line.Add(new buttonFrontAngleCock(0, 0, SymbolSize, Owner.Viewer, car, carPosition));
361+
AddSpace();
362+
363+
// Front coupler
364+
line.Add(new buttonCouplerFront(0, 0, SymbolSize, Owner.Viewer, car));
365+
// Car label
369366
line.Add(carLabel);
370-
if (car != PlayerTrain.Cars.Last())
371-
{
372-
line.Add(new buttonCouplerRear(0, 0, SymbolSize, Owner.Viewer, car));
373-
AddSpace();
374-
line.Add(new buttonRearAngleCock(0, 0, SymbolSize, Owner.Viewer, car, carPosition));
375-
line.Add(new buttonRearBrakeHose(0, 0, SymbolSize, Owner.Viewer, car, carPosition));
376-
}
377-
else
378-
{
379-
line.Add(new buttonCouplerRear(0, 0, SymbolSize, Owner.Viewer, car));
380-
AddSpace();
381-
line.Add(new buttonRearAngleCock(0, 0, SymbolSize, Owner.Viewer, car, carPosition));
382-
line.Add(new buttonRearBrakeHose(0, 0, SymbolSize, Owner.Viewer, car, carPosition));
383-
}
367+
// Rear coupler
368+
line.Add(new buttonCouplerRear(0, 0, SymbolSize, Owner.Viewer, car));
369+
AddSpace();
384370

371+
// Rear angle cock
372+
line.Add(new buttonRearAngleCock(0, 0, SymbolSize, Owner.Viewer, car, carPosition));
373+
// Rear brake hose
374+
line.Add(new buttonRearBrakeHose(0, 0, SymbolSize, Owner.Viewer, car, carPosition));
385375
AddSpace();
386376

387377
// Handbrake
388378
line.Add(new buttonHandBrake(0, 0, SymbolSize, Owner.Viewer, carPosition));
389379
AddSpace();
390380

391-
// Bleed Off Valve
381+
// Bleed off valve
392382
line.Add(new buttonBleedOffValve(0, 0, SymbolSize, Owner.Viewer, carPosition));
393383
AddSpace();
394384

395385
if (AllSymbolsMode)//Allows to display all symbols
396386
{
397-
// Electric Train Supply Connection (ETS)
387+
// Electric train supply connection (ETS)
398388
if (PlayerTrain.Cars.Count() > 1 && wagon.PowerSupply != null)
399389
{
400390
line.Add(new buttonToggleElectricTrainSupplyCable(0, 0, SymbolSize, Owner.Viewer, carPosition));
@@ -417,7 +407,7 @@ void AddSpace()
417407
}
418408
}
419409
}
420-
410+
// Right arrow
421411
line.Add(new buttonArrowRight(0, 0, textHeight, Owner.Viewer, carPosition));
422412
AddSpace();
423413
AddSpace();
@@ -477,7 +467,7 @@ public void localScrollLayout(int selectedCarPosition)
477467

478468
LocalScrollPosition = 0;
479469

480-
if (CarPositionVisible > 0 && selectedCarPosition >= CarPositionVisible)// && selectedCarPosition != currentCarPosition)// Not related with CarID
470+
if (CarPositionVisible > 0 && selectedCarPosition >= CarPositionVisible)// Not related with CarID
481471
{
482472
Client = ControlLayoutScrollboxVertical.NewClient;
483473
var xcarPosition = CarPositionVisible;
@@ -587,7 +577,7 @@ public override void PrepareFrame(ElapsedTime elapsedTime, bool updateFull)
587577
carOperations.CarOperationChanged = carOperations.Visible && carOperations.CarOperationChanged;
588578
}
589579

590-
if (CarPosition != trainCarViewer.CarPosition)
580+
if (CarPosition != trainCarViewer.CarPosition && Owner.Viewer.TrainCarOperationsWebpage.Connections > 0)
591581
{
592582
// Required to scroll the main window from the web version
593583
UpdateTrainCarOperation = true;

0 commit comments

Comments
 (0)