mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 22:09:19 +02:00
(commands) add enable/disable commands for rear lights and redmarks
This commit is contained in:
208
Train.cpp
208
Train.cpp
@@ -365,10 +365,20 @@ TTrain::commandhandler_map const TTrain::m_commandhandlers = {
|
|||||||
{ user_command::redmarkerenableright, &TTrain::OnCommand_redmarkerenableright },
|
{ user_command::redmarkerenableright, &TTrain::OnCommand_redmarkerenableright },
|
||||||
{ user_command::redmarkerdisableright, &TTrain::OnCommand_redmarkerdisableright },
|
{ user_command::redmarkerdisableright, &TTrain::OnCommand_redmarkerdisableright },
|
||||||
{ user_command::headlighttogglerearleft, &TTrain::OnCommand_headlighttogglerearleft },
|
{ user_command::headlighttogglerearleft, &TTrain::OnCommand_headlighttogglerearleft },
|
||||||
|
{ user_command::headlightenablerearleft, &TTrain::OnCommand_headlightenablerearleft },
|
||||||
|
{ user_command::headlightdisablerearleft, &TTrain::OnCommand_headlightdisablerearleft },
|
||||||
{ user_command::headlighttogglerearright, &TTrain::OnCommand_headlighttogglerearright },
|
{ user_command::headlighttogglerearright, &TTrain::OnCommand_headlighttogglerearright },
|
||||||
|
{ user_command::headlightenablerearright, &TTrain::OnCommand_headlightenablerearright },
|
||||||
|
{ user_command::headlightdisablerearright, &TTrain::OnCommand_headlightdisablerearright },
|
||||||
{ user_command::headlighttogglerearupper, &TTrain::OnCommand_headlighttogglerearupper },
|
{ user_command::headlighttogglerearupper, &TTrain::OnCommand_headlighttogglerearupper },
|
||||||
|
{ user_command::headlightenablerearupper, &TTrain::OnCommand_headlightenablerearupper },
|
||||||
|
{ user_command::headlightdisablerearupper, &TTrain::OnCommand_headlightdisablerearupper },
|
||||||
{ user_command::redmarkertogglerearleft, &TTrain::OnCommand_redmarkertogglerearleft },
|
{ user_command::redmarkertogglerearleft, &TTrain::OnCommand_redmarkertogglerearleft },
|
||||||
|
{ user_command::redmarkerenablerearleft, &TTrain::OnCommand_redmarkerenablerearleft },
|
||||||
|
{ user_command::redmarkerdisablerearleft, &TTrain::OnCommand_redmarkerdisablerearleft },
|
||||||
{ user_command::redmarkertogglerearright, &TTrain::OnCommand_redmarkertogglerearright },
|
{ user_command::redmarkertogglerearright, &TTrain::OnCommand_redmarkertogglerearright },
|
||||||
|
{ user_command::redmarkerenablerearright, &TTrain::OnCommand_redmarkerenablerearright },
|
||||||
|
{ user_command::redmarkerdisablerearright, &TTrain::OnCommand_redmarkerdisablerearright },
|
||||||
{ user_command::redmarkerstoggle, &TTrain::OnCommand_redmarkerstoggle },
|
{ user_command::redmarkerstoggle, &TTrain::OnCommand_redmarkerstoggle },
|
||||||
{ user_command::endsignalstoggle, &TTrain::OnCommand_endsignalstoggle },
|
{ user_command::endsignalstoggle, &TTrain::OnCommand_endsignalstoggle },
|
||||||
{ user_command::headlightsdimtoggle, &TTrain::OnCommand_headlightsdimtoggle },
|
{ user_command::headlightsdimtoggle, &TTrain::OnCommand_headlightsdimtoggle },
|
||||||
@@ -4443,23 +4453,74 @@ void TTrain::OnCommand_headlighttogglerearleft( TTrain *Train, command_data cons
|
|||||||
end::rear :
|
end::rear :
|
||||||
end::front ) };
|
end::front ) };
|
||||||
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
||||||
|
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::headlight_right ) == 0 ) {
|
||||||
|
OnCommand_headlightenablerearleft(Train, Command);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
OnCommand_headlightdisablerearleft(Train, Command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_headlightenablerearleft( TTrain *Train, command_data const &Command ) {
|
||||||
|
if( Train->mvOccupied->LightsPosNo > 0 ) {
|
||||||
|
// lights are controlled by preset selector
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( Command.action == GLFW_PRESS ) {
|
||||||
|
auto const vehicleotherend { (
|
||||||
|
Train->cab_to_end() == end::front ?
|
||||||
|
end::rear :
|
||||||
|
end::front ) };
|
||||||
|
// already enabled
|
||||||
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::headlight_right ) == 0 ) {
|
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::headlight_right ) == 0 ) {
|
||||||
// turn on
|
// turn on
|
||||||
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::headlight_right;
|
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::headlight_right;
|
||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggRearLeftLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
Train->ggRearLeftLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_headlightdisablerearleft( TTrain *Train, command_data const &Command ) {
|
||||||
|
if( Train->mvOccupied->LightsPosNo > 0 ) {
|
||||||
|
// lights are controlled by preset selector
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if( Command.action == GLFW_PRESS ) {
|
||||||
|
auto const vehicleotherend { (
|
||||||
|
Train->cab_to_end() == end::front ?
|
||||||
|
end::rear :
|
||||||
|
end::front ) };
|
||||||
|
// already disabled
|
||||||
|
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::headlight_right ) == 0 ) {return;}
|
||||||
|
|
||||||
//turn off
|
//turn off
|
||||||
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::headlight_right;
|
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::headlight_right;
|
||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggRearLeftLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
Train->ggRearLeftLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TTrain::OnCommand_headlighttogglerearright( TTrain *Train, command_data const &Command ) {
|
void TTrain::OnCommand_headlighttogglerearright( TTrain *Train, command_data const &Command ) {
|
||||||
|
if( Command.action == GLFW_PRESS ) {
|
||||||
|
// NOTE: we toggle the light on opposite side, as 'rear right' is 'front left' on the rear end etc
|
||||||
|
auto const vehicleotherend { (
|
||||||
|
Train->cab_to_end() == end::front ?
|
||||||
|
end::rear :
|
||||||
|
end::front ) };
|
||||||
|
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
||||||
|
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::headlight_left ) == 0 ) {
|
||||||
|
OnCommand_headlightenablerearright(Train, Command);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
OnCommand_headlightdisablerearright(Train, Command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_headlightenablerearright( TTrain *Train, command_data const &Command ) {
|
||||||
if( Train->mvOccupied->LightsPosNo > 0 ) {
|
if( Train->mvOccupied->LightsPosNo > 0 ) {
|
||||||
// lights are controlled by preset selector
|
// lights are controlled by preset selector
|
||||||
return;
|
return;
|
||||||
@@ -4471,21 +4532,37 @@ void TTrain::OnCommand_headlighttogglerearright( TTrain *Train, command_data con
|
|||||||
Train->cab_to_end() == end::front ?
|
Train->cab_to_end() == end::front ?
|
||||||
end::rear :
|
end::rear :
|
||||||
end::front ) };
|
end::front ) };
|
||||||
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
|
||||||
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::headlight_left ) == 0 ) {
|
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::headlight_left ) == 0 ) {
|
||||||
// turn on
|
// turn on
|
||||||
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::headlight_left;
|
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::headlight_left;
|
||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggRearRightLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
Train->ggRearRightLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_headlightdisablerearright( TTrain *Train, command_data const &Command ) {
|
||||||
|
if( Train->mvOccupied->LightsPosNo > 0 ) {
|
||||||
|
// lights are controlled by preset selector
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( Command.action == GLFW_PRESS ) {
|
||||||
|
// NOTE: we toggle the light on opposite side, as 'rear right' is 'front left' on the rear end etc
|
||||||
|
auto const vehicleotherend { (
|
||||||
|
Train->cab_to_end() == end::front ?
|
||||||
|
end::rear :
|
||||||
|
end::front ) };
|
||||||
|
// already disabled
|
||||||
|
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::headlight_left ) == 0 ) { return; }
|
||||||
|
|
||||||
//turn off
|
//turn off
|
||||||
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::headlight_left;
|
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::headlight_left;
|
||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggRearRightLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
Train->ggRearRightLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TTrain::OnCommand_headlighttogglerearupper( TTrain *Train, command_data const &Command ) {
|
void TTrain::OnCommand_headlighttogglerearupper( TTrain *Train, command_data const &Command ) {
|
||||||
|
|
||||||
@@ -4494,6 +4571,28 @@ void TTrain::OnCommand_headlighttogglerearupper( TTrain *Train, command_data con
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( Command.action == GLFW_PRESS ) {
|
||||||
|
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
||||||
|
auto const vehicleotherend { (
|
||||||
|
Train->cab_to_end() == end::front ?
|
||||||
|
end::rear :
|
||||||
|
end::front ) };
|
||||||
|
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::headlight_upper ) == 0 ) {
|
||||||
|
OnCommand_headlightenablerearupper(Train, Command);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
OnCommand_headlightdisablerearupper(Train, Command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_headlightenablerearupper( TTrain *Train, command_data const &Command ) {
|
||||||
|
|
||||||
|
if( Train->mvOccupied->LightsPosNo > 0 ) {
|
||||||
|
// lights are controlled by preset selector
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if( Command.action == GLFW_PRESS ) {
|
if( Command.action == GLFW_PRESS ) {
|
||||||
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
||||||
auto const vehicleotherend { (
|
auto const vehicleotherend { (
|
||||||
@@ -4506,16 +4605,50 @@ void TTrain::OnCommand_headlighttogglerearupper( TTrain *Train, command_data con
|
|||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggRearUpperLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
Train->ggRearUpperLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_headlightdisablerearupper( TTrain *Train, command_data const &Command ) {
|
||||||
|
|
||||||
|
if( Train->mvOccupied->LightsPosNo > 0 ) {
|
||||||
|
// lights are controlled by preset selector
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( Command.action == GLFW_PRESS ) {
|
||||||
|
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
||||||
|
auto const vehicleotherend { (
|
||||||
|
Train->cab_to_end() == end::front ?
|
||||||
|
end::rear :
|
||||||
|
end::front ) };
|
||||||
|
// already disabled?
|
||||||
|
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::headlight_upper ) == 0 ) { return ; }
|
||||||
|
|
||||||
//turn off
|
//turn off
|
||||||
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::headlight_upper;
|
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::headlight_upper;
|
||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggRearUpperLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
Train->ggRearUpperLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TTrain::OnCommand_redmarkertogglerearleft( TTrain *Train, command_data const &Command ) {
|
void TTrain::OnCommand_redmarkertogglerearleft( TTrain *Train, command_data const &Command ) {
|
||||||
|
if( Command.action == GLFW_PRESS ) {
|
||||||
|
// NOTE: we toggle the light on opposite side, as 'rear right' is 'front left' on the rear end etc
|
||||||
|
auto const vehicleotherend { (
|
||||||
|
Train->cab_to_end() == end::front ?
|
||||||
|
end::rear :
|
||||||
|
end::front ) };
|
||||||
|
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
||||||
|
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::redmarker_right ) == 0 ) {
|
||||||
|
OnCommand_redmarkerenablerearleft(Train, Command);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
OnCommand_redmarkerdisablerearleft(Train, Command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_redmarkerenablerearleft( TTrain *Train, command_data const &Command ) {
|
||||||
|
|
||||||
if( Train->mvOccupied->LightsPosNo > 0 ) {
|
if( Train->mvOccupied->LightsPosNo > 0 ) {
|
||||||
// lights are controlled by preset selector
|
// lights are controlled by preset selector
|
||||||
@@ -4528,21 +4661,35 @@ void TTrain::OnCommand_redmarkertogglerearleft( TTrain *Train, command_data cons
|
|||||||
Train->cab_to_end() == end::front ?
|
Train->cab_to_end() == end::front ?
|
||||||
end::rear :
|
end::rear :
|
||||||
end::front ) };
|
end::front ) };
|
||||||
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
|
||||||
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::redmarker_right ) == 0 ) {
|
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::redmarker_right ) == 0 ) {
|
||||||
// turn on
|
// turn on
|
||||||
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::redmarker_right;
|
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::redmarker_right;
|
||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggRearLeftEndLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
Train->ggRearLeftEndLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_redmarkerdisablerearleft( TTrain *Train, command_data const &Command ) {
|
||||||
|
|
||||||
|
if( Train->mvOccupied->LightsPosNo > 0 ) {
|
||||||
|
// lights are controlled by preset selector
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( Command.action == GLFW_PRESS ) {
|
||||||
|
// NOTE: we toggle the light on opposite side, as 'rear right' is 'front left' on the rear end etc
|
||||||
|
auto const vehicleotherend { (
|
||||||
|
Train->cab_to_end() == end::front ?
|
||||||
|
end::rear :
|
||||||
|
end::front ) };
|
||||||
|
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::redmarker_right ) == 0 ) { return; }
|
||||||
//turn off
|
//turn off
|
||||||
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::redmarker_right;
|
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::redmarker_right;
|
||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggRearLeftEndLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
Train->ggRearLeftEndLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TTrain::OnCommand_redmarkertogglerearright( TTrain *Train, command_data const &Command ) {
|
void TTrain::OnCommand_redmarkertogglerearright( TTrain *Train, command_data const &Command ) {
|
||||||
|
|
||||||
@@ -4558,20 +4705,57 @@ void TTrain::OnCommand_redmarkertogglerearright( TTrain *Train, command_data con
|
|||||||
end::rear :
|
end::rear :
|
||||||
end::front ) };
|
end::front ) };
|
||||||
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
// only reacting to press, so the switch doesn't flip back and forth if key is held down
|
||||||
|
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::redmarker_left ) == 0 ) {
|
||||||
|
OnCommand_redmarkerenablerearright(Train, Command);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
OnCommand_redmarkerdisablerearright(Train, Command);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_redmarkerenablerearright( TTrain *Train, command_data const &Command ) {
|
||||||
|
|
||||||
|
if( Train->mvOccupied->LightsPosNo > 0 ) {
|
||||||
|
// lights are controlled by preset selector
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( Command.action == GLFW_PRESS ) {
|
||||||
|
// NOTE: we toggle the light on opposite side, as 'rear right' is 'front left' on the rear end etc
|
||||||
|
auto const vehicleotherend { (
|
||||||
|
Train->cab_to_end() == end::front ?
|
||||||
|
end::rear :
|
||||||
|
end::front ) };
|
||||||
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::redmarker_left ) == 0 ) {
|
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::redmarker_left ) == 0 ) {
|
||||||
// turn on
|
// turn on
|
||||||
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::redmarker_left;
|
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::redmarker_left;
|
||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggRearRightEndLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
Train->ggRearRightEndLightButton.UpdateValue( 1.0, Train->dsbSwitch );
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TTrain::OnCommand_redmarkerdisablerearright( TTrain *Train, command_data const &Command ) {
|
||||||
|
|
||||||
|
if( Train->mvOccupied->LightsPosNo > 0 ) {
|
||||||
|
// lights are controlled by preset selector
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( Command.action == GLFW_PRESS ) {
|
||||||
|
// NOTE: we toggle the light on opposite side, as 'rear right' is 'front left' on the rear end etc
|
||||||
|
auto const vehicleotherend { (
|
||||||
|
Train->cab_to_end() == end::front ?
|
||||||
|
end::rear :
|
||||||
|
end::front ) };
|
||||||
|
if( ( Train->mvOccupied->iLights[ vehicleotherend ] & light::redmarker_left ) == 0 ) { return; }
|
||||||
//turn off
|
//turn off
|
||||||
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::redmarker_left;
|
Train->mvOccupied->iLights[ vehicleotherend ] ^= light::redmarker_left;
|
||||||
// visual feedback
|
// visual feedback
|
||||||
Train->ggRearRightEndLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
Train->ggRearRightEndLightButton.UpdateValue( 0.0, Train->dsbSwitch );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void TTrain::OnCommand_redmarkerstoggle( TTrain *Train, command_data const &Command ) {
|
void TTrain::OnCommand_redmarkerstoggle( TTrain *Train, command_data const &Command ) {
|
||||||
|
|
||||||
|
|||||||
10
Train.h
10
Train.h
@@ -386,10 +386,20 @@ class TTrain {
|
|||||||
static void OnCommand_redmarkerenableright( TTrain *Train, command_data const &Command );
|
static void OnCommand_redmarkerenableright( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_redmarkerdisableright( TTrain *Train, command_data const &Command );
|
static void OnCommand_redmarkerdisableright( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_headlighttogglerearleft( TTrain *Train, command_data const &Command );
|
static void OnCommand_headlighttogglerearleft( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_headlightenablerearleft( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_headlightdisablerearleft( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_headlighttogglerearright( TTrain *Train, command_data const &Command );
|
static void OnCommand_headlighttogglerearright( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_headlightenablerearright( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_headlightdisablerearright( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_headlighttogglerearupper( TTrain *Train, command_data const &Command );
|
static void OnCommand_headlighttogglerearupper( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_headlightenablerearupper( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_headlightdisablerearupper( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_redmarkertogglerearleft( TTrain *Train, command_data const &Command );
|
static void OnCommand_redmarkertogglerearleft( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_redmarkerenablerearleft( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_redmarkerdisablerearleft( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_redmarkertogglerearright( TTrain *Train, command_data const &Command );
|
static void OnCommand_redmarkertogglerearright( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_redmarkerenablerearright( TTrain *Train, command_data const &Command );
|
||||||
|
static void OnCommand_redmarkerdisablerearright( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_redmarkerstoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_redmarkerstoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_endsignalstoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_endsignalstoggle( TTrain *Train, command_data const &Command );
|
||||||
static void OnCommand_headlightsdimtoggle( TTrain *Train, command_data const &Command );
|
static void OnCommand_headlightsdimtoggle( TTrain *Train, command_data const &Command );
|
||||||
|
|||||||
10
command.cpp
10
command.cpp
@@ -216,10 +216,20 @@ commanddescription_sequence Commands_descriptions = {
|
|||||||
{ "redmarkerenableright", command_target::vehicle, command_mode::oneoff },
|
{ "redmarkerenableright", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "redmarkerdisableright", command_target::vehicle, command_mode::oneoff },
|
{ "redmarkerdisableright", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "headlighttogglerearleft", command_target::vehicle, command_mode::oneoff },
|
{ "headlighttogglerearleft", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "headlightenablerearleft", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "headlightdisablerearleft", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "headlighttogglerearright", command_target::vehicle, command_mode::oneoff },
|
{ "headlighttogglerearright", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "headlightenablerearright", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "headlightdisablerearright", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "headlighttogglerearupper", command_target::vehicle, command_mode::oneoff },
|
{ "headlighttogglerearupper", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "headlightenablerearupper", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "headlightdisablerearupper", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "redmarkertogglerearleft", command_target::vehicle, command_mode::oneoff },
|
{ "redmarkertogglerearleft", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "redmarkerenablerearleft", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "redmarkerdisablerearleft", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "redmarkertogglerearright", command_target::vehicle, command_mode::oneoff },
|
{ "redmarkertogglerearright", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "redmarkerenablerearright", command_target::vehicle, command_mode::oneoff },
|
||||||
|
{ "redmarkerdisablerearright", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "redmarkerstoggle", command_target::vehicle, command_mode::oneoff },
|
{ "redmarkerstoggle", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "endsignalstoggle", command_target::vehicle, command_mode::oneoff },
|
{ "endsignalstoggle", command_target::vehicle, command_mode::oneoff },
|
||||||
{ "headlightsdimtoggle", command_target::vehicle, command_mode::oneoff },
|
{ "headlightsdimtoggle", command_target::vehicle, command_mode::oneoff },
|
||||||
|
|||||||
10
command.h
10
command.h
@@ -211,10 +211,20 @@ enum class user_command {
|
|||||||
redmarkerenableright,
|
redmarkerenableright,
|
||||||
redmarkerdisableright,
|
redmarkerdisableright,
|
||||||
headlighttogglerearleft,
|
headlighttogglerearleft,
|
||||||
|
headlightenablerearleft,
|
||||||
|
headlightdisablerearleft,
|
||||||
headlighttogglerearright,
|
headlighttogglerearright,
|
||||||
|
headlightenablerearright,
|
||||||
|
headlightdisablerearright,
|
||||||
headlighttogglerearupper,
|
headlighttogglerearupper,
|
||||||
|
headlightenablerearupper,
|
||||||
|
headlightdisablerearupper,
|
||||||
redmarkertogglerearleft,
|
redmarkertogglerearleft,
|
||||||
|
redmarkerenablerearleft,
|
||||||
|
redmarkerdisablerearleft,
|
||||||
redmarkertogglerearright,
|
redmarkertogglerearright,
|
||||||
|
redmarkerenablerearright,
|
||||||
|
redmarkerdisablerearright,
|
||||||
redmarkerstoggle,
|
redmarkerstoggle,
|
||||||
endsignalstoggle,
|
endsignalstoggle,
|
||||||
headlightsdimtoggle,
|
headlightsdimtoggle,
|
||||||
|
|||||||
@@ -216,10 +216,20 @@ driverkeyboard_input::default_bindings() {
|
|||||||
// redmarkerenableright,
|
// redmarkerenableright,
|
||||||
// redmarkerdisableright,
|
// redmarkerdisableright,
|
||||||
{ user_command::headlighttogglerearleft, GLFW_KEY_Y | keymodifier::control },
|
{ user_command::headlighttogglerearleft, GLFW_KEY_Y | keymodifier::control },
|
||||||
|
// headlightenablerearleft
|
||||||
|
// headlightdisablerearleft
|
||||||
{ user_command::headlighttogglerearright, GLFW_KEY_I | keymodifier::control },
|
{ user_command::headlighttogglerearright, GLFW_KEY_I | keymodifier::control },
|
||||||
|
// headlightenablerearright
|
||||||
|
// headlightdisablerearright
|
||||||
{ user_command::headlighttogglerearupper, GLFW_KEY_U | keymodifier::control },
|
{ user_command::headlighttogglerearupper, GLFW_KEY_U | keymodifier::control },
|
||||||
|
// headlightenablerearupper
|
||||||
|
// headlightdisablerearupper
|
||||||
{ user_command::redmarkertogglerearleft, GLFW_KEY_Y | keymodifier::control | keymodifier::shift },
|
{ user_command::redmarkertogglerearleft, GLFW_KEY_Y | keymodifier::control | keymodifier::shift },
|
||||||
|
// redmarkerenablerearleft
|
||||||
|
// redmarkerdisablerearleft
|
||||||
{ user_command::redmarkertogglerearright, GLFW_KEY_I | keymodifier::control | keymodifier::shift },
|
{ user_command::redmarkertogglerearright, GLFW_KEY_I | keymodifier::control | keymodifier::shift },
|
||||||
|
// redmarkerenablerearright
|
||||||
|
// redmarkerdisablerearright
|
||||||
{ user_command::redmarkerstoggle, GLFW_KEY_E | keymodifier::shift },
|
{ user_command::redmarkerstoggle, GLFW_KEY_E | keymodifier::shift },
|
||||||
{ user_command::endsignalstoggle, GLFW_KEY_E },
|
{ user_command::endsignalstoggle, GLFW_KEY_E },
|
||||||
{ user_command::headlightsdimtoggle, GLFW_KEY_L | keymodifier::control },
|
{ user_command::headlightsdimtoggle, GLFW_KEY_L | keymodifier::control },
|
||||||
|
|||||||
Reference in New Issue
Block a user