add ResourceFolder to EditorBaseApplication

This commit is contained in:
SweetId 2023-10-16 19:37:22 -04:00
parent 52dcc33db4
commit eb35ee8050
2 changed files with 9 additions and 0 deletions

View File

@ -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<Nz::WindowSwapchain> m_windowSwapchain;
std::vector<std::unique_ptr<Nz::EditorWindow>> m_windows;
std::filesystem::path m_resourceFolder;
Nz::ActionStack m_actionStack;
Nz::Level m_level;
};

View File

@ -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();