diff --git a/source/main/gui/panels/GUI_ConsoleWindow.cpp b/source/main/gui/panels/GUI_ConsoleWindow.cpp index 85cc6b2273..f9e7f5159a 100644 --- a/source/main/gui/panels/GUI_ConsoleWindow.cpp +++ b/source/main/gui/panels/GUI_ConsoleWindow.cpp @@ -98,7 +98,6 @@ void ConsoleWindow::Draw() this->DrawRowText("int getNodeCount()", "game.log(' ' + game.getCurrentTruck().getNodeCount())", "Gets the total amount of nodes of the truck"); this->DrawRowCheckbox("float getTotalMass()", "game.log(' ' + game.getCurrentTruck().getTotalMass({}))", "Gets the total mass of the truck", locked, "With locked"); this->DrawRowText("int getWheelNodeCount()", "game.log(' ' + game.getCurrentTruck().getWheelNodeCount())", "Gets the total amount of nodes of the wheels of the truck"); - ImGui::NextColumn(); this->DrawRowSlider("void setMass()", "game.getCurrentTruck().setMass({})", "Sets the mass of the truck", 1000.f, 10000.f, mass); this->DrawRowText("bool getBrakeLightVisible()", "game.log(' ' + game.getCurrentTruck().getBrakeLightVisible())", "Returns true if the brake light is enabled"); this->DrawRowInt("bool getCustomLightVisible()", "game.log(' ' + game.getCurrentTruck().getCustomLightVisible({}))", "Returns true if the custom light with the number is enabled", light); @@ -225,11 +224,11 @@ void ConsoleWindow::DrawRowSlider(const char* nameStr, std::string codeStr, cons ImGui::AlignFirstTextHeightToWidgets(); ImGui::Text(descStr); ImGui::PopID(); + ImGui::NextColumn(); } void ConsoleWindow::DrawRowText(const char* nameStr, std::string codeStr, const char* descStr) { - ImGui::NextColumn(); ImGui::AlignFirstTextHeightToWidgets(); if (ImGui::Selectable(nameStr)) { App::GetScriptEngine()->executeString(codeStr); } ImGui::NextColumn(); @@ -238,11 +237,11 @@ void ConsoleWindow::DrawRowText(const char* nameStr, std::string codeStr, const ImGui::NextColumn(); ImGui::AlignFirstTextHeightToWidgets(); ImGui::Text(descStr); + ImGui::NextColumn(); } void ConsoleWindow::DrawRowCheckbox(const char* nameStr, std::string codeStr, const char* descStr, bool &var_ref, const char* label) { - ImGui::NextColumn(); ImGui::AlignFirstTextHeightToWidgets(); if (ImGui::Selectable(nameStr)) { App::GetScriptEngine()->executeString(fmt::format(codeStr, var_ref)); } ImGui::NextColumn(); @@ -251,12 +250,12 @@ void ConsoleWindow::DrawRowCheckbox(const char* nameStr, std::string codeStr, co ImGui::NextColumn(); ImGui::AlignFirstTextHeightToWidgets(); ImGui::Text(descStr); + ImGui::NextColumn(); } void ConsoleWindow::DrawRowInt(const char* nameStr, std::string codeStr, const char* descStr, int &var_ref) { ImGui::PushID(nameStr); - ImGui::NextColumn(); ImGui::AlignFirstTextHeightToWidgets(); if (ImGui::Selectable(nameStr)) { App::GetScriptEngine()->executeString(fmt::format(codeStr, var_ref)); } ImGui::NextColumn(); @@ -268,12 +267,12 @@ void ConsoleWindow::DrawRowInt(const char* nameStr, std::string codeStr, const c ImGui::AlignFirstTextHeightToWidgets(); ImGui::Text(descStr); ImGui::PopID(); + ImGui::NextColumn(); } void ConsoleWindow::DrawRowIntNode(const char* nameStr, std::string codeStr, const char* descStr, int &var_ref, int &node_x, int &node_y, int &node_z) { ImGui::PushID(nameStr); - ImGui::NextColumn(); ImGui::AlignFirstTextHeightToWidgets(); if (ImGui::Selectable(nameStr)) { App::GetScriptEngine()->executeString(fmt::format(codeStr, node_x, node_y, node_z)); } ImGui::NextColumn(); @@ -285,12 +284,12 @@ void ConsoleWindow::DrawRowIntNode(const char* nameStr, std::string codeStr, con ImGui::AlignFirstTextHeightToWidgets(); ImGui::Text(descStr); ImGui::PopID(); + ImGui::NextColumn(); } void ConsoleWindow::DrawRowIntCheckbox(const char* nameStr, std::string codeStr, const char* descStr, int &var_ref, bool &on, const char* label) { ImGui::PushID(nameStr); - ImGui::NextColumn(); ImGui::AlignFirstTextHeightToWidgets(); if (ImGui::Selectable(nameStr)) { App::GetScriptEngine()->executeString(fmt::format(codeStr, var_ref, on)); } ImGui::NextColumn(); @@ -304,4 +303,5 @@ void ConsoleWindow::DrawRowIntCheckbox(const char* nameStr, std::string codeStr, ImGui::AlignFirstTextHeightToWidgets(); ImGui::Text(descStr); ImGui::PopID(); + ImGui::NextColumn(); } \ No newline at end of file