@@ -497,7 +497,7 @@ private void DrawTrains(Graphics g, PointF scaledA, PointF scaledB)
497
497
498
498
selectedTrainList . Clear ( ) ;
499
499
500
- if ( simulator . TimetableMode )
500
+ /* if (simulator.TimetableMode)
501
501
{
502
502
// Add the player's train...
503
503
if (simulator.PlayerLocomotive.Train is AITrain)
@@ -508,10 +508,10 @@ private void DrawTrains(Graphics g, PointF scaledA, PointF scaledB)
508
508
selectedTrainList.Add(train);
509
509
}
510
510
else
511
- {
511
+ {*/
512
512
foreach ( var train in simulator . Trains )
513
513
selectedTrainList . Add ( train ) ;
514
- }
514
+ /*}*/
515
515
516
516
foreach ( var train in selectedTrainList )
517
517
{
@@ -533,7 +533,7 @@ private void DrawTrains(Graphics g, PointF scaledA, PointF scaledB)
533
533
534
534
// Skip trains with no loco
535
535
if ( locoCar == null )
536
- continue ;
536
+ locoCar = train . Cars [ 0 ] ;
537
537
}
538
538
else
539
539
continue ;
@@ -544,8 +544,7 @@ private void DrawTrains(Graphics g, PointF scaledA, PointF scaledB)
544
544
float y = mapCanvas . Height - ( ( ( loc . TileZ * 2048 ) + loc . Location . Z - subY ) * yScale ) ;
545
545
546
546
// If train out of view then skip it.
547
- if ( x < - margin2
548
- || y < - margin2 )
547
+ if ( x < - margin2 || y < - margin2 )
549
548
continue ;
550
549
551
550
DrawTrainPath ( train , subX , subY , pathPen , g , scaledA , scaledB , pDist , mDist ) ;
@@ -574,7 +573,7 @@ private void DrawTrains(Graphics g, PointF scaledA, PointF scaledB)
574
573
Y = - 25 + mapCanvas . Height - ( ( ( worldPos . TileZ * 2048 ) - subY + worldPos . Location . Z ) * yScale )
575
574
} ;
576
575
if ( showTrainLabelsCheckbox . Checked )
577
- DrawTrainLabels ( g , train , trainName , locoCar , scaledTrain ) ;
576
+ DrawTrainLabels ( g , train , trainName , scaledTrain ) ;
578
577
}
579
578
}
580
579
@@ -603,7 +602,7 @@ private void DrawCar(Graphics g, Train train, TrainCar car, TrainCar locoCar, fl
603
602
if ( x < - margin || y < - margin )
604
603
return ;
605
604
606
- t . Move ( - car . CarLengthM + ( 1 / xScale ) ) ; // Move from front of car to rear less 1 pixel to create a visible gap
605
+ t . Move ( - car . CarLengthM + ( 2 / xScale ) ) ; // Move from front of car to rear less 1 pixel to create a visible gap // TODO: investigate `(1 / xScale)` ==> `(2 / xScale)` car gap consequences
607
606
scaledTrain . X = x ; scaledTrain . Y = y ;
608
607
}
609
608
else // Draw the train as 2 boxes of fixed size
@@ -673,19 +672,19 @@ private void SetTrainColor(Train t, TrainCar locoCar, TrainCar car)
673
672
674
673
if ( t . TrainType == Train . TRAINTYPE . STATIC || ( t . TrainType == Train . TRAINTYPE . AI && t . GetAIMovementState ( ) == AITrain . AI_MOVEMENT_STATE . AI_STATIC ) )
675
674
{
676
- trainPen . Color = Color . FromArgb ( 83 , 237 , 214 ) ;
675
+ trainPen . Color = car is MSTSLocomotive ? Color . FromArgb ( 19 , 185 , 160 ) : Color . FromArgb ( 83 , 237 , 214 ) ;
677
676
}
678
677
679
678
// Draw player train with loco in red
680
679
if ( t . TrainType == Train . TRAINTYPE . PLAYER && car == locoCar )
681
680
trainPen . Color = Color . Red ;
682
681
}
683
682
684
- private void DrawTrainLabels ( Graphics g , Train t , string trainName , TrainCar firstCar , PointF scaledTrain )
683
+ private void DrawTrainLabels ( Graphics g , Train t , string trainName , PointF scaledTrain )
685
684
{
686
- WorldPosition worldPos = firstCar . WorldPosition ;
685
+ /* WorldPosition worldPos = firstCar.WorldPosition;
687
686
scaledTrain.X = ((worldPos.TileX * 2048) - subX + worldPos.Location.X) * xScale;
688
- scaledTrain . Y = - 25 + mapCanvas . Height - ( ( ( worldPos . TileZ * 2048 ) - subY + worldPos . Location . Z ) * yScale ) ;
687
+ scaledTrain.Y = -25 + mapCanvas.Height - (((worldPos.TileZ * 2048) - subY + worldPos.Location.Z) * yScale);*/
689
688
if ( showActiveTrainsRadio . Checked )
690
689
{
691
690
if ( t is AITrain && MapDataProvider . IsActiveTrain ( t as AITrain ) )
0 commit comments