Necessary fixes for wpiers switcher

This commit is contained in:
2025-03-07 02:07:08 +01:00
parent 87973d64fa
commit fa9eef8b69
3 changed files with 3 additions and 2 deletions

View File

@@ -2222,7 +2222,7 @@ void TTrain::OnCommand_wiperswitchincrease(TTrain *Train, command_data const &Co
if (Command.action == GLFW_PRESS)
{
Train->mvOccupied->wiperSwitchPos++;
if (Train->mvOccupied->wiperSwitchPos > Train->mvOccupied->WiperListSize)
if (Train->mvOccupied->wiperSwitchPos > Train->mvOccupied->WiperListSize - 1)
Train->mvOccupied->wiperSwitchPos = Train->mvOccupied->WiperListSize - 1;
// Visual feedback

View File

@@ -1115,7 +1115,7 @@ drivermouse_input::default_bindings() {
{ "invertertoggle12_bt:",{
user_command::invertertoggle12,
user_command::none } },
{ "wipers_sw:",{
{ "wieprs_sw:",{
user_command::wiperswitchincrease,
user_command::wiperswitchdecrease
} },

View File

@@ -323,6 +323,7 @@ std::string locale::label_cab_control(std::string const &Label)
{ "universal7:", STRN("interactive part") },
{ "universal8:", STRN("interactive part") },
{ "universal9:", STRN("interactive part") },
{ "wieprs_sw:", STRN("wipers mode selector") },
};
auto const it = cabcontrols_labels.find( Label );