Skip to content

Commit 3572392

Browse files
Merge branch 'openrails:master' into spanish-localization
2 parents d734c9b + ab364f3 commit 3572392

File tree

13 files changed

+182
-96
lines changed

13 files changed

+182
-96
lines changed
-42.7 KB
Loading

Source/Documentation/Manual/options.rst

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,10 @@ These windows use the abbreviations *t-us* for short tons (2000 lb),
136136
Note: The units displayed by the :ref:`F4 Track Monitor <driving-track-monitor>` (e.g. velocity and
137137
distance) are always based on data read from the route files.
138138

139-
Disable TCS scripts
139+
Enable TCS scripts
140140
-------------------
141141

142-
This option disables the train control system scripts for locomotives where
142+
This option enables the train control system scripts for locomotives where
143143
these have been implemented.
144144

145145
.. _options-web-server-port:
@@ -385,10 +385,12 @@ displayed as a message. This option is described in detail
385385
OR does not display the damage.
386386

387387

388-
Steam locomotive hot start
389-
--------------------------
388+
At game start, Steam - pre-heat boiler
389+
--------------------------------------
390390

391391
With this option selected, the temperature and pressure of steam in the boiler is ready to pull the train.
392+
Uncheck this option for a more detailed behaviour in which the player has to raise the boiler pressure.
393+
392394
If not, the boiler pressure will be at 2/3 of maximum, which is only adequate for light work.
393395
If your schedule gives you time to raise the pressure close to maximum, then
394396
switch from AI Firing to Manual Firing (Ctrl+F) and increase the Blower (N) to 100% to raise a draught.
@@ -397,6 +399,16 @@ Full pressure may be reached in 5 minutes or so.
397399

398400
The default setting is checked.
399401

402+
403+
At game start, Diesel - run engines
404+
-----------------------------------
405+
406+
When this option is checked, stationary diesel locos start the simulation with their engines running.
407+
Uncheck this option for a more detailed behaviour in which the player has to start the loco's engine.
408+
409+
The default setting is checked.
410+
411+
400412
.. _options-forced-red:
401413

402414
Forced red at station stops
@@ -466,14 +478,6 @@ With vacuum braking, it is sometimes necessary to operate two different controls
466478
With "Simple control and physics" checked, the player is able to operate the brakes just with the brake valve
467479
and doesn't need to consider the steam ejector separately.
468480

469-
Diesel engines stopped at simulation start
470-
------------------------------------------
471-
472-
When this option is unchecked, stationary diesel locos start the simulation with their engines running.
473-
Check this option for a more detailed behaviour in which the player has to start the loco's engine.
474-
475-
The default setting is unchecked.
476-
477481

478482
.. _options-keyboard:
479483

Source/Menu/Options.Designer.cs

Lines changed: 82 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Menu/Options.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ public OptionsForm(UserSettings settings, UpdateManager updateManager, bool init
142142
checkAlerterExternal.Enabled = Settings.Alerter;
143143
checkAlerterExternal.Checked = Settings.Alerter && !Settings.AlerterDisableExternal;
144144
checkOverspeedMonitor.Checked = Settings.SpeedControl;
145-
checkControlConfirmations.Checked = !Settings.SuppressConfirmations;
145+
checkControlConfirmations.Checked = !Settings.SuppressConfirmations; // Inverted as "Show confirmations" is better UI than "Suppress confirmations"
146146
checkRetainers.Checked = Settings.RetainersOnAllCars;
147147
checkGraduatedRelease.Checked = Settings.GraduatedRelease;
148148
numericBrakePipeChargingRate.Value = Settings.BrakePipeChargingRate;
149149
comboLanguage.Text = Settings.Language;
150150
comboPressureUnit.Text = Settings.PressureUnit;
151151
comboOtherUnits.Text = settings.Units;
152-
checkDisableTCSScripts.Checked = Settings.DisableTCSScripts;
152+
checkEnableTCSScripts.Checked = !Settings.DisableTCSScripts; // Inverted as "Enable scripts" is better UI than "Disable scripts"
153153
numericWebServerPort.Value = Settings.WebServerPort;
154154

155155
// Audio tab
@@ -187,10 +187,10 @@ public OptionsForm(UserSettings settings, UpdateManager updateManager, bool init
187187
numericAdhesionMovingAverageFilterSize.Value = Settings.AdhesionMovingAverageFilterSize;
188188
checkBreakCouplers.Checked = Settings.BreakCouplers;
189189
checkCurveSpeedDependent.Checked = Settings.CurveSpeedDependent;
190-
checkHotStart.Checked = Settings.HotStart;
190+
checkBoilerPreheated.Checked = Settings.HotStart;
191191
checkForcedRedAtStationStops.Checked = !Settings.NoForcedRedAtStationStops;
192192
checkDoorsAITrains.Checked = Settings.OpenDoorsInAITrains;
193-
checkBoxNoDieselEngineStart.Checked = Settings.NoDieselEngineStart;
193+
checkDieselEnginesStarted.Checked = !Settings.NoDieselEngineStart; // Inverted as "EngineStart" is better UI than "NoEngineStart"
194194

195195
// Keyboard tab
196196
InitializeKeyboardSettings();
@@ -321,7 +321,7 @@ orderby folder.Key
321321
checkAdhesionPropToWeather.Checked = Settings.AdhesionProportionalToWeather;
322322
trackAdhesionFactorChange.Value = Settings.AdhesionFactorChange;
323323
trackAdhesionFactor_ValueChanged(null, null);
324-
checkShapeWarnings.Checked = !Settings.SuppressShapeWarnings;
324+
checkShapeWarnings.Checked = !Settings.SuppressShapeWarnings; // Inverted as "Show warnings" is better UI than "Suppress warnings"
325325
precipitationBoxHeight.Value = Settings.PrecipitationBoxHeight;
326326
precipitationBoxWidth.Value = Settings.PrecipitationBoxWidth;
327327
precipitationBoxLength.Value = Settings.PrecipitationBoxLength;
@@ -429,7 +429,7 @@ void buttonOK_Click(object sender, EventArgs e)
429429
Settings.Language = comboLanguage.SelectedValue.ToString();
430430
Settings.PressureUnit = comboPressureUnit.SelectedValue.ToString();
431431
Settings.Units = comboOtherUnits.SelectedValue.ToString();
432-
Settings.DisableTCSScripts = checkDisableTCSScripts.Checked;
432+
Settings.DisableTCSScripts = !checkEnableTCSScripts.Checked; // Inverted as "Enable scripts" is better UI than "Disable scripts"
433433
Settings.WebServerPort = (int)numericWebServerPort.Value;
434434

435435
// Audio tab
@@ -461,10 +461,10 @@ void buttonOK_Click(object sender, EventArgs e)
461461
Settings.AdhesionMovingAverageFilterSize = (int)numericAdhesionMovingAverageFilterSize.Value;
462462
Settings.BreakCouplers = checkBreakCouplers.Checked;
463463
Settings.CurveSpeedDependent = checkCurveSpeedDependent.Checked;
464-
Settings.HotStart = checkHotStart.Checked;
464+
Settings.HotStart = checkBoilerPreheated.Checked;
465465
Settings.NoForcedRedAtStationStops = !checkForcedRedAtStationStops.Checked;
466466
Settings.OpenDoorsInAITrains = checkDoorsAITrains.Checked;
467-
Settings.NoDieselEngineStart = checkBoxNoDieselEngineStart.Checked;
467+
Settings.NoDieselEngineStart = !checkDieselEnginesStarted.Checked; // Inverted as "EngineStart" is better UI than "NoEngineStart"
468468

469469
// Keyboard tab
470470
// These are edited live.
@@ -818,7 +818,7 @@ private void InitializeHelpIcons()
818818
(pbLanguage, new Control[] { labelLanguage, comboLanguage }),
819819
(pbPressureUnit, new Control[] { labelPressureUnit, comboPressureUnit }),
820820
(pbOtherUnits, new Control[] { labelOtherUnits, comboOtherUnits }),
821-
(pbDisableTcsScripts, new[] { checkDisableTCSScripts }),
821+
(pbEnableTcsScripts, new[] { checkEnableTCSScripts }),
822822
(pbOverspeedMonitor, new[] { checkOverspeedMonitor }),
823823
};
824824
foreach ((PictureBox pb, Control[] controls) in helpIconControls)
@@ -873,7 +873,7 @@ private void HelpIcon_Click(object sender, EventArgs _)
873873
baseUrl + "/options.html#other-units"
874874
},
875875
{
876-
pbDisableTcsScripts,
876+
pbEnableTcsScripts,
877877
baseUrl + "/options.html#disable-tcs-scripts"
878878
},
879879
{

Source/ORTS.Common/SmoothedData.cs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,24 @@ namespace ORTS.Common
2424
{
2525
public class SmoothedData
2626
{
27-
public readonly float SmoothPeriodS = 3;
27+
const float DefaultSmoothPeriodS = 3;
28+
29+
public readonly float SmoothPeriodS;
30+
31+
protected float rate = 0;
2832
protected float value = float.NaN;
2933
protected float smoothedValue = float.NaN;
3034

3135
public SmoothedData()
36+
: this(DefaultSmoothPeriodS)
3237
{
3338
}
3439

3540
public SmoothedData(float smoothPeriodS)
36-
: this()
3741
{
3842
SmoothPeriodS = smoothPeriodS;
43+
// Convert the input assuming 60 FPS (arbitary)
44+
rate = (float)(-60 * Math.Log(1 - 1 / (60 * SmoothPeriodS)));
3945
}
4046

4147
public void Update(float periodS, float newValue)
@@ -53,13 +59,12 @@ public void Update(float periodS, float newValue)
5359

5460
protected void SmoothValue(ref float smoothedValue, float periodS, float newValue)
5561
{
56-
var rate = SmoothPeriodS / periodS;
57-
if (float.IsNaN(smoothedValue) || float.IsInfinity(smoothedValue))
58-
smoothedValue = newValue;
59-
else if (rate < 1)
62+
// This formula and the calculation of `rate` are FPS-independent; see https://www.gamedeveloper.com/programming/improved-lerp-smoothing- for more details
63+
var ratio = (float)Math.Exp(-rate * periodS);
64+
if (float.IsNaN(smoothedValue) || float.IsInfinity(smoothedValue) || ratio < 0.5)
6065
smoothedValue = newValue;
6166
else
62-
smoothedValue = (smoothedValue * (rate - 1) + newValue) / rate;
67+
smoothedValue = smoothedValue * ratio + newValue * (1 - ratio);
6368
}
6469

6570
public void ForceSmoothValue(float forcedValue)

Source/Orts.Simulation/MultiPlayer/ClientComm.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ public void Receive(object client)
8888
while (true)
8989
{
9090
bytesRead = 0;
91-
//System.Threading.Thread.Sleep(Program.Random.Next(50, 200));
9291
try
9392
{
9493
//blocks until a client sends a message

Source/Orts.Simulation/MultiPlayer/OnlinePlayer.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ public void Receive(object client)
106106

107107
while (true)
108108
{
109-
//System.Threading.Thread.Sleep(Program.Random.Next(50, 200));
110109

111110
bytesRead = 0;
112111

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ public enum SoundState
173173
public float MaxTotalCombinedWaterVolumeUKG;
174174
public MSTSNotchController WaterController = new MSTSNotchController(0, 1, 0.01f);
175175
public float CombinedTenderWaterVolumeUKG // Decreased by running injectors and increased by refilling
176-
{
177-
get { return WaterController.CurrentValue* MaxTotalCombinedWaterVolumeUKG; }
176+
{
177+
get { return WaterController.CurrentValue * MaxTotalCombinedWaterVolumeUKG; }
178178
set { WaterController.CurrentValue = value / MaxTotalCombinedWaterVolumeUKG; }
179179
}
180180

Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1400,8 +1400,8 @@ public override void Initialize()
14001400

14011401
if (RestoredCombinedTenderWaterVolumeUKG > 1.0)// Check to see if this is a restored game -(assumed so if Restored >0), then set water controller values based upon saved values
14021402
{
1403-
CombinedTenderWaterVolumeUKG = RestoredCombinedTenderWaterVolumeUKG;
14041403
MaxTotalCombinedWaterVolumeUKG = RestoredMaxTotalCombinedWaterVolumeUKG;
1404+
CombinedTenderWaterVolumeUKG = RestoredCombinedTenderWaterVolumeUKG;
14051405
}
14061406

14071407
InitializeTenderWithWater();

Source/RunActivity/Viewer3D/RollingStock/MSTSLocomotiveViewer.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2087,6 +2087,9 @@ public int GetDrawIndex()
20872087
case CABViewControlTypes.OVERSPEED:
20882088
case CABViewControlTypes.PENALTY_APP:
20892089
case CABViewControlTypes.EMERGENCY_BRAKE:
2090+
case CABViewControlTypes.ORTS_BAILOFF:
2091+
case CABViewControlTypes.ORTS_QUICKRELEASE:
2092+
case CABViewControlTypes.ORTS_OVERCHARGE:
20902093
case CABViewControlTypes.DOORS_DISPLAY:
20912094
case CABViewControlTypes.CYL_COCKS:
20922095
case CABViewControlTypes.ORTS_BLOWDOWN_VALVE:

0 commit comments

Comments
 (0)