From 5f8ac07e7b4ac6fd715ab83e249f46ae24b479ff Mon Sep 17 00:00:00 2001 From: Antoine Pilote Date: Tue, 24 Oct 2023 23:44:39 -0400 Subject: [PATCH] Added pause button --- Editor/src/Windows/EditorInterface.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Editor/src/Windows/EditorInterface.cpp b/Editor/src/Windows/EditorInterface.cpp index 0fdae187..aca5b9db 100644 --- a/Editor/src/Windows/EditorInterface.cpp +++ b/Editor/src/Windows/EditorInterface.cpp @@ -115,7 +115,7 @@ namespace Nuake { if (Engine::IsPlayMode()) { - if (ImGui::Button(ICON_FA_PAUSE, ImVec2(30, 30)) || (Input::IsKeyReleased(GLFW_KEY_F5))) + if (ImGui::Button(ICON_FA_PAUSE, ImVec2(30, 30)) || (Input::IsKeyPressed(GLFW_KEY_F5))) { Engine::ExitPlayMode(); @@ -125,16 +125,16 @@ namespace Nuake { } else { - if (ImGui::Button(ICON_FA_PLAY, ImVec2(30, 30)) || (Input::IsKeyReleased(GLFW_KEY_F5))) + if (ImGui::Button(ICON_FA_PLAY, ImVec2(30, 30)) || (Input::IsKeyPressed(GLFW_KEY_F5))) { - Engine::LoadScene(SceneSnapshot); - Selection = EditorSelection(); + SceneSnapshot = Engine::GetCurrentScene()->Copy(); + Engine::EnterPlayMode(); } } ImGui::SameLine(); - if ((ImGui::Button(ICON_FA_STOP, ImVec2(30, 30)) || Input::IsKeyReleased(GLFW_KEY_F8)) && Engine::IsPlayMode()) + if ((ImGui::Button(ICON_FA_STOP, ImVec2(30, 30)) || Input::IsKeyPressed(GLFW_KEY_F8)) && Engine::IsPlayMode()) { Engine::ExitPlayMode();