mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
Automatically refresh filebrowser on window focus, and preserve path after scanning
This commit is contained in:
@@ -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>());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user