mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
(commands) add radiostopenable and radiostopdisable commands
This commit is contained in:
20
Train.cpp
20
Train.cpp
@@ -431,6 +431,8 @@ TTrain::commandhandler_map const TTrain::m_commandhandlers = {
|
||||
{ user_command::radiochannelincrease, &TTrain::OnCommand_radiochannelincrease },
|
||||
{ user_command::radiochanneldecrease, &TTrain::OnCommand_radiochanneldecrease },
|
||||
{ user_command::radiostopsend, &TTrain::OnCommand_radiostopsend },
|
||||
{ user_command::radiostopenable, &TTrain::OnCommand_radiostopenable },
|
||||
{ user_command::radiostopdisable, &TTrain::OnCommand_radiostopdisable },
|
||||
{ user_command::radiostoptest, &TTrain::OnCommand_radiostoptest },
|
||||
{ user_command::radiocall3send, &TTrain::OnCommand_radiocall3send },
|
||||
{ user_command::radiovolumeincrease, &TTrain::OnCommand_radiovolumeincrease },
|
||||
@@ -6476,6 +6478,24 @@ void TTrain::OnCommand_radiostopsend( TTrain *Train, command_data const &Command
|
||||
}
|
||||
}
|
||||
|
||||
void TTrain::OnCommand_radiostopenable( TTrain *Train, command_data const &Command ) {
|
||||
if( Command.action == GLFW_PRESS && Train->ggRadioStop.GetValue() == 0 ) {
|
||||
if( ( true == Train->mvOccupied->Radio )
|
||||
&& ( Train->mvOccupied->Power24vIsAvailable || Train->mvOccupied->Power110vIsAvailable ) ) {
|
||||
simulation::Region->RadioStop( Train->Dynamic()->GetPosition() );
|
||||
}
|
||||
// visual feedback
|
||||
Train->ggRadioStop.UpdateValue( 1.0 );
|
||||
}
|
||||
}
|
||||
|
||||
void TTrain::OnCommand_radiostopdisable( TTrain *Train, command_data const &Command ) {
|
||||
if( Command.action == GLFW_PRESS && Train->ggRadioStop.GetValue() > 0 ) {
|
||||
// visual feedback
|
||||
Train->ggRadioStop.UpdateValue( 0.0 );
|
||||
}
|
||||
}
|
||||
|
||||
void TTrain::OnCommand_radiostoptest( TTrain *Train, command_data const &Command ) {
|
||||
|
||||
if( Command.action == GLFW_PRESS ) {
|
||||
|
||||
Reference in New Issue
Block a user