Automatically refresh filebrowser on window focus, and preserve path after scanning

This commit is contained in:
Antoine Pilote
2024-09-05 19:44:27 -04:00
parent 9e05e6883a
commit 422331dec2
11 changed files with 110 additions and 2 deletions

View File

@@ -45,6 +45,32 @@ void EditorApplication::OnInit()
}
}
m_Window->SetOnWindowFocusedCallback([&](Window& window, bool focused)
{
if (!focused)
{
return;
}
for (auto& layer : m_LayerStack)
{
layer->OnWindowFocused();
}
});
m_Window->SetOnWindowClosedCallback([](Window& window)
{
if (Engine::GetProject())
{
Engine::GetProject()->Save();
}
if (Engine::GetCurrentScene())
{
Engine::GetCurrentScene()->Save();
}
});
PushLayer(CreateScope<EditorLayer>());
}