Skip to content

Commit

Permalink
Electric locomotive hot start
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarBLG committed May 7, 2023
1 parent b79cb2d commit b9350ff
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions Source/Menu/Options.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Source/Menu/Options.cs
Expand Up @@ -187,6 +187,7 @@ public OptionsForm(UserSettings settings, UpdateManager updateManager, bool init
checkForcedRedAtStationStops.Checked = !Settings.NoForcedRedAtStationStops;
checkDoorsAITrains.Checked = Settings.OpenDoorsInAITrains;
checkDieselEnginesStarted.Checked = !Settings.NoDieselEngineStart; // Inverted as "EngineStart" is better UI than "NoEngineStart"
checkElectricPowerConnected.Checked = Settings.ElectricHotStart;

// Keyboard tab
InitializeKeyboardSettings();
Expand Down Expand Up @@ -472,6 +473,7 @@ void buttonOK_Click(object sender, EventArgs e)
Settings.NoForcedRedAtStationStops = !checkForcedRedAtStationStops.Checked;
Settings.OpenDoorsInAITrains = checkDoorsAITrains.Checked;
Settings.NoDieselEngineStart = !checkDieselEnginesStarted.Checked; // Inverted as "EngineStart" is better UI than "NoEngineStart"
Settings.ElectricHotStart = checkElectricPowerConnected.Checked;

// Keyboard tab
// These are edited live.
Expand Down
2 changes: 2 additions & 0 deletions Source/ORTS.Settings/UserSettings.cs
Expand Up @@ -226,6 +226,8 @@ public enum DirectXFeature
public bool HotStart { get; set; }
[Default(false)]
public bool NoDieselEngineStart { get; set; }
[Default(false)]
public bool ElectricHotStart { get; set; }

// Data logger settings:
[Default("comma")]
Expand Down
Expand Up @@ -131,6 +131,8 @@ public override void Initialize()
CurrentLocomotiveSteamHeatBoilerWaterCapacityL = L.FromGUK(800.0f);
}
}

if (Simulator.Settings.ElectricHotStart) SetPower(true);
}

//================================================================================================//
Expand Down

0 comments on commit b9350ff

Please sign in to comment.