mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-20 11:29:18 +02:00
Switch for disabling mirrors
This commit is contained in:
@@ -3910,7 +3910,9 @@ bool TDynamicObject::Update(double dt, double dt1)
|
||||
}
|
||||
|
||||
// mirrors
|
||||
if( MoverParameters->Vel > MoverParameters->MirrorVelClose ) {
|
||||
if( (MoverParameters->Vel > MoverParameters->MirrorVelClose)
|
||||
|| (MoverParameters->CabActive == 0) && (activation::mirrors)
|
||||
|| (MoverParameters->MirrorForbidden) ) {
|
||||
// automatically fold mirrors when above velocity threshold
|
||||
if( dMirrorMoveL > 0.0 ) {
|
||||
dMirrorMoveL = std::max(
|
||||
|
||||
@@ -1367,6 +1367,7 @@ public:
|
||||
#endif
|
||||
double MirrorMaxShift { 90.0 };
|
||||
double MirrorVelClose { 5.0 };
|
||||
bool MirrorForbidden{ false }; /*czy jest pozwolenie na otworzenie lusterek (przycisk)*/
|
||||
bool ScndS = false; /*Czy jest bocznikowanie na szeregowej*/
|
||||
bool SpeedCtrl = false; /*czy jest tempomat*/
|
||||
speed_control SpeedCtrlUnit; /*parametry tempomatu*/
|
||||
|
||||
18
Train.cpp
18
Train.cpp
@@ -402,6 +402,7 @@ TTrain::commandhandler_map const TTrain::m_commandhandlers = {
|
||||
{ user_command::doorcloseall, &TTrain::OnCommand_doorcloseall },
|
||||
{ user_command::doorsteptoggle, &TTrain::OnCommand_doorsteptoggle },
|
||||
{ user_command::doormodetoggle, &TTrain::OnCommand_doormodetoggle },
|
||||
{ user_command::mirrorstoggle, &TTrain::OnCommand_mirrorstoggle },
|
||||
{ user_command::nearestcarcouplingincrease, &TTrain::OnCommand_nearestcarcouplingincrease },
|
||||
{ user_command::nearestcarcouplingdisconnect, &TTrain::OnCommand_nearestcarcouplingdisconnect },
|
||||
{ user_command::nearestcarcoupleradapterattach, &TTrain::OnCommand_nearestcarcoupleradapterattach },
|
||||
@@ -5928,6 +5929,21 @@ void TTrain::OnCommand_doormodetoggle( TTrain *Train, command_data const &Comman
|
||||
}
|
||||
}
|
||||
|
||||
void TTrain::OnCommand_mirrorstoggle(TTrain *Train, command_data const &Command) {
|
||||
|
||||
if (Command.action != GLFW_PRESS) { return; }
|
||||
|
||||
// only reacting to press, so the sound can loop uninterrupted
|
||||
if (false == Train->mvOccupied->MirrorForbidden) {
|
||||
// turn on
|
||||
Train->mvOccupied->MirrorForbidden = true;
|
||||
}
|
||||
else {
|
||||
// turn off
|
||||
Train->mvOccupied->MirrorForbidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
void TTrain::OnCommand_nearestcarcouplingincrease( TTrain *Train, command_data const &Command ) {
|
||||
|
||||
if( ( true == FreeFlyModeFlag )
|
||||
@@ -9913,7 +9929,7 @@ bool TTrain::initialize_gauge(cParser &Parser, std::string const &Label, int con
|
||||
{ "springbraketoggle_bt:", &mvOccupied->SpringBrake.Activate },
|
||||
{ "couplingdisconnect_sw:", &m_couplingdisconnect },
|
||||
{ "couplingdisconnectback_sw:", &m_couplingdisconnectback },
|
||||
|
||||
{ "mirrors_sw:", &mvOccupied->MirrorForbidden },
|
||||
};
|
||||
{
|
||||
auto lookup = autoboolgauges.find( Label );
|
||||
|
||||
1
Train.h
1
Train.h
@@ -422,6 +422,7 @@ class TTrain {
|
||||
static void OnCommand_doorcloseall( TTrain *Train, command_data const &Command );
|
||||
static void OnCommand_doorsteptoggle( TTrain *Train, command_data const &Command );
|
||||
static void OnCommand_doormodetoggle( TTrain *Train, command_data const &Command );
|
||||
static void OnCommand_mirrorstoggle( TTrain *Train, command_data const &Command );
|
||||
static void OnCommand_nearestcarcouplingincrease( TTrain *Train, command_data const &Command );
|
||||
static void OnCommand_nearestcarcouplingdisconnect( TTrain *Train, command_data const &Command );
|
||||
static void OnCommand_nearestcarcoupleradapterattach( TTrain *Train, command_data const &Command );
|
||||
|
||||
@@ -167,6 +167,7 @@ enum class user_command {
|
||||
doorcloseall,
|
||||
doorsteptoggle,
|
||||
doormodetoggle,
|
||||
mirrorstoggle,
|
||||
departureannounce,
|
||||
doorlocktoggle,
|
||||
pantographcompressorvalvetoggle,
|
||||
|
||||
@@ -175,6 +175,7 @@ driverkeyboard_input::default_bindings() {
|
||||
{ user_command::doorcloseall, GLFW_KEY_SLASH | keymodifier::control },
|
||||
// doorsteptoggle,
|
||||
{ user_command::doormodetoggle, GLFW_KEY_SLASH | keymodifier::shift | keymodifier::control },
|
||||
// mirrorstoggle,
|
||||
{ user_command::departureannounce, GLFW_KEY_SLASH },
|
||||
{ user_command::doorlocktoggle, GLFW_KEY_S | keymodifier::control },
|
||||
{ user_command::pantographcompressorvalvetoggle, GLFW_KEY_V | keymodifier::control },
|
||||
|
||||
@@ -708,6 +708,9 @@ drivermouse_input::default_bindings() {
|
||||
{ "doormode_sw:", {
|
||||
user_command::doormodetoggle,
|
||||
user_command::none } },
|
||||
{ "mirrors_sw:", {
|
||||
user_command::mirrorstoggle,
|
||||
user_command::none } },
|
||||
{ "departure_signal_bt:", {
|
||||
user_command::departureannounce,
|
||||
user_command::none } },
|
||||
|
||||
Reference in New Issue
Block a user