From 0c90627a52a8ec71c70784fdcdfb109a7e1fbf48 Mon Sep 17 00:00:00 2001 From: emerycp Date: Sat, 29 Jul 2023 21:12:09 -0400 Subject: [PATCH] NK-70 - Add Menu Bar Shortcuts --- Editor/src/Windows/EditorInterface.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/Editor/src/Windows/EditorInterface.cpp b/Editor/src/Windows/EditorInterface.cpp index 111074bb..485e2cb5 100644 --- a/Editor/src/Windows/EditorInterface.cpp +++ b/Editor/src/Windows/EditorInterface.cpp @@ -1528,6 +1528,31 @@ namespace Nuake { return; } + // Shortcuts + if(ImGui::IsKeyDown(ImGuiKey_LeftCtrl)) + { + if(ImGui::IsKeyPressed(ImGuiKey_S)) + { + Engine::GetProject()->Save(); + Engine::GetCurrentScene()->Save(); + + Selection = EditorSelection(); + } + else if(ImGui::IsKeyPressed(ImGuiKey_O)) + { + OpenProject(); + + Selection = EditorSelection(); + } + else if(ImGui::IsKeyDown(ImGuiKey_LeftShift) && ImGui::IsKeyPressed(ImGuiKey_S)) + { + std::string savePath = FileDialog::SaveFile("*.project"); + Engine::GetProject()->SaveAs(savePath); + + Selection = EditorSelection(); + } + } + if (_WelcomeWindow->IsProjectQueued() && frameCount > 0) { // draw splash