Skip to content

Commit 86bcd3a

Browse files
Merge branch 'master' into downloadContent2
2 parents 3b7b1b6 + 58b2418 commit 86bcd3a

File tree

81 files changed

+2642
-873
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+2642
-873
lines changed

Source/ContentChecker/ContentChecker.csproj

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
<TargetFramework Condition="'$(BuildDotNet)' == 'true'">net6-windows</TargetFramework>
44
<TargetFramework Condition="'$(TargetFramework)' == ''">net472</TargetFramework>
55
<OutputType>Exe</OutputType>
6-
<UseWindowsForms>true</UseWindowsForms>
7-
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
86
<IsPublishable>False</IsPublishable>
97
<AssemblyTitle>Open Rails Content Checker</AssemblyTitle>
108
<Description>Open Rails Transport Simulator</Description>

Source/ContentChecker/Loader.cs

+1-6
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
using System.Linq;
4444
using System.Text;
4545
using Microsoft.Xna.Framework.Graphics;
46-
using System.Windows.Forms;
4746

4847
namespace ContentChecker
4948
{
@@ -70,7 +69,7 @@ abstract class Loader
7069
/// <summary> The number of files that were actually loaded </summary>
7170
public int FilesLoaded { get; protected set; }
7271
/// <summary> The number of files that were not loaded but skipped </summary>
73-
public int FilesSkipped {get; protected set;}
72+
public int FilesSkipped { get; protected set; }
7473

7574
/// <summary> The action to take when an additonal file has been identified. This is intended to be set externally </summary>
7675
protected Action<string, Loader> AddAdditionalFileAction { get; set; }
@@ -158,17 +157,13 @@ protected static GraphicsDevice GetGraphicsDevice()
158157
{
159158
if (_graphicsDevice == null)
160159
{
161-
// We use a Windows.Forms Control instead of an xna GAME because it is much easier to use.
162-
var _c = new Control();
163-
164160
// Details probably do not matter too much
165161
PresentationParameters parameters = new PresentationParameters()
166162
{
167163
BackBufferWidth = 100,
168164
BackBufferHeight = 100,
169165
BackBufferFormat = SurfaceFormat.Color,
170166
//DepthStencilFormat = DepthFormat.Depth24,
171-
DeviceWindowHandle = _c.Handle,
172167
PresentationInterval = PresentInterval.Immediate,
173168
IsFullScreen = false,
174169
};

Source/ContentChecker/Program.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,10 @@ static bool OptionsContain(string[] args, IEnumerable<string> optionNames) {
7777
/// </summary>
7878
static void ShowHelp()
7979
{
80-
var version = FileVersionInfo.GetVersionInfo(typeof(Program).Assembly.Location);
81-
Console.WriteLine("{0} {1}", version.FileDescription, VersionInfo.VersionOrBuild);
80+
Console.WriteLine("{0} {1}", ApplicationInfo.ApplicationName, VersionInfo.VersionOrBuild);
8281
Console.WriteLine();
8382
Console.WriteLine("Usage:");
84-
Console.WriteLine(" {0} [options] <FILE> [...]", Path.GetFileNameWithoutExtension(version.FileName));
83+
Console.WriteLine(" {0} [options] <FILE> [...]", Path.GetFileNameWithoutExtension(ApplicationInfo.ProcessFile));
8584
Console.WriteLine();
8685
Console.WriteLine("Arguments:");
8786
Console.WriteLine(" <FILE> Data files to check; may contain wildcards");

Source/Contrib/DataCollector/Program.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
using ORTS.Common;
2020
using System;
2121
using System.Collections.Generic;
22-
using System.Diagnostics;
2322
using System.IO;
2423
using System.Linq;
2524

@@ -39,11 +38,10 @@ static void Main(string[] args)
3938

4039
static void ShowHelp()
4140
{
42-
var version = FileVersionInfo.GetVersionInfo(typeof(Program).Assembly.Location);
43-
Console.WriteLine("{0} {1}", version.FileDescription, VersionInfo.VersionOrBuild);
41+
Console.WriteLine("{0} {1}", ApplicationInfo.ApplicationName, VersionInfo.VersionOrBuild);
4442
Console.WriteLine();
4543
Console.WriteLine("Usage:");
46-
Console.WriteLine(" {0} [options] [<PATH> [...]]", Path.GetFileNameWithoutExtension(version.FileName));
44+
Console.WriteLine(" {0} [options] [<PATH> [...]]", Path.GetFileNameWithoutExtension(ApplicationInfo.ProcessFile));
4745
Console.WriteLine();
4846
Console.WriteLine("Arguments:");
4947
Console.WriteLine(" <PATH> Directories to scan for specific options");

Source/Contrib/DataConverter/Program.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
using System;
1919
using System.Collections.Generic;
20-
using System.Diagnostics;
2120
using System.IO;
2221
using System.Linq;
2322
using System.Runtime.Serialization;
@@ -87,11 +86,10 @@ static void Main(string[] args)
8786

8887
static void ShowHelp(List<IDataConverter> converters)
8988
{
90-
var version = FileVersionInfo.GetVersionInfo(typeof(Program).Assembly.Location);
91-
Console.WriteLine("{0} {1}", version.FileDescription, VersionInfo.VersionOrBuild);
89+
Console.WriteLine("{0} {1}", ApplicationInfo.ApplicationName, VersionInfo.VersionOrBuild);
9290
Console.WriteLine();
9391
Console.WriteLine("Usage:");
94-
Console.WriteLine(" {0} /input <INPUT> [/output] [<OUTPUT> [...]]", Path.GetFileNameWithoutExtension(version.FileName));
92+
Console.WriteLine(" {0} /input <INPUT> [/output] [<OUTPUT> [...]]", Path.GetFileNameWithoutExtension(ApplicationInfo.ProcessFile));
9593
Console.WriteLine();
9694
Console.WriteLine("Arguments:");
9795
Console.WriteLine(" <INPUT> Specifies the file to read");

Source/Contrib/DataValidator/Program.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ static void Main(string[] args)
3939

4040
static void ShowHelp()
4141
{
42-
var version = FileVersionInfo.GetVersionInfo(typeof(Program).Assembly.Location);
43-
Console.WriteLine("{0} {1}", version.FileDescription, VersionInfo.VersionOrBuild);
42+
Console.WriteLine("{0} {1}", ApplicationInfo.ApplicationName, VersionInfo.VersionOrBuild);
4443
Console.WriteLine();
4544
Console.WriteLine("Usage:");
46-
Console.WriteLine(" {0} [options] <FILE> [...]", Path.GetFileNameWithoutExtension(version.FileName));
45+
Console.WriteLine(" {0} [options] <FILE> [...]", Path.GetFileNameWithoutExtension(ApplicationInfo.ProcessFile));
4746
Console.WriteLine();
4847
Console.WriteLine("Arguments:");
4948
Console.WriteLine(" <FILE> Data files to validate; may contain wildcards");

Source/Contrib/SimulatorTester/Program.cs

+8-11
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
using Orts.Simulation;
2222
using ORTS.Common;
2323
using System.IO;
24-
using System.Windows.Forms;
2524
using Orts.Common;
26-
using System.Diagnostics;
2725

2826
namespace SimulatorTester
2927
{
@@ -37,23 +35,22 @@ static void Main(string[] args)
3735

3836
if (files.Count != 1 || options.Contains("help", StringComparer.InvariantCultureIgnoreCase))
3937
{
40-
var version = FileVersionInfo.GetVersionInfo(Application.ExecutablePath);
41-
Console.WriteLine("{0} {1}", version.FileDescription, VersionInfo.VersionOrBuild);
38+
Console.WriteLine("{0} {1}", ApplicationInfo.ApplicationName, VersionInfo.VersionOrBuild);
4239
Console.WriteLine();
4340
Console.WriteLine("Usage:");
44-
Console.WriteLine(" {0} [options] <SAVE_FILE>", Path.GetFileNameWithoutExtension(Application.ExecutablePath));
41+
Console.WriteLine(" {0} [options] <SAVE_FILE>", Path.GetFileNameWithoutExtension(ApplicationInfo.ProcessFile));
4542
Console.WriteLine();
4643
Console.WriteLine("Arguments:");
47-
Console.WriteLine(" <SAVE_FILE> {0} save file to use", Application.ProductName);
44+
Console.WriteLine(" <SAVE_FILE> {0} save file to use", ApplicationInfo.ProductName);
4845
Console.WriteLine();
4946
Console.WriteLine("Options:");
5047
Console.WriteLine(" /quiet Do not show summary of simulation (only exit code is set)");
51-
Console.WriteLine(" /verbose Show version and settings (similar to a {0} log)", Application.ProductName);
48+
Console.WriteLine(" /verbose Show version and settings (similar to a {0} log)", ApplicationInfo.ProductName);
5249
Console.WriteLine(" /fps <FPS> Set the simulation frame-rate [default: 10]");
5350
Console.WriteLine(" /help Show help and usage information");
54-
Console.WriteLine(" ...and any standard {0} option", Application.ProductName);
51+
Console.WriteLine(" ...and any standard {0} option", ApplicationInfo.ProductName);
5552
Console.WriteLine();
56-
Console.WriteLine("The {0} takes a save file and:", version.FileDescription);
53+
Console.WriteLine("The {0} takes a save file and:", ApplicationInfo.ApplicationName);
5754
Console.WriteLine(" - Loads the same activity as contained in the save file");
5855
Console.WriteLine(" - Runs the simulation at the specified FPS for the same duration as the save file");
5956
Console.WriteLine(" - Compares the final position with that contained in the save file");
@@ -65,15 +62,15 @@ static void Main(string[] args)
6562

6663
if (settings.Verbose)
6764
{
68-
Console.WriteLine("This is a log file for {0}. Please include this file in bug reports.", Application.ProductName);
65+
Console.WriteLine("This is a log file for {0}. Please include this file in bug reports.", ApplicationInfo.ProductName);
6966
LogSeparator();
7067

7168
SystemInfo.WriteSystemDetails(Console.Out);
7269
LogSeparator();
7370

7471
Console.WriteLine("Version = {0}", VersionInfo.Version.Length > 0 ? VersionInfo.Version : "<none>");
7572
Console.WriteLine("Build = {0}", VersionInfo.Build);
76-
Console.WriteLine("Executable = {0}", Path.GetFileName(Application.ExecutablePath));
73+
Console.WriteLine("Executable = {0}", Path.GetFileName(ApplicationInfo.ProcessFile));
7774
foreach (var arg in args)
7875
Console.WriteLine("Argument = {0}", arg);
7976
LogSeparator();

Source/Contrib/SimulatorTester/SimulatorTester.csproj

-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
<RootNamespace>Orts.SimulatorTester</RootNamespace>
77
<AssemblyName>Contrib.SimulatorTester</AssemblyName>
88
<ApplicationIcon>..\..\ORTS.ico</ApplicationIcon>
9-
<UseWindowsForms>true</UseWindowsForms>
10-
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
11-
<OutputPath>..\..\..\Program\</OutputPath>
129
<IsPublishable>False</IsPublishable>
1310
<AssemblyTitle>Open Rails Simulator Tester (Contributed)</AssemblyTitle>
1411
<Description>Open Rails Transport Simulator</Description>

Source/Contrib/TrackViewer/Drawing/DrawTerrain.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,14 @@ void UpdateCamera(DrawArea drawArea)
486486
float camHeight = width / device.Viewport.AspectRatio / 2;
487487
Vector3 cameraPosition = cameraTarget;
488488
cameraPosition.Y = -camHeight;
489+
float nearPlaneDistance = camHeight / 2;
490+
if (nearPlaneDistance <= 0)
491+
{
492+
// distance is too close for CreatePerspectiveFieldOfView
493+
return;
494+
}
489495
basicEffect.View = Matrix.CreateLookAt(cameraPosition, cameraTarget, new Vector3(0, 0, 1));
490-
basicEffect.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver2, device.Viewport.AspectRatio, camHeight / 2, camHeight * 2);
496+
basicEffect.Projection = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver2, device.Viewport.AspectRatio, nearPlaneDistance, camHeight * 2);
491497

492498
}
493499
#endregion
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

Source/Documentation/Manual/news.rst

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ What's been added
1515
-----------------
1616

1717
- detailed map which tracks player train
18+
- self-installing content
19+
- new rolling stock lighting controls, including horn-activated flashing lights
1820
- partial turntables
1921
- cab controls operated remotely from a tablet or control desk
2022
- animations for cab windows
@@ -30,6 +32,7 @@ What's been improved
3032
--------------------
3133

3234
- sky, sunrise and sunset appearance
35+
- auto-pilot extended to timetables
3336
- wheelslip, exhaust and steam
3437
- layout of map window
3538
- F9 menu for controlling cars and brakes

Source/Documentation/Manual/options.rst

+9-7
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,22 @@ The player can select the unit of measure of brake pressure in the
8383
When set to *automatic* the unit of measure is the same as that used in
8484
the cabview of the locomotive.
8585

86-
Other units
87-
-----------
86+
Other units of measure
87+
----------------------
8888

8989
This selects the units displayed for length, mass, pressure, etc. in the
9090
:ref:`F5 Train Driving Info Window and also the Alt+F5 HUD <driving-hud>` of the simulation.
9191

92+
These windows use the abbreviations *t-us* for short tons (2000 lb),
93+
*t-uk* for long tons (2240 lb) and *t* for metric tons (1000 kg).
94+
95+
The option *Route* sets the units based on the data in the route files. The route's TRK file may contain ``MilepostUnitsMiles ()`` or
96+
``MilepostUnitsKilometers ()`` to specify the units of distance for this route.
97+
9298
The option *Player's Location* sets the units according to the Windows
9399
*Language and Region* settings on the player's computer.
94100

95-
The option *Route* sets the units based on the data in the route files.
96-
The other options are self-explanatory.
97-
98-
These windows use the abbreviations *t-us* for short tons (2000 lb),
99-
*t-uk* for long tons (2240 lb) and *t* for metric tons (1000 kg).
101+
The other choices for units of measure are straightforward.
100102

101103
Note: The units displayed by the :ref:`F4 Track Monitor <driving-track-monitor>` (e.g. velocity and
102104
distance) are always based on data read from the route files.

Source/Documentation/Manual/start.rst

+111
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,115 @@ to close the window and save the changes to OR.
8585
Updating OR
8686
===========
8787

88+
Four update modes are provided and you can update Open Rails with a single click of a button.
89+
90+
"Stable" is the default and recommended mode.
91+
92+
"Testing" is updated more frequently than the "Stable" mode.
93+
94+
If you follow the Open Rails project on the forums, then you will hear about bug-fixes and new features.
95+
These are included in the "Unstable" version for developers and testers to try out.
96+
Once they have been checked and approved, they are published (on Fridays) as the latest "Testing" version.
97+
Any user can easily update to the current weekly "Testing" version and benefit from these improvements.
98+
99+
New versions are advertised and installed using the :ref:`Notifications <notifications>` feature.
100+
101+
You can change your current mode using Options > System > Update mode.
102+
The fourth mode is "none", which does not search for a new version.
103+
104+
105+
.. _notifications:
106+
107+
Notifications
108+
=============
109+
110+
Notifications are brief messages sent to Open Rails when you launch Open Rails.
111+
You can view these by clicking on the notifications icon and stop viewing by toggling the icon again.
112+
113+
.. image:: images/notification-icon.png
114+
115+
Old notifications persist, but when new ones are available, the icon is overlaid with a red indicator showing the number of new notifications.
116+
The icons are presented in date order with the latest one first. Step through them by clicking on the arrows:
117+
118+
.. image:: images/notification-red-indicator.png
119+
120+
Static Notifications
121+
--------------------
122+
123+
A simple notification may be shown in the same way to all users, such as:
124+
125+
.. image:: images/notification-static.png
126+
127+
Pressing the “Archive” button will launch your default browser to provide extra detail.
128+
129+
Responsive Notifications
130+
------------------------
131+
132+
Many notifications show differently depending on the user’s installation.
133+
134+
Responsive notifications are used to advise that a new version is available.
135+
If a new version is available, then the notification might be shown as:
136+
137+
.. image:: images/notification-update-available.png
138+
139+
As before, the button “What’s new” will launch your default browser to provide extra detail.
140+
The “Install” button is special and launches a seamless process to download the latest version available and use it to replace the active version.
141+
142+
Once the user has upgraded, the previous message is no longer appropriate and the notification responds to the changes by showing as:
143+
144+
.. image:: images/notification-update-installed.png
145+
146+
Privacy Note
147+
------------
148+
149+
No information is returned to the Open Rails web server.
150+
151+
Update Mode
152+
-----------
153+
154+
There are 4 update modes – Stable, Testing, Unstable and None. More details are available :ref:`here <updating-or>`.
155+
Note, however, that previously saved games may not be compatible with newer versions, as described :ref:`here <driving-saveresume>`.
156+
157+
Checking Compatibility
158+
----------------------
159+
160+
Responsive notifications are also used to check that an update is compatible with your system. For example, you might see useful warnings such as:
161+
162+
.. image:: images/notification-update-incompatible.png
163+
164+
Responding to Routes
165+
--------------------
166+
167+
These notifications can respond to the routes you have installed, so you can be advised of updates to routes you have already installed. For example, you might see:
168+
169+
.. image:: images/notification-routes.png
170+
171+
But this notification would be missing if you don’t already have the route installed.
172+
173+
Responding to Settings
174+
----------------------
175+
176+
The notifications can also respond to the settings you are using - see :ref:`Open Rails Options<options>`.
177+
178+
In this fictional example, you might see a message encouraging you to try an improved feature:
179+
180+
.. image:: images/notification-settings.png
181+
182+
However, if you have the option turned on already, then the notification is not shown.
183+
184+
Communication Error
185+
-------------------
186+
187+
If there is a problem with the Internet then the Notifications are replaced by a single prepared notification which gives a reason for the error and a chance to re-try:
188+
189+
.. image:: images/notification-error.png
190+
191+
Publishing Notifications
192+
------------------------
193+
194+
The Notifications document explains how to publish notifications and is included in the :ref:`Documents drop-down<documents>`.
195+
196+
=======
88197
When a new release of OR is available and your computer is online, a link
89198
``Update to xnnnn`` appears in the upper right corner. The string ``xnnnn`` is
90199
the release number of the newest release that matches your selected level
@@ -110,6 +219,8 @@ Tools
110219
By clicking this button you get access to the ancillary tools (see :ref:`here
111220
<intro-reality>`).
112221

222+
.. _documents:
223+
113224
Documents
114225
---------
115226

3.5 MB
Binary file not shown.

0 commit comments

Comments
 (0)