Panel variable indices

This commit is contained in:
Marc Riera 2024-12-26 00:36:56 +01:00
parent ebb673c4d5
commit a836a0e438
2 changed files with 8 additions and 9 deletions

View file

@ -346,13 +346,12 @@ namespace OpenbveFcmbTrainPlugin
}
// Panel indicators
train.Panel[25] = DeviceState == DeviceStates.Override ? 1 : 0;
train.Panel[26] = DeviceState == DeviceStates.YARD ? 1 : 0;
train.Panel[27] = DeviceState == DeviceStates.ATP ? 1 : 0;
train.Panel[28] = DeviceState == DeviceStates.ATO ? 1 : 0;
train.Panel[34] = (int)CurrentSpeedCode.CurrentLimit.KilometersPerHour * 1000;
train.Panel[33] = 1;
train.Panel[35] = (int)CurrentSpeedCode.TargetLimit.KilometersPerHour * 1000;
train.Panel[11] = TrackState > TrackStates.Unprotected && train.PhysicalHandles.Reverser == 1 ? 1 : 0;
train.Panel[12] = AtcControlState == AtcControlStates.NoPower || AtcControlState == AtcControlStates.NoPowerAlarm ? 1 : 0;
train.Panel[13] = (int)DeviceState;
train.Panel[14] = (int)CurrentSpeedCode.CurrentLimit.KilometersPerHour * 1000;
train.Panel[15] = (int)CurrentSpeedCode.TargetLimit.KilometersPerHour * 1000;
train.Panel[16] = (int)DeviceState > 1 ? 1 : 0;
// Play alarm sound
if (AtcControlState == AtcControlStates.NoPowerAlarm)

View file

@ -39,8 +39,8 @@ namespace OpenbveFcmbTrainPlugin
}
// Update panel variables for door selection state
train.Panel[50] = (RequestedDoorInterlock == DoorInterlockStates.Left || RequestedDoorInterlock == DoorInterlockStates.Unlocked) || (((train.DoorState & DoorStates.Left) != 0) && !LeftDoorsClosing) ? 1 : 0;
train.Panel[51] = (RequestedDoorInterlock == DoorInterlockStates.Right || RequestedDoorInterlock == DoorInterlockStates.Unlocked) || (((train.DoorState & DoorStates.Right) != 0) && !RightDoorsClosing) ? 1 : 0;
train.Panel[1] = (RequestedDoorInterlock == DoorInterlockStates.Left || RequestedDoorInterlock == DoorInterlockStates.Unlocked) || (((train.DoorState & DoorStates.Left) != 0) && !LeftDoorsClosing) ? 1 : 0;
train.Panel[2] = (RequestedDoorInterlock == DoorInterlockStates.Right || RequestedDoorInterlock == DoorInterlockStates.Unlocked) || (((train.DoorState & DoorStates.Right) != 0) && !RightDoorsClosing) ? 1 : 0;
}
/// <summary>Is called when the state of a key changes.</summary>