diff --git a/Train.cpp b/Train.cpp index ef669325..72048d85 100644 --- a/Train.cpp +++ b/Train.cpp @@ -4407,12 +4407,27 @@ void TTrain::OnCommand_springbraketoggle(TTrain *Train, command_data const &Comm OnCommand_springbrakedisable(Train, Command); } } + else if (Command.action == GLFW_RELEASE) { + // release + // visual feedback + Train->ggSpringBrakeOffButton.UpdateValue(0.0, Train->dsbSwitch); + Train->ggSpringBrakeOnButton.UpdateValue(0.0, Train->dsbSwitch); + } }; void TTrain::OnCommand_springbrakeenable(TTrain *Train, command_data const &Command) { if (Command.action == GLFW_PRESS) { // only reacting to press, so the switch doesn't flip back and forth if key is held down Train->mvOccupied->SpringBrakeActivate(true); + // visual feedback + Train->ggSpringBrakeOnButton.UpdateValue(1.0, Train->dsbSwitch); + Train->ggSpringBrakeToggleButton.UpdateValue(1.0, Train->dsbSwitch); + Train->ggSpringBrakeOffButton.UpdateValue(0.0, Train->dsbSwitch); + } + else if (Command.action == GLFW_RELEASE) { + // release + // visual feedback + Train->ggSpringBrakeOnButton.UpdateValue(0.0, Train->dsbSwitch); } }; @@ -4420,6 +4435,15 @@ void TTrain::OnCommand_springbrakedisable(TTrain *Train, command_data const &Com if (Command.action == GLFW_PRESS) { // only reacting to press, so the switch doesn't flip back and forth if key is held down Train->mvOccupied->SpringBrakeActivate(false); + // visual feedback + Train->ggSpringBrakeOffButton.UpdateValue(1.0, Train->dsbSwitch); + Train->ggSpringBrakeToggleButton.UpdateValue(0.0, Train->dsbSwitch); + Train->ggSpringBrakeOnButton.UpdateValue(0.0, Train->dsbSwitch); + } + else if (Command.action == GLFW_RELEASE) { + // release + // visual feedback + Train->ggSpringBrakeOffButton.UpdateValue(0.0, Train->dsbSwitch); } }; void TTrain::OnCommand_springbrakeshutofftoggle(TTrain *Train, command_data const &Command) { @@ -6379,6 +6403,9 @@ bool TTrain::Update( double const Deltatime ) ggMainButton.Update(); ggSecurityResetButton.Update(); ggReleaserButton.Update(); + ggSpringBrakeToggleButton.Update(); + ggSpringBrakeOnButton.Update(); + ggSpringBrakeOffButton.Update(); ggUniveralBrakeButton1.Update(); ggUniveralBrakeButton2.Update(); ggUniveralBrakeButton3.Update(); @@ -7575,6 +7602,9 @@ void TTrain::clear_cab_controls() ggMainOnButton.Clear(); ggSecurityResetButton.Clear(); ggReleaserButton.Clear(); + ggSpringBrakeToggleButton.Clear(); + ggSpringBrakeOnButton.Clear(); + ggSpringBrakeOffButton.Clear(); ggUniveralBrakeButton1.Clear(); ggUniveralBrakeButton2.Clear(); ggUniveralBrakeButton3.Clear(); @@ -8239,6 +8269,9 @@ bool TTrain::initialize_gauge(cParser &Parser, std::string const &Label, int con { "main_on_bt:", ggMainOnButton }, { "security_reset_bt:", ggSecurityResetButton }, { "releaser_bt:", ggReleaserButton }, + { "springbraketoggle_bt:", ggSpringBrakeToggleButton }, + { "springbrakeon_bt:", ggSpringBrakeOnButton }, + { "springbrakeoff_bt:", ggSpringBrakeOffButton }, { "universalbrake1_bt:", ggUniveralBrakeButton1 }, { "universalbrake2_bt:", ggUniveralBrakeButton2 }, { "universalbrake3_bt:", ggUniveralBrakeButton3 }, diff --git a/Train.h b/Train.h index 70b8b4e6..2e8143f9 100644 --- a/Train.h +++ b/Train.h @@ -416,6 +416,9 @@ public: // reszta może by?publiczna TGauge ggMainButton; // EZT TGauge ggSecurityResetButton; TGauge ggReleaserButton; + TGauge ggSpringBrakeToggleButton; + TGauge ggSpringBrakeOnButton; + TGauge ggSpringBrakeOffButton; TGauge ggUniveralBrakeButton1; TGauge ggUniveralBrakeButton2; TGauge ggUniveralBrakeButton3; diff --git a/drivermouseinput.cpp b/drivermouseinput.cpp index b8b875cd..fb0a8f81 100644 --- a/drivermouseinput.cpp +++ b/drivermouseinput.cpp @@ -570,6 +570,15 @@ drivermouse_input::default_bindings() { { "releaser_bt:", { user_command::independentbrakebailoff, user_command::none } }, + { "springbraketoggle_bt:",{ + user_command::springbraketoggle, + user_command::none } }, + { "springbrakeon_bt:",{ + user_command::springbrakeenable, + user_command::none } }, + { "springbrakeoff_bt:",{ + user_command::springbrakedisable, + user_command::none } }, { "universalbrake1_bt:",{ user_command::universalbrakebutton1, user_command::none } },