mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
feat: 'user:project' as default project option
This commit is contained in:
parent
57fa6393c2
commit
03e0fd9259
1 changed files with 7 additions and 3 deletions
|
|
@ -132,10 +132,14 @@ void Engine::initialize(CoreParameters coreParameters) {
|
|||
logger.info() << "engine runs in headless mode";
|
||||
}
|
||||
if (params.projectFolder.empty()) {
|
||||
auto mainProjectPath =
|
||||
auto userDefProjectPath =
|
||||
params.userFolder / std::filesystem::u8path(DEFAULT_PROJECT_PATH);
|
||||
auto resDefProjectPath =
|
||||
params.resFolder / std::filesystem::u8path(DEFAULT_PROJECT_PATH);
|
||||
if (std::filesystem::is_directory(mainProjectPath)) {
|
||||
params.projectFolder = mainProjectPath;
|
||||
if (std::filesystem::is_directory(userDefProjectPath)) {
|
||||
params.projectFolder = userDefProjectPath;
|
||||
} else if (std::filesystem::is_directory(resDefProjectPath)) {
|
||||
params.projectFolder = resDefProjectPath;
|
||||
} else {
|
||||
params.projectFolder = params.resFolder;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue