16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 00:49:19 +02:00

gui changes, consist teleport command, etc

This commit is contained in:
milek7
2019-04-02 20:42:18 +02:00
parent 691f0f28b2
commit 155217243c
18 changed files with 124 additions and 44 deletions

View File

@@ -35,7 +35,9 @@ void ui::vehicleparams_panel::render_contents()
glm::vec2 uv0 = glm::vec2(proj * glm::vec3(0.0f, 1.0f, 1.0f));
glm::vec2 uv1 = glm::vec2(proj * glm::vec3(1.0f, 0.0f, 1.0f));
ImGui::Image(reinterpret_cast<void*>(std::get<1>(entry)->shared_tex), ImVec2(500, 500 * aspect), ImVec2(uv0.x, uv0.y), ImVec2(uv1.x, uv1.y));
glm::vec2 size = glm::vec2(500.0f, 500.0f * aspect) * Global.gui_screensscale;
ImGui::Image(reinterpret_cast<void*>(std::get<1>(entry)->shared_tex), ImVec2(size.x, size.y), ImVec2(uv0.x, uv0.y), ImVec2(uv1.x, uv1.y));
}
}
}
@@ -192,6 +194,11 @@ void ui::vehicleparams_panel::render_contents()
m_relay.post(user_command::resetconsist, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
ImGui::SameLine();
if (ImGui::Button(LOC_STR(vehicleparams_resetposition))) {
std::string payload = vehicle_ptr->name() + '%' + vehicle_ptr->initial_track->name();
m_relay.post(user_command::consistteleport, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &payload);
}
if (ImGui::Button(LOC_STR(vehicleparams_resetpipe)))
m_relay.post(user_command::fillcompressor, 0.0, 0.0, GLFW_PRESS, 0, glm::vec3(0.0f), &vehicle_ptr->name());
ImGui::SameLine();