Fixed crash when ctrl-s in project browser haha

This commit is contained in:
Antoine Pilote
2024-09-16 12:46:15 -04:00
parent 4ac7d1cfc9
commit 7f92311f12
3 changed files with 26 additions and 24 deletions

View File

@@ -3039,29 +3039,6 @@ namespace Nuake {
return;
}
// Shortcuts
if(ImGui::IsKeyDown(ImGuiKey_LeftCtrl))
{
if(ImGui::IsKeyPressed(ImGuiKey_S))
{
Engine::GetProject()->Save();
Engine::GetCurrentScene()->Save();
}
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)
{
@@ -3087,6 +3064,30 @@ namespace Nuake {
m_ProjectSettingsWindow->Init(Engine::GetProject());
}
// Shortcuts
if(ImGui::IsKeyDown(ImGuiKey_LeftCtrl))
{
if(ImGui::IsKeyPressed(ImGuiKey_S))
{
Engine::GetProject()->Save();
Engine::GetCurrentScene()->Save();
}
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();
}
}
pInterface.m_CurrentProject = Engine::GetProject();
m_ProjectSettingsWindow->Draw();