Skip to content

Commit

Permalink
Merge pull request #982 from sweiland-openrails/SwitchPanelAlerter
Browse files Browse the repository at this point in the history
WEB based Switch Panel enhancement: Alerter
  • Loading branch information
sweiland-openrails authored Oct 11, 2024
2 parents 36608e2 + efcf19c commit 511df24
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,18 @@ private static void getStatusControlEmergencyPushButton(ref SwitchOnPanelStatus
}
}

private static void getStatusControlAlerterPushButton(ref SwitchOnPanelStatus switchOnPanelStatus)
{
MSTSLocomotive locomotive = Viewer.PlayerLocomotive as MSTSLocomotive;

if (locomotive.AlerterSnd)
{
switchOnPanelStatus.Status = "Alerter";
switchOnPanelStatus.Color = "red";
switchOnPanelStatus.Blinking = true;
}
}

private static void getStatusGameControlMode(ref SwitchOnPanelStatus switchOnPanelStatus)
{
switch (Viewer.PlayerTrain.ControlMode)
Expand Down Expand Up @@ -505,6 +517,9 @@ public static void getStatus(UserCommand userCommand, ref SwitchOnPanelStatus sw
case UserCommand.ControlEmergencyPushButton:
getStatusControlEmergencyPushButton(ref switchOnPanelStatus);
break;
case UserCommand.ControlAlerter:
getStatusControlAlerterPushButton(ref switchOnPanelStatus);
break;
case UserCommand.GameSwitchManualMode:
getStatusGameControlMode(ref switchOnPanelStatus);
break;
Expand Down

0 comments on commit 511df24

Please sign in to comment.