From 33de53c90c42282afccbdf368896b9dc6b2eeddc Mon Sep 17 00:00:00 2001 From: milek7 Date: Tue, 2 Apr 2019 23:09:52 +0200 Subject: [PATCH] lock vehicle jumping when in motion --- widgets/vehicleparams.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/widgets/vehicleparams.cpp b/widgets/vehicleparams.cpp index 4c37b6c3..570a73fb 100644 --- a/widgets/vehicleparams.cpp +++ b/widgets/vehicleparams.cpp @@ -213,13 +213,13 @@ void ui::vehicleparams_panel::render_contents() m_relay.post(user_command::consistreleaser, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name()); if (ImGui::IsItemDeactivated()) m_relay.post(user_command::consistreleaser, 0.0, 0.0, GLFW_RELEASE, 0, glm::vec3(0.0f), &vehicle_ptr->name()); - ImGui::SameLine(); - if (ImGui::Button(LOC_STR(vehicleparams_move500f))) - m_relay.post(user_command::dynamicmove, 500.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name()); - ImGui::SameLine(); + if (vehicle_ptr->MoverParameters->V < 0.01) { + if (ImGui::Button(LOC_STR(vehicleparams_move500f))) + m_relay.post(user_command::dynamicmove, 500.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name()); + ImGui::SameLine(); - if (ImGui::Button(LOC_STR(vehicleparams_move500b))) - m_relay.post(user_command::dynamicmove, -500.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name()); - ImGui::SameLine(); + if (ImGui::Button(LOC_STR(vehicleparams_move500b))) + m_relay.post(user_command::dynamicmove, -500.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name()); + } }