mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-13 06:51:51 +00:00
Merge pull request #1035 from MihailRis/default-project
Some checks are pending
x86-64 AppImage / build-appimage (ubuntu-22.04) (push) Waiting to run
Build / Build (push) Waiting to run
Macos Build / build-dmg (push) Waiting to run
Windows Build (CLang) / build-windows (clang, windows-latest) (push) Waiting to run
MSVC Build / build-windows (windows-2022) (push) Waiting to run
Some checks are pending
x86-64 AppImage / build-appimage (ubuntu-22.04) (push) Waiting to run
Build / Build (push) Waiting to run
Macos Build / build-dmg (push) Waiting to run
Windows Build (CLang) / build-windows (clang, windows-latest) (push) Waiting to run
MSVC Build / build-windows (windows-2022) (push) Waiting to run
feat: 'res:project' as default project
This commit is contained in:
commit
d03d5d2859
4 changed files with 12 additions and 1 deletions
|
|
@ -86,3 +86,4 @@ inline const std::string SOUNDS_FOLDER = "sounds";
|
|||
inline const std::string TEXTURES_FOLDER = "textures";
|
||||
|
||||
inline const std::string FONT_DEFAULT = "normal";
|
||||
inline const std::string DEFAULT_PROJECT_PATH = "project";
|
||||
|
|
|
|||
|
|
@ -132,7 +132,17 @@ void Engine::initialize(CoreParameters coreParameters) {
|
|||
logger.info() << "engine runs in headless mode";
|
||||
}
|
||||
if (params.projectFolder.empty()) {
|
||||
params.projectFolder = params.resFolder;
|
||||
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(userDefProjectPath)) {
|
||||
params.projectFolder = userDefProjectPath;
|
||||
} else if (std::filesystem::is_directory(resDefProjectPath)) {
|
||||
params.projectFolder = resDefProjectPath;
|
||||
} else {
|
||||
params.projectFolder = params.resFolder;
|
||||
}
|
||||
}
|
||||
paths = std::make_unique<EnginePaths>(params);
|
||||
loadProject();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue