Added pause button

This commit is contained in:
Antoine Pilote
2023-10-24 23:44:39 -04:00
parent 1be3ec9603
commit 5f8ac07e7b

View File

@@ -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();