Skip to content

Commit 9b0470a

Browse files
committed
Renamed DebugViewerBeta to MapViewer
1 parent 9d8513a commit 9b0470a

File tree

7 files changed

+25
-23
lines changed

7 files changed

+25
-23
lines changed

Source/RunActivity/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static class Program
4242
public static Simulator Simulator;
4343
public static Viewer Viewer;
4444
public static DispatchViewer DebugViewer;
45-
public static DispatchViewerBeta DebugViewerBeta;
45+
public static MapViewer DebugViewerBeta;
4646
public static SoundDebugForm SoundDebugForm;
4747
public static ORTraceListener ORTraceListener;
4848
public static string logFileName = ""; // contains path to file

Source/RunActivity/Viewer3D/Debugging/MapDataProvider.cs renamed to Source/RunActivity/Viewer3D/Map/MapDataProvider.cs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@
2323
using Orts.MultiPlayer;
2424
using Orts.Simulation.Physics;
2525
using Orts.Simulation.Signalling;
26+
using Orts.Viewer3D.Debugging;
2627

27-
namespace Orts.Viewer3D.Debugging
28+
namespace Orts.Viewer3D.Map
2829
{
2930
public class MapDataProvider
3031
{
31-
public DispatchViewerBeta F { get; set; } // Shortest possible abbreviation so code is easier to read
32+
public MapViewer F { get; set; } // Shortest possible abbreviation so code is easier to read
3233

33-
public MapDataProvider(DispatchViewerBeta form)
34+
public MapDataProvider(MapViewer form)
3435
{
3536
F = form;
3637
}
@@ -92,7 +93,7 @@ public void PopulateItemLists()
9293
{
9394
var oldSiding = F.sidings[oldSidingIndex];
9495
var oldLocation = oldSiding.Location;
95-
var newLocation = new PointF((item.TileX * 2048) + item.X, (item.TileZ * 2048) + item.Z);
96+
var newLocation = new PointF(item.TileX * 2048 + item.X, item.TileZ * 2048 + item.Z);
9697

9798
// Because these are structs, not classes, compiler won't let you overwrite them.
9899
// Instead create a single item which replaces the 2 platform items.
@@ -117,15 +118,15 @@ public void PopulateItemLists()
117118
{
118119
var newPlatform = new PlatformWidget(item as PlatformItem)
119120
{
120-
Extent1 = new PointF((item.TileX * 2048) + item.X, (item.TileZ * 2048) + item.Z)
121+
Extent1 = new PointF(item.TileX * 2048 + item.X, item.TileZ * 2048 + item.Z)
121122
};
122123
F.platforms.Add(newPlatform);
123124
}
124125
else
125126
{
126127
var oldPlatform = F.platforms[oldPlatformIndex];
127128
var oldLocation = oldPlatform.Location;
128-
var newLocation = new PointF((item.TileX * 2048) + item.X, (item.TileZ * 2048) + item.Z);
129+
var newLocation = new PointF(item.TileX * 2048 + item.X, item.TileZ * 2048 + item.Z);
129130

130131
// Because these are structs, not classes, compiler won't let you overwrite them.
131132
// Instead create a single item which replaces the 2 platform items.
@@ -174,7 +175,7 @@ private PointF GetMidPoint(PointF location1, PointF location2)
174175

175176
private PointF GetRightHandPoint(PointF location1, PointF location2)
176177
{
177-
return (location1.X > location2.X) ? location1 : location2;
178+
return location1.X > location2.X ? location1 : location2;
178179
}
179180

180181
public void ShowSimulationTime()
@@ -203,9 +204,9 @@ public void FixForBadData(float width, ref PointF scaledA, ref PointF scaledB, P
203204
public bool IsActiveTrain(Simulation.AIs.AITrain t)
204205
{
205206
return t != null
206-
&& ((t.MovementState != Simulation.AIs.AITrain.AI_MOVEMENT_STATE.AI_STATIC
207+
&& (t.MovementState != Simulation.AIs.AITrain.AI_MOVEMENT_STATE.AI_STATIC
207208
&& !(t.TrainType == Train.TRAINTYPE.AI_INCORPORATED && !t.IncorporatingTrain.IsPathless)
208-
)
209+
209210
|| t.TrainType == Train.TRAINTYPE.PLAYER);
210211
}
211212

@@ -249,19 +250,19 @@ public float GetUnusedYLocation(float startX, float wantY, string name)
249250
const float noFreeSlotFound = -1f;
250251

251252
var desiredPositionY = (int)(wantY / DispatchViewer.spacing); // The positionY of the ideal row for the text.
252-
var endX = startX + (name.Length * F.trainFont.Size);
253+
var endX = startX + name.Length * F.trainFont.Size;
253254
//out of drawing area
254255
if (endX < 0)
255256
return noFreeSlotFound;
256257

257-
int positionY = desiredPositionY;
258+
var positionY = desiredPositionY;
258259
while (positionY >= 0 && positionY < F.alignedTextY.Length)
259260
{
260261
//if the line contains no text yet, put it there
261262
if (F.alignedTextNum[positionY] == 0)
262263
return SaveLabelLocation(startX, endX, positionY);
263264

264-
bool conflict = false;
265+
var conflict = false;
265266

266267
//check if it intersects with any labels already in this row
267268
for (var col = 0; col < F.alignedTextNum[positionY]; col++)

Source/RunActivity/Viewer3D/Debugging/DebugViewerBetaForm.Designer.cs renamed to Source/RunActivity/Viewer3D/Map/MapForm.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/RunActivity/Viewer3D/Debugging/DebugViewerBetaForm.cs renamed to Source/RunActivity/Viewer3D/Map/MapForm.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
using Orts.Simulation.RollingStocks;
1414
using Orts.Simulation.Signalling;
1515
using Orts.Simulation.Timetables;
16+
using Orts.Viewer3D.Map;
1617
using Orts.Viewer3D.Popups;
1718
using ORTS.Common;
1819
using Color = System.Drawing.Color;
1920

2021
namespace Orts.Viewer3D.Debugging
2122
{
22-
public partial class DispatchViewerBeta : Form
23+
public partial class MapViewer : Form
2324
{
2425
#region Variables
2526
/// <summary>
@@ -104,7 +105,7 @@ public partial class DispatchViewerBeta : Form
104105
private bool MapCustomizationVisible = false;
105106
#endregion
106107

107-
public DispatchViewerBeta(Simulator simulator, Viewer viewer)
108+
public MapViewer(Simulator simulator, Viewer viewer)
108109
{
109110
InitializeComponent();
110111

Source/RunActivity/Viewer3D/Debugging/MapThemeProvider.cs renamed to Source/RunActivity/Viewer3D/Map/MapThemeProvider.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
using System.Linq;
44
using System.Windows.Forms;
55

6-
namespace Orts.Viewer3D.Debugging
6+
namespace Orts.Viewer3D.Map
77
{
88
public class MapThemeProvider
99
{
1010
public void InitializeThemes()
1111
{
12-
ThemeStyle LightTheme = new ThemeStyle
12+
var LightTheme = new ThemeStyle
1313
{
1414
BackColor = Color.Transparent,
1515
ForeColor = SystemColors.ControlText,
@@ -19,7 +19,7 @@ public void InitializeThemes()
1919
TrackColor = Color.FromArgb(46, 64, 83),
2020
};
2121

22-
ThemeStyle DarkTheme = new ThemeStyle
22+
var DarkTheme = new ThemeStyle
2323
{
2424
BackColor = Color.FromArgb(44, 62, 80),
2525
ForeColor = Color.FromArgb(247, 249, 249),
@@ -30,7 +30,7 @@ public void InitializeThemes()
3030
};
3131

3232
// Reference for "solarized" themes: https://github.com/altercation/solarized?tab=readme-ov-file#the-values
33-
ThemeStyle LightSolarizedTheme = new ThemeStyle
33+
var LightSolarizedTheme = new ThemeStyle
3434
{
3535
BackColor = Color.FromArgb(253, 246, 227),
3636
ForeColor = Color.FromArgb(101, 123, 131),
@@ -40,7 +40,7 @@ public void InitializeThemes()
4040
TrackColor = Color.FromArgb(88, 110, 117),
4141
};
4242

43-
ThemeStyle DarkSolarizedTheme = new ThemeStyle
43+
var DarkSolarizedTheme = new ThemeStyle
4444
{
4545
BackColor = Color.FromArgb(0, 43, 54),
4646
ForeColor = Color.FromArgb(131, 148, 150),
@@ -60,7 +60,7 @@ public void InitializeThemes()
6060

6161
public ThemeStyle GetTheme(string themeName)
6262
{
63-
if (Themes.TryGetValue(themeName, out ThemeStyle theme))
63+
if (Themes.TryGetValue(themeName, out var theme))
6464
{
6565
return theme;
6666
}

Source/RunActivity/Viewer3D/Processes/GameStateViewer3D.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ internal override void BeginRender(RenderFrame frame)
5656
Program.DebugViewer.Hide();
5757
Viewer.DebugViewerEnabled = false;
5858

59-
Program.DebugViewerBeta = new DispatchViewerBeta(Viewer.Simulator, Viewer);
59+
Program.DebugViewerBeta = new MapViewer(Viewer.Simulator, Viewer);
6060
Program.DebugViewerBeta.Hide();
6161
Viewer.DebugViewerBetaEnabled = false;
6262

0 commit comments

Comments
 (0)