16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 13:39:18 +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

@@ -196,7 +196,8 @@ bool ui_layer::on_key(int const Key, int const Action)
if (m_quit_active)
{
if (Key == GLFW_KEY_Y) {
glfwSetWindowShouldClose(m_window, GLFW_TRUE);
command_relay relay;
relay.post(user_command::quitsimulation, 0.0, 0.0, GLFW_PRESS, 0);
return true;
} else if (Key == GLFW_KEY_N) {
m_quit_active = false;
@@ -266,8 +267,10 @@ void ui_layer::render_quit_widget()
ImGui::SetNextWindowSize(ImVec2(0, 0));
ImGui::Begin(LOC_STR(ui_quit), &m_quit_active, ImGuiWindowFlags_NoResize);
ImGui::TextUnformatted(LOC_STR(ui_quit_simulation_q));
if (ImGui::Button(LOC_STR(ui_yes)))
glfwSetWindowShouldClose(m_window, GLFW_TRUE);
if (ImGui::Button(LOC_STR(ui_yes))) {
command_relay relay;
relay.post(user_command::quitsimulation, 0.0, 0.0, GLFW_PRESS, 0);
}
ImGui::SameLine();
if (ImGui::Button(LOC_STR(ui_no)))
m_quit_active = false;