Skip to content

Commit 3669181

Browse files
committed
Merge branch 'master' into installer
2 parents e1e48c4 + 418a87c commit 3669181

File tree

113 files changed

+12009
-6526
lines changed

Some content is hidden

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

113 files changed

+12009
-6526
lines changed

.github/workflows/release-pr.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
on:
2+
push:
3+
branches:
4+
- "release/*"
5+
jobs:
6+
release-pr:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Create PR
10+
uses: funivan/github-autopr@0.2.0
11+
env:
12+
GITHUB_TOKEN: ${{ github.token }}

Build.cmd

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,10 @@ IF "%Mode%" == "Stable" (
7777
)
7878
)
7979

80-
REM Get code revision.
81-
SET Revision=000
82-
IF EXIST ".git" (
83-
FOR /F "usebackq tokens=1" %%R IN (`git describe --first-parent --always`) DO SET Revision=%%R
84-
)
85-
IF "%Revision%" == "000" (
86-
>&2 ECHO WARNING: No Git revision found.
87-
)
80+
REM Get product version and code revision.
81+
FOR /F "usebackq tokens=1* delims==" %%A IN (`CALL GetVersion.cmd %Mode%`) DO SET %%A=%%B
82+
SET Version=%OpenRails_Version%
83+
SET Revision=%OpenRails_Revision%
8884

8985
REM Restore NuGet packages.
9086
nuget restore Source\ORTS.sln || GOTO :error
@@ -103,19 +99,6 @@ REM Set update channel.
10399
>>Program\Updater.ini ECHO Channel=string:%Mode% || GOTO :error
104100
ECHO Set update channel to "%Mode%".
105101

106-
REM Set version number.
107-
IF NOT "%Version%" == "" (
108-
>Program\Version.txt ECHO %Version%. || GOTO :error
109-
ECHO Set version number to "%Version%".
110-
) ELSE (
111-
>Program\Version.txt ECHO X || GOTO :error
112-
ECHO Set version number to none.
113-
)
114-
115-
REM Set revision number.
116-
>Program\Revision.txt ECHO $Revision: %Revision% $ || GOTO :error
117-
ECHO Set revision number to "%Revision%".
118-
119102
REM Build locales.
120103
PUSHD Source\Locales && CALL Update.bat non-interactive && POPD || GOTO :error
121104

@@ -134,20 +117,10 @@ IF NOT EXIST "Program\Content\Web" MKDIR "Program\Content\Web"
134117
XCOPY "Source\RunActivity\Viewer3D\WebServices\Web" "Program\Content\Web" /S /Y || GOTO :error
135118

136119
REM Copy version number from OpenRails.exe into all other 1st party files
137-
SET VersionInfoVersion=0.0.0.0
138-
IF NOT "%Version%" == "" (
139-
SET VersionInfoVersion=%Version%.%Revision%
140-
) ELSE (
141-
FOR /F "usebackq tokens=1" %%V IN (`rcedit-x86.exe "Program\OpenRails.exe" --get-version-string FileVersion`) DO SET VersionInfoVersion=%%V
142-
)
143-
IF "%VersionInfoVersion%" == "0.0.0.0" (
144-
>&2 ECHO ERROR: No VersionInfoVersion found in "Program\OpenRails.exe".
145-
GOTO :error
146-
)
147120
FOR %%F IN ("Program\*.exe", "Program\Orts.*.dll", "Program\Contrib.*.dll", "Program\Tests.dll") DO (
148-
rcedit-x86.exe "%%~F" --set-product-version %VersionInfoVersion% --set-file-version %VersionInfoVersion% --set-version-string ProductVersion %VersionInfoVersion% --set-version-string FileVersion %VersionInfoVersion% || GOTO :error
121+
rcedit-x86.exe "%%~F" --set-product-version %Revision% --set-version-string ProductVersion %Version% || GOTO :error
149122
)
150-
ECHO Set product and file version information to "%VersionInfoVersion%".
123+
ECHO Set product version information to "%Version%".
151124

152125
REM *** Special build step: signs binaries ***
153126
IF NOT "%JENKINS_TOOLS%" == "" (
@@ -183,10 +156,9 @@ IF "%Mode%" == "Stable" (
183156
IF %ERRORLEVEL% GEQ 8 GOTO :error
184157
ROBOCOPY /MIR /NJH /NJS "Program\Documentation" "Open Rails\Documentation"
185158
IF %ERRORLEVEL% GEQ 8 GOTO :error
186-
>"Source\Installer\Version.iss" ECHO #define MyAppVersion "%Version%.%Revision%" || GOTO :error
159+
>"Source\Installer\Version.iss" ECHO #define MyAppVersion "%Version%" || GOTO :error
187160
iscc "Source\Installer\Installer.iss" || GOTO :error
188161
CALL :move "Source\Installer\Output\OpenRailsSetup.exe" "OpenRails-%Mode%-Setup.exe" || GOTO :error
189-
GOTO :error
190162
REM *** Special build step: signs binaries ***
191163
IF NOT "%JENKINS_TOOLS%" == "" CALL "%JENKINS_TOOLS%\sign.cmd" "OpenRails-%Mode%-Setup.exe" || GOTO :error
192164
)

Docs/Design for Virtual Filesystem.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,22 +141,29 @@ This example has a base package for the Kuju stock stuff, an XTracks package and
141141
...
142142

143143
## Paths and References
144-
Files in a package can contain references to files in the same or other packages. For example:
144+
Files in a package can contain references to files in the same or other packages. For example,
145+
a reference from one OR content package to another:
145146

146-
/OR/SomePackage/Shapes/bungalow.s
147+
/OR/SomePackage/Shapes/bungalow.shape-or
147148

148-
refers to file
149+
which might refer to physical file:
149150

150-
C:\Users\Ryan\Open Rails\SomePackage.zip\SomePackage\Shapes\bungalow.s
151+
C:\Users\Ryan\Open Rails\SomePackage.zip\SomePackage\Shapes\bungalow.shape-or
151152

152-
Files in the MSTS-organised packages can continue to use legacy references such as:
153+
A reference from one MSTS content package to another:
154+
155+
/MSTS/SomePackage/Shapes/bungalow.s
156+
157+
This also works as a reference from an OR content package to an MSTS one.
158+
159+
References from one MSTS content package to another may also use a legacy reference such as:
153160

154161
..\..\SomePackage\Shapes\bungalow.s
155162

156-
but files in the OR-organised packages must start from the /OR root and may not use ".."
163+
but files in the OR content packages must start from the /OR root and may not use ".."
157164

158165

159166
### For OR assets that are inextricably linked with other assets (paths and activities vis-a-vis routes)
160-
An activity must be linked to a route. In OR packages, this will be achieved with a more restrictive reference:
167+
An activity must be linked to a route. In OR packages, this constraint will be achieved with a more restrictive reference, such as:
161168

162169
"Route": "/OR/SomePackage/Routes/SomeRoute.route-or"

GetVersion.cmd

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
@ECHO OFF
2+
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
3+
4+
SET Mode=%~1%
5+
FOR /F "usebackq tokens=1-2 delims=-" %%A IN (`git describe --long --exclude=*-*`) DO (
6+
SET Git.Tag=%%A
7+
SET Git.Commits=%%B
8+
)
9+
FOR /F "usebackq tokens=1-4 delims=." %%A IN (`ECHO %Git.Tag%.0.0`) DO SET Revision=%%A.%%B.%%C.%Git.Commits%
10+
GOTO %Mode%
11+
12+
13+
:stable
14+
FOR /F "usebackq tokens=* delims=-" %%A IN (`git describe`) DO SET Version=%%A
15+
GOTO :done
16+
17+
18+
:testing
19+
FOR /F "usebackq tokens=* delims=-" %%A IN (`git describe --long --exclude=*-*`) DO SET Version=%Mode:~0,1%%%A
20+
GOTO :done
21+
22+
23+
:unstable
24+
SET TZ=UTC
25+
FOR /F "usebackq tokens=1-4 delims=." %%A IN (`git log -1 --pretty^=format:%%ad --date=format-local:%%Y.%%m.%%d.%%H%%M`) DO (
26+
SET Version=%Mode:~0,1%%%A.%%B.%%C-%%D
27+
SET Revision=0.%%A.%%B%%C.%%D
28+
)
29+
GOTO :done
30+
31+
32+
:done
33+
ECHO OpenRails_Version=%Version%
34+
ECHO OpenRails_Revision=%Revision%

Source/Documentation/Manual/cabs.rst

Lines changed: 87 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,91 @@ next paragraphs.
1919
OR adds support for the ETCS circular speed gauge, as described
2020
:ref:`here <options-etcs>`.
2121

22+
.. _cabs-battery-switch:
23+
24+
Battery switch
25+
--------------
26+
27+
.. index::
28+
single: ORTS_BATTERY_SWITCH_COMMAND_SWITCH
29+
single: ORTS_BATTERY_SWITCH_COMMAND_BUTTON_CLOSE
30+
single: ORTS_BATTERY_SWITCH_ON
31+
32+
The :ref:`battery switch <physics-battery-switch>` controls the low voltage power supply of the locomotive.
33+
34+
The following controls are available for the cabview:
35+
36+
- ``ORTS_BATTERY_SWITCH_COMMAND_SWITCH`` can be used if the switch is directly controlled from the cab
37+
- ``ORTS_BATTERY_SWITCH_COMMAND_BUTTON_CLOSE`` and ``ORTS_BATTERY_SWITCH_COMMAND_BUTTON_OPEN`` can be used if the switch is controlled with two pushbuttons (one to close the switch and the other to open it)
38+
- ``ORTS_BATTERY_SWITCH_ON`` can be used to control a light on the cab showing the state of the battery switch
39+
40+
Other controls can be hidden if the low voltage power supply is not available using the following parameter::
41+
42+
TwoState (
43+
Type ( ORTS_CIRCUIT_BREAKER_CLOSED TWO_STATE)
44+
...
45+
DisabledIfLowVoltagePowerSupplyOff ( 1 )
46+
)
47+
48+
.. _cabs-master-key:
49+
50+
Master key
51+
----------
52+
53+
.. index::
54+
single: ORTS_MASTER_KEY
55+
single: ORTS_CURRENT_CAB_IN_USE
56+
single: ORTS_OTHER_CAB_IN_USE
57+
58+
The :ref:`master key <physics-master-key>` controls the power supply of the cab.
59+
60+
The following controls are available for the cabview:
61+
62+
- ``ORTS_MASTER_KEY`` can be used in order to control the master key
63+
- ``ORTS_CURRENT_CAB_IN_USE`` can be used to indicate that the current cab is active
64+
- ``ORTS_OTHER_CAB_IN_USE`` can be used to indicate that another cab of the train is active
65+
66+
Other controls can be hidden if the cab power supply is not available using the following parameter::
67+
68+
TwoState (
69+
Type ( ORTS_CIRCUIT_BREAKER_CLOSED TWO_STATE)
70+
...
71+
DisabledIfCabPowerSupplyOff ( 1 )
72+
)
73+
74+
.. _cabs-service-retention:
75+
76+
Service retention
77+
-----------------
78+
79+
.. index::
80+
single: ORTS_SERVICE_RETENTION_BUTTON
81+
single: ORTS_SERVICE_RETENTION_CANCELLATION_BUTTON
82+
83+
The :ref:`service retention <physics-service-retention>` can be used to disable a cab without cutting the power on the train.
84+
It can only be used with a power supply script that uses this functionality.
85+
86+
The following controls are available for the cabview:
87+
88+
- ``ORTS_SERVICE_RETENTION_BUTTON`` can be used in order to enable the service retention
89+
- ``ORTS_SERVICE_RETENTION_CANCELLATION_BUTTON`` can be used in order to cancel the service retention
90+
91+
.. _cabs-electric-train-supply:
92+
93+
Electric train supply
94+
---------------------
95+
96+
.. index::
97+
single: ORTS_ELECTRIC_TRAIN_SUPPLY_COMMAND_SWITCH
98+
single: ORTS_ELECTRIC_TRAIN_SUPPLY_ON
99+
100+
The :ref:`electric train supply <physics-electric-train-supply>` controls the power line that supplies the passenger cars with electricity.
101+
102+
The following controls are available for the cabview:
103+
104+
- ``ORTS_ELECTRIC_TRAIN_SUPPLY_COMMAND_SWITCH`` can be used to control the electric train supply switch
105+
- ``ORTS_ELECTRIC_TRAIN_SUPPLY_ON`` can be used to indicate that the electric train supply line is powered on
106+
22107
.. _cabs-dieselenginesonoff:
23108

24109
Controls to switch on and off diesel engines
@@ -329,18 +414,15 @@ Further OR cab controls
329414
-----------------------
330415

331416
OR supports the cabview control to open/close the left doors, the right doors
332-
and the mirrors. Moreover it supports the controls for the battery state and for
333-
the key state; these two controls have no effect on the state of the locomotive.
417+
and the mirrors.
334418

335419
.. index::
336420
single: ORTS_LEFTDOOR
337421
single: ORTS_RIGHTDOOR
338422
single: ORTS_MIRRORS
339-
single: ORTS_BATTERY
340-
single: ORTS_POWERKEY
341423

342424
The control blocks are like the one shown for the cab light. The Type strings
343-
are ORTS_LEFTDOOR, ORTS_RIGHTDOOR, ORTS_MIRRORS, ORTS_BATTERY and ORTS_POWERKEY.
425+
are ORTS_LEFTDOOR, ORTS_RIGHTDOOR and ORTS_MIRRORS.
344426

345427

346428
High-resolution Cab Backgrounds and Controls

0 commit comments

Comments
 (0)