Skip to content

Commit bdc6230

Browse files
committed
Add additional control keys for Steam Booster
1 parent 3362c71 commit bdc6230

File tree

9 files changed

+167
-124
lines changed

9 files changed

+167
-124
lines changed

Source/ORTS.Common/Input/UserCommand.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,9 @@ public enum UserCommand
193193
[GetString("Control Blower Decrease")] ControlBlowerDecrease,
194194
[GetString("Control Steam Heat Increase")] ControlSteamHeatIncrease,
195195
[GetString("Control Steam Heat Decrease")] ControlSteamHeatDecrease,
196-
[GetString("Control Steam Booster Increase")] ControlSteamBoosterIncrease,
197-
[GetString("Control Steam Booster Decrease")] ControlSteamBoosterDecrease,
196+
[GetString("Control Steam Booster Air Valve")] ControlSteamBoosterAirValve,
197+
[GetString("Control Steam Booster Idle Valve")] ControlSteamBoosterIdleValve,
198+
[GetString("Control Steam Booster Latch")] ControlSteamBoosterLatch,
198199
[GetString("Control Damper Increase")] ControlDamperIncrease,
199200
[GetString("Control Damper Decrease")] ControlDamperDecrease,
200201
[GetString("Control Firebox Open")] ControlFireboxOpen,

Source/ORTS.Settings/InputSettings.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,9 @@ static void InitializeCommands(UserCommandInput[] Commands)
356356
Commands[(int)UserCommand.ControlBlowerIncrease] = new UserCommandKeyInput(0x31);
357357
Commands[(int)UserCommand.ControlSteamHeatDecrease] = new UserCommandKeyInput(0x20, KeyModifiers.Alt);
358358
Commands[(int)UserCommand.ControlSteamHeatIncrease] = new UserCommandKeyInput(0x16, KeyModifiers.Alt);
359-
Commands[(int)UserCommand.ControlSteamBoosterDecrease] = new UserCommandKeyInput(0x11, KeyModifiers.Shift);
360-
Commands[(int)UserCommand.ControlSteamBoosterIncrease] = new UserCommandKeyInput(0x11, KeyModifiers.Alt);
359+
Commands[(int)UserCommand.ControlSteamBoosterAirValve] = new UserCommandKeyInput(0x11, KeyModifiers.Alt);
360+
Commands[(int)UserCommand.ControlSteamBoosterIdleValve] = new UserCommandKeyInput(0x25, KeyModifiers.Alt);
361+
Commands[(int)UserCommand.ControlSteamBoosterLatch] = new UserCommandKeyInput(0x25, KeyModifiers.Control);
361362
Commands[(int)UserCommand.ControlBrakeHoseConnect] = new UserCommandKeyInput(0x2B);
362363
Commands[(int)UserCommand.ControlBrakeHoseDisconnect] = new UserCommandKeyInput(0x2B, KeyModifiers.Shift);
363364
Commands[(int)UserCommand.ControlCabRadio] = new UserCommandKeyInput(0x13, KeyModifiers.Alt);

Source/Orts.Formats.Msts/CabViewFile.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ public enum CABViewControlTypes
130130
DAMPERS_FRONT,
131131
DAMPERS_BACK,
132132
STEAM_HEAT,
133-
STEAM_BOOSTER,
133+
STEAM_BOOSTER_AIR,
134+
STEAM_BOOSTER_IDLE,
135+
STEAM_BOOSTER_LATCH,
134136
WATER_INJECTOR1,
135137
WATER_INJECTOR2,
136138
SMALL_EJECTOR,

Source/Orts.Simulation/Common/Commands.cs

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,21 +1575,64 @@ public override void Redo()
15751575
// Steam controls
15761576

15771577
// Steam booster command
1578+
15781579
[Serializable()]
1579-
public sealed class ContinuousSteamBoosterCommand : ContinuousCommand
1580+
public sealed class ToggleSteamBoosterAirCommand : Command
15801581
{
15811582
public static MSTSSteamLocomotive Receiver { get; set; }
15821583

1583-
public ContinuousSteamBoosterCommand(CommandLog log, int injector, bool toState, float? target, double startTime)
1584-
: base(log, toState, target, startTime)
1584+
public ToggleSteamBoosterAirCommand(CommandLog log)
1585+
: base(log)
1586+
{
1587+
Redo();
1588+
}
1589+
1590+
public override void Redo()
1591+
{
1592+
if (Receiver == null) return;
1593+
Receiver.ToggleSteamBoosterAir();
1594+
// Report();
1595+
}
1596+
}
1597+
1598+
// Steam Booster Idle Valve
1599+
1600+
[Serializable()]
1601+
public sealed class ToggleSteamBoosterIdleCommand : Command
1602+
{
1603+
public static MSTSSteamLocomotive Receiver { get; set; }
1604+
1605+
public ToggleSteamBoosterIdleCommand(CommandLog log)
1606+
: base(log)
1607+
{
1608+
Redo();
1609+
}
1610+
1611+
public override void Redo()
1612+
{
1613+
if (Receiver == null) return;
1614+
Receiver.ToggleSteamBoosterIdle();
1615+
// Report();
1616+
}
1617+
}
1618+
1619+
// Steam Booster Latch
1620+
1621+
[Serializable()]
1622+
public sealed class ToggleSteamBoosterLatchCommand : Command
1623+
{
1624+
public static MSTSSteamLocomotive Receiver { get; set; }
1625+
1626+
public ToggleSteamBoosterLatchCommand(CommandLog log)
1627+
: base(log)
15851628
{
15861629
Redo();
15871630
}
15881631

15891632
public override void Redo()
15901633
{
15911634
if (Receiver == null) return;
1592-
Receiver.SteamBoosterChangeTo(ToState, Target);
1635+
Receiver.ToggleSteamBoosterLatch();
15931636
// Report();
15941637
}
15951638
}

Source/Orts.Simulation/Simulation/Confirmer.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ public enum CabControl {
6666
, FiringIsManual
6767
, FireShovelfull
6868
, CylinderCocks
69-
, SteamBooster
69+
, SteamBoosterAir
70+
, SteamBoosterIdle
71+
, SteamBoosterLatch
7072
, CylinderCompound
7173
, LargeEjector
7274
, SmallEjector
@@ -217,7 +219,9 @@ public Confirmer(Simulator simulator, double defaultDurationS)
217219
, new string [] { GetString("Manual Firing"), GetString("off"), null, GetString("on") }
218220
, new string [] { GetString("Fire"), null, null, GetString("add shovel-full") }
219221
, new string [] { GetString("Cylinder Cocks"), GetString("close"), null, GetString("open") }
220-
, new string [] { GetString("SteamBooster"), null, null, null, GetString("decrease"), GetString("increase") }
222+
, new string [] { GetString("Steam Booster Air Valve"), GetString("close"), null, GetString("open") }
223+
, new string [] { GetString("Steam Booster Idle Valve"), GetString("idle"), null, GetString("run") }
224+
, new string [] { GetString("Steam Booster Latch"), GetString("close"), null, GetString("open") }
221225
, new string [] { GetString("Cylinder Compound"), GetString("close"), null, GetString("open") }
222226
, new string [] { GetString("LargeEjector"), null, null, null, GetString("decrease"), GetString("increase") }
223227
, new string [] { GetString("SmallEjector"), null, null, null, GetString("decrease"), GetString("increase") }

0 commit comments

Comments
 (0)