diff options
Diffstat (limited to 'core/config')
-rw-r--r-- | core/config/engine.h | 7 | ||||
-rw-r--r-- | core/config/project_settings.cpp | 13 |
2 files changed, 11 insertions, 9 deletions
diff --git a/core/config/engine.h b/core/config/engine.h index 65ca58ba1a..1adab9b96f 100644 --- a/core/config/engine.h +++ b/core/config/engine.h @@ -72,6 +72,7 @@ private: Map<StringName, Object *> singleton_ptrs; bool editor_hint = false; + bool project_manager_hint = false; static Engine *singleton; @@ -119,9 +120,15 @@ public: #ifdef TOOLS_ENABLED _FORCE_INLINE_ void set_editor_hint(bool p_enabled) { editor_hint = p_enabled; } _FORCE_INLINE_ bool is_editor_hint() const { return editor_hint; } + + _FORCE_INLINE_ void set_project_manager_hint(bool p_enabled) { project_manager_hint = p_enabled; } + _FORCE_INLINE_ bool is_project_manager_hint() const { return project_manager_hint; } #else _FORCE_INLINE_ void set_editor_hint(bool p_enabled) {} _FORCE_INLINE_ bool is_editor_hint() const { return false; } + + _FORCE_INLINE_ void set_project_manager_hint(bool p_enabled) {} + _FORCE_INLINE_ bool is_project_manager_hint() const { return false; } #endif Dictionary get_version_info() const; diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index b5f1015ff5..93c1abe7b5 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -39,7 +39,6 @@ #include "core/io/file_access_pack.h" #include "core/io/marshalls.h" #include "core/os/keyboard.h" -#include "core/os/os.h" #include "core/variant/variant_parser.h" #include "core/version.h" @@ -146,7 +145,7 @@ String ProjectSettings::localize_path(const String &p_path) const { return p_path.simplify_path(); } - DirAccess *dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + DirAccessRef dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); String path = p_path.replace("\\", "/").simplify_path(); @@ -154,8 +153,6 @@ String ProjectSettings::localize_path(const String &p_path) const { String cwd = dir->get_current_dir(); cwd = cwd.replace("\\", "/"); - memdelete(dir); - // Ensure that we end with a '/'. // This is important to ensure that we do not wrongly localize the resource path // in an absolute path that just happens to contain this string but points to a @@ -174,8 +171,6 @@ String ProjectSettings::localize_path(const String &p_path) const { return cwd.replace_first(res_path, "res://"); } else { - memdelete(dir); - int sep = path.rfind("/"); if (sep == -1) { return "res://" + path; @@ -542,7 +537,7 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b // Nothing was found, try to find a project file in provided path (`p_path`) // or, if requested (`p_upwards`) in parent directories. - DirAccess *d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); + DirAccessRef d = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); ERR_FAIL_COND_V_MSG(!d, ERR_CANT_CREATE, "Cannot create DirAccess for path '" + p_path + "'."); d->change_dir(p_path); @@ -574,8 +569,6 @@ Error ProjectSettings::_setup(const String &p_path, const String &p_main_pack, b } } - memdelete(d); - if (!found) { return err; } @@ -1200,6 +1193,8 @@ ProjectSettings::ProjectSettings() { singleton = this; GLOBAL_DEF_BASIC("application/config/name", ""); + GLOBAL_DEF_BASIC("application/config/name_localized", Dictionary()); + custom_prop_info["application/config/name_localized"] = PropertyInfo(Variant::DICTIONARY, "application/config/name_localized", PROPERTY_HINT_LOCALIZABLE_STRING); GLOBAL_DEF_BASIC("application/config/description", ""); custom_prop_info["application/config/description"] = PropertyInfo(Variant::STRING, "application/config/description", PROPERTY_HINT_MULTILINE_TEXT); GLOBAL_DEF_BASIC("application/run/main_scene", ""); |