Merge branch 'main' into feature/NK-95-billboard-component

This commit is contained in:
Antoine Pilote
2023-08-01 19:59:14 -04:00
5 changed files with 61 additions and 30 deletions

View File

@@ -246,7 +246,7 @@ namespace Nuake {
}
m_IsViewportFocused = ImGui::IsWindowFocused();
if (m_IsHoveringViewport && Input::IsMouseButtonPressed(GLFW_MOUSE_BUTTON_2) && !ImGuizmo::IsUsing())
if (m_IsHoveringViewport && Input::IsMouseButtonPressed(GLFW_MOUSE_BUTTON_1) && !ImGuizmo::IsUsing())
{
ImGui::FocusWindow(ImGui::GetCurrentWindow());
@@ -1375,7 +1375,7 @@ namespace Nuake {
Selection = EditorSelection();
}
if (ImGui::MenuItem("Open...", "CTRL+O"))
if (ImGui::MenuItem("Open..."))
{
OpenProject();
@@ -1406,7 +1406,7 @@ namespace Nuake {
Engine::LoadScene(Scene::New());
Selection = EditorSelection();
}
if (ImGui::MenuItem("Open scene...", "CTRL+SHIFT+O"))
if (ImGui::MenuItem("Open scene...", "CTRL+O"))
{
OpenScene();
Selection = EditorSelection();
@@ -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))
{
OpenScene();
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