diff --git a/include/NazaraEditor/Core/Application/BaseApplication.hpp b/include/NazaraEditor/Core/Application/BaseApplication.hpp index e45ebaa..221e97d 100644 --- a/include/NazaraEditor/Core/Application/BaseApplication.hpp +++ b/include/NazaraEditor/Core/Application/BaseApplication.hpp @@ -35,6 +35,8 @@ namespace Nz EditorBaseApplication(); virtual ~EditorBaseApplication() = default; + void SetResourceFolder(const std::filesystem::path& path) { m_resourceFolder = path; } + std::filesystem::path GetResourceFolder() const { return m_resourceFolder; } Nz::Level& GetLevel(); bool NewLevel(); bool CloseLevel(); @@ -61,6 +63,7 @@ namespace Nz std::unique_ptr m_windowSwapchain; std::vector> m_windows; + std::filesystem::path m_resourceFolder; Nz::ActionStack m_actionStack; Nz::Level m_level; }; diff --git a/src/NazaraEditor/Editor/main.cpp b/src/NazaraEditor/Editor/main.cpp index 5f05960..2a3c0ee 100644 --- a/src/NazaraEditor/Editor/main.cpp +++ b/src/NazaraEditor/Editor/main.cpp @@ -27,7 +27,13 @@ int WinMain(int argc, char* argv[]) NazaraUnused(argv); Nz::EditorLogger logger; + + std::filesystem::path resourceDir = "assets/editor"; + if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir)) + resourceDir = "../.." / resourceDir; + NzEditor::Application app; + app.SetResourceFolder(resourceDir); ImGui::EnsureContextOnThisThread();