feat: 'res:project' as default project

This commit is contained in:
MihailRis 2026-10-12 20:06:30 +03:00
parent ca066f46a6
commit 57fa6393c2
4 changed files with 8 additions and 1 deletions

View file

@ -86,3 +86,4 @@ inline const std::string SOUNDS_FOLDER = "sounds";
inline const std::string TEXTURES_FOLDER = "textures"; inline const std::string TEXTURES_FOLDER = "textures";
inline const std::string FONT_DEFAULT = "normal"; inline const std::string FONT_DEFAULT = "normal";
inline const std::string DEFAULT_PROJECT_PATH = "project";

View file

@ -132,7 +132,13 @@ void Engine::initialize(CoreParameters coreParameters) {
logger.info() << "engine runs in headless mode"; logger.info() << "engine runs in headless mode";
} }
if (params.projectFolder.empty()) { if (params.projectFolder.empty()) {
params.projectFolder = params.resFolder; auto mainProjectPath =
params.resFolder / std::filesystem::u8path(DEFAULT_PROJECT_PATH);
if (std::filesystem::is_directory(mainProjectPath)) {
params.projectFolder = mainProjectPath;
} else {
params.projectFolder = params.resFolder;
}
} }
paths = std::make_unique<EnginePaths>(params); paths = std::make_unique<EnginePaths>(params);
loadProject(); loadProject();