@@ -337,7 +337,7 @@ void AddSpace()
337337 if ( RefreshRestoredData )
338338 { // Restores brake hose
339339 RefreshRestoredData = false ;
340- for ( int i = 0 ; i < PlayerTrain . Cars . Count ; i ++ )
340+ for ( var i = 0 ; i < PlayerTrain . Cars . Count ; i ++ )
341341 {
342342 ( PlayerTrain . Cars [ i ] as MSTSWagon ) . BrakeSystem . RearBrakeHoseConnected = RearBrakes [ i ] ;
343343 }
@@ -378,51 +378,41 @@ void AddSpace()
378378
379379 if ( car . BrakesStuck || ( ( car is MSTSLocomotive ) && ( car as MSTSLocomotive ) . PowerReduction > 0 ) ) carLabel . Color = Color . Red ;
380380
381+ // Left arrow
381382 line . Add ( new buttonArrowLeft ( 0 , 0 , SymbolSize , Owner . Viewer , carPosition ) ) ;
382383 AddSpace ( ) ;
383- if ( car != PlayerTrain . Cars . First ( ) )
384- {
385- line . Add ( new buttonFrontBrakeHose ( 0 , 0 , SymbolSize , Owner . Viewer , car , carPosition ) ) ;
386- line . Add ( new buttonFrontAngleCock ( 0 , 0 , SymbolSize , Owner . Viewer , car , carPosition ) ) ;
387- AddSpace ( ) ;
388- line . Add ( new buttonCouplerFront ( 0 , 0 , SymbolSize , Owner . Viewer , car ) ) ;
389- }
390- else
391- {
392- line . Add ( new buttonFrontBrakeHose ( 0 , 0 , SymbolSize , Owner . Viewer , car , carPosition ) ) ;
393- line . Add ( new buttonFrontAngleCock ( 0 , 0 , SymbolSize , Owner . Viewer , car , carPosition ) ) ;
394- AddSpace ( ) ;
395- line . Add ( new buttonCouplerFront ( 0 , 0 , SymbolSize , Owner . Viewer , car ) ) ;
396- }
384+
385+ // Front brake hose
386+ line . Add ( new buttonFrontBrakeHose ( 0 , 0 , SymbolSize , Owner . Viewer , car , carPosition ) ) ;
387+ // Front angle cock
388+ line . Add ( new buttonFrontAngleCock ( 0 , 0 , SymbolSize , Owner . Viewer , car , carPosition ) ) ;
389+ AddSpace ( ) ;
390+
391+ // Front coupler
392+ line . Add ( new buttonCouplerFront ( 0 , 0 , SymbolSize , Owner . Viewer , car ) ) ;
393+ // Car label
397394 line . Add ( carLabel ) ;
398- if ( car != PlayerTrain . Cars . Last ( ) )
399- {
400- line . Add ( new buttonCouplerRear ( 0 , 0 , SymbolSize , Owner . Viewer , car ) ) ;
401- AddSpace ( ) ;
402- line . Add ( new buttonRearAngleCock ( 0 , 0 , SymbolSize , Owner . Viewer , car , carPosition ) ) ;
403- line . Add ( new buttonRearBrakeHose ( 0 , 0 , SymbolSize , Owner . Viewer , car , carPosition ) ) ;
404- }
405- else
406- {
407- line . Add ( new buttonCouplerRear ( 0 , 0 , SymbolSize , Owner . Viewer , car ) ) ;
408- AddSpace ( ) ;
409- line . Add ( new buttonRearAngleCock ( 0 , 0 , SymbolSize , Owner . Viewer , car , carPosition ) ) ;
410- line . Add ( new buttonRearBrakeHose ( 0 , 0 , SymbolSize , Owner . Viewer , car , carPosition ) ) ;
411- }
395+ // Rear coupler
396+ line . Add ( new buttonCouplerRear ( 0 , 0 , SymbolSize , Owner . Viewer , car ) ) ;
397+ AddSpace ( ) ;
412398
399+ // Rear angle cock
400+ line . Add ( new buttonRearAngleCock ( 0 , 0 , SymbolSize , Owner . Viewer , car , carPosition ) ) ;
401+ // Rear brake hose
402+ line . Add ( new buttonRearBrakeHose ( 0 , 0 , SymbolSize , Owner . Viewer , car , carPosition ) ) ;
413403 AddSpace ( ) ;
414404
415405 // Handbrake
416406 line . Add ( new buttonHandBrake ( 0 , 0 , SymbolSize , Owner . Viewer , carPosition ) ) ;
417407 AddSpace ( ) ;
418408
419- // Bleed Off Valve
409+ // Bleed off valve
420410 line . Add ( new buttonBleedOffValve ( 0 , 0 , SymbolSize , Owner . Viewer , carPosition ) ) ;
421411 AddSpace ( ) ;
422412
423413 if ( AllSymbolsMode ) //Allows to display all symbols
424414 {
425- // Electric Train Supply Connection (ETS)
415+ // Electric train supply connection (ETS)
426416 if ( PlayerTrain . Cars . Count ( ) > 1 && wagon . PowerSupply != null )
427417 {
428418 line . Add ( new buttonToggleElectricTrainSupplyCable ( 0 , 0 , SymbolSize , Owner . Viewer , carPosition ) ) ;
@@ -445,7 +435,7 @@ void AddSpace()
445435 }
446436 }
447437 }
448-
438+ // Right arrow
449439 line . Add ( new buttonArrowRight ( 0 , 0 , textHeight , Owner . Viewer , carPosition ) ) ;
450440 AddSpace ( ) ;
451441 AddSpace ( ) ;
@@ -505,7 +495,7 @@ public void localScrollLayout(int selectedCarPosition)
505495
506496 LocalScrollPosition = 0 ;
507497
508- if ( CarPositionVisible > 0 && selectedCarPosition >= CarPositionVisible ) // && selectedCarPosition != currentCarPosition)// Not related with CarID
498+ if ( CarPositionVisible > 0 && selectedCarPosition >= CarPositionVisible ) // Not related with CarID
509499 {
510500 Client = ControlLayoutScrollboxVertical . NewClient ;
511501 var xcarPosition = CarPositionVisible ;
@@ -615,7 +605,7 @@ public override void PrepareFrame(ElapsedTime elapsedTime, bool updateFull)
615605 carOperations . CarOperationChanged = carOperations . Visible && carOperations . CarOperationChanged ;
616606 }
617607
618- if ( CarPosition != trainCarViewer . CarPosition )
608+ if ( CarPosition != trainCarViewer . CarPosition && Owner . Viewer . TrainCarOperationsWebpage . Connections > 0 )
619609 {
620610 // Required to scroll the main window from the web version
621611 UpdateTrainCarOperation = true ;
0 commit comments