From ff42cb0d1e8dda98b7657fd5e3ed6be16f0d280e Mon Sep 17 00:00:00 2001 From: kobewi Date: Sun, 19 Feb 2023 21:05:16 +0100 Subject: [PATCH] Fix missing directories when exporting from cmd --- core/config/project_settings.cpp | 5 +++++ core/config/project_settings.h | 2 ++ editor/editor_paths.cpp | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index f0de22f2ef6..56e9057a2a8 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -656,6 +656,7 @@ Error ProjectSettings::setup(const String &p_path, const String &p_main_pack, bo Compression::gzip_level = GLOBAL_GET("compression/formats/gzip/compression_level"); + project_loaded = err == OK; return err; } @@ -1106,6 +1107,10 @@ bool ProjectSettings::is_using_datapack() const { return using_datapack; } +bool ProjectSettings::is_project_loaded() const { + return project_loaded; +} + bool ProjectSettings::_property_can_revert(const StringName &p_name) const { if (!props.has(p_name)) { return false; diff --git a/core/config/project_settings.h b/core/config/project_settings.h index 50cb2748319..a0249ef2673 100644 --- a/core/config/project_settings.h +++ b/core/config/project_settings.h @@ -95,6 +95,7 @@ protected: String resource_path; HashMap custom_prop_info; bool using_datapack = false; + bool project_loaded = false; List input_presets; HashSet custom_features; @@ -190,6 +191,7 @@ public: Variant get_setting_with_override(const StringName &p_name) const; bool is_using_datapack() const; + bool is_project_loaded() const; bool has_custom_feature(const String &p_feature) const; diff --git a/editor/editor_paths.cpp b/editor/editor_paths.cpp index 36ebeb8c339..389c16fd66e 100644 --- a/editor/editor_paths.cpp +++ b/editor/editor_paths.cpp @@ -218,7 +218,7 @@ EditorPaths::EditorPaths() { // Validate or create project-specific editor data dir, // including shader cache subdir. - if (Engine::get_singleton()->is_project_manager_hint() || Main::is_cmdline_tool()) { + if (Engine::get_singleton()->is_project_manager_hint() || (Main::is_cmdline_tool() && !ProjectSettings::get_singleton()->is_project_loaded())) { // Nothing to create, use shared editor data dir for shader cache. Engine::get_singleton()->set_shader_cache_path(data_dir); } else {