Skip to content

Commit a300e37

Browse files
committed
Automatic merge of T1.5.1-553-g4b9199858 and 13 pull requests
- Pull request #757 at 98dd1a7: Unify RailDriver code implementations - Pull request #831 at 61bbf43: poor mans switch panel on tablet - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #841 at 410a585: https://blueprints.launchpad.net/or/+spec/animating-trainset-windows - Pull request #853 at d05f581: Notify out of focus - Pull request #855 at b39e5d8: Adds new route from TrainSimulations - Pull request #857 at 9afc8c3: Adding Air Flow Meters - Pull request #859 at fff2560: Steam adhesion bug#1 - Pull request #860 at d2b8a52: Changes in the Car Operations Menu for the lines with brake information - Pull request #862 at 489f261: Fix engine leak problem - Pull request #863 at a34b857: Alternate preset 3D cabviewpoints - Pull request #864 at 2fed4b9: Fixes for Undesired Emergency Applications - Pull request #865 at 3097086: Dispatcher window improvements
15 parents 89c91ae + 4b91998 + 98dd1a7 + 61bbf43 + d00beb9 + 410a585 + d05f581 + b39e5d8 + 9afc8c3 + fff2560 + d2b8a52 + 489f261 + a34b857 + 2fed4b9 + 3097086 commit a300e37

File tree

2 files changed

+125
-149
lines changed

2 files changed

+125
-149
lines changed

Source/RunActivity/Viewer3D/Debugging/DebugViewerBetaForm.cs

Lines changed: 30 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Orts.Formats.Msts;
99
using Orts.MultiPlayer;
1010
using Orts.Simulation;
11+
using Orts.Simulation.AIs;
1112
using Orts.Simulation.Physics;
1213
using Orts.Simulation.RollingStocks;
1314
using Orts.Simulation.Signalling;
@@ -333,36 +334,6 @@ public void GenerateView(bool dragging = false)
333334

334335
if (mapCanvas.Image == null || firstShow) InitializeImage();
335336

336-
/*if (firstShow)
337-
{
338-
if (!MPManager.IsServer())
339-
{
340-
chkAllowUserSwitch.Visible = false;
341-
chkAllowUserSwitch.Checked = false;
342-
rmvButton.Visible = false;
343-
btnAssist.Visible = false;
344-
btnNormal.Visible = false;
345-
msgAll.Text = "MSG to Server";
346-
}
347-
else
348-
{
349-
msgAll.Text = "MSG to All";
350-
}
351-
if (MPManager.IsServer())
352-
{
353-
rmvButton.Visible = true;
354-
chkAllowNew.Visible = true;
355-
chkAllowUserSwitch.Visible = true;
356-
}
357-
else
358-
{
359-
rmvButton.Visible = false;
360-
chkAllowNew.Visible = false;
361-
chkAllowUserSwitch.Visible = false;
362-
chkBoxPenalty.Visible = false;
363-
chkPreferGreen.Visible = false;
364-
}
365-
}*/
366337
if (firstShow || followTrain)
367338
{
368339
//see who should I look at:
@@ -515,23 +486,29 @@ private void DrawTrack(Graphics g, Pen p, out PointF scaledA, out PointF scaledB
515486

516487
private void DrawTrains(Graphics g, PointF scaledA, PointF scaledB)
517488
{
518-
var margin = 30 * xScale; //margins to determine if we want to draw a train
489+
var margin = 30 * xScale; // Margins to determine if we want to draw a train
519490
var margin2 = 5000 * xScale;
520491

521-
//variable for drawing train path
522-
var mDist = 5000f; var pDist = 50; //segment length when drawing path
492+
// Variable for drawing train path
493+
var mDist = 5000f; var pDist = 50; // Segment length when drawing path
523494

524495
selectedTrainList.Clear();
525496

526497
if (simulator.TimetableMode)
527498
{
528-
// Add the player's train
529-
if (simulator.PlayerLocomotive.Train is Orts.Simulation.AIs.AITrain)
530-
selectedTrainList.Add(simulator.PlayerLocomotive.Train as Orts.Simulation.AIs.AITrain);
499+
// Add the player's train...
500+
if (simulator.PlayerLocomotive.Train is Simulation.AIs.AITrain)
501+
selectedTrainList.Add(simulator.PlayerLocomotive.Train as Simulation.AIs.AITrain);
531502

532-
// and all the other trains
533-
foreach (var train in simulator.AI.AITrains)
503+
// ...then all the AI trains...
504+
foreach (AITrain train in simulator.AI.AITrains)
534505
selectedTrainList.Add(train);
506+
507+
// ...and finally the static consists.
508+
foreach (Train staticConsist in simulator.Trains.Where(c => c.TrainType == Train.TRAINTYPE.STATIC))
509+
{
510+
selectedTrainList.Add(staticConsist);
511+
}
535512
}
536513
else
537514
{
@@ -552,7 +529,7 @@ private void DrawTrains(Graphics g, PointF scaledA, PointF scaledB)
552529
else if (train.Cars != null && train.Cars.Count > 0)
553530
{
554531
trainName = train.GetTrainName(train.Cars[0].CarID);
555-
if (train.TrainType == Train.TRAINTYPE.AI)
532+
if (train.TrainType == Train.TRAINTYPE.AI || train.TrainType == Train.TRAINTYPE.STATIC)
556533
trainName = train.Number.ToString() + ":" + train.Name;
557534

558535
locoCar = train.Cars.Where(r => r is MSTSLocomotive).FirstOrDefault();
@@ -686,11 +663,21 @@ private void SetTrainColor(Train t, TrainCar locoCar, TrainCar car)
686663
// inactive loco: RGB 153,128,0
687664
// active car: RGB 0,204,0
688665
// inactive car: RGB 0,153,0
689-
trainPen.Color = MapDataProvider.IsActiveTrain(t as Simulation.AIs.AITrain)
690-
? car is MSTSLocomotive
666+
if (MapDataProvider.IsActiveTrain(t as AITrain))
667+
{
668+
trainPen.Color = car is MSTSLocomotive
691669
? (car == locoCar) ? Color.FromArgb(204, 170, 0) : Color.FromArgb(153, 128, 0)
692-
: Color.FromArgb(0, 204, 0)
693-
: car is MSTSLocomotive ? Color.FromArgb(153, 128, 0) : Color.FromArgb(0, 153, 0);
670+
: Color.FromArgb(0, 204, 0);
671+
}
672+
else
673+
{
674+
trainPen.Color = car is MSTSLocomotive ? Color.FromArgb(153, 128, 0) : Color.FromArgb(0, 153, 0);
675+
}
676+
677+
if (t.TrainType == Train.TRAINTYPE.STATIC)
678+
{
679+
trainPen.Color = Color.FromArgb(83, 237, 214);
680+
}
694681

695682
// Draw player train with loco in red
696683
if (t.TrainType == Train.TRAINTYPE.PLAYER && car == locoCar)

0 commit comments

Comments
 (0)