diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/config/engine.h | 7 | ||||
-rw-r--r-- | core/io/resource_format_binary.cpp | 6 | ||||
-rw-r--r-- | core/string/translation.cpp | 2 |
3 files changed, 12 insertions, 3 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/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 8588bab0be..ed58b4be7b 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -678,11 +678,13 @@ Error ResourceLoaderBinary::load() { internal_resources.write[i].path = path; // Update path. } - if (cache_mode == ResourceFormatLoader::CACHE_MODE_REUSE) { - if (ResourceCache::has(path)) { + if (cache_mode == ResourceFormatLoader::CACHE_MODE_REUSE && ResourceCache::has(path)) { + RES cached = ResourceCache::get(path); + if (cached.is_valid()) { //already loaded, don't do anything stage++; error = OK; + internal_index_cache[path] = cached; continue; } } diff --git a/core/string/translation.cpp b/core/string/translation.cpp index eeac8b0acf..811ae95e9f 100644 --- a/core/string/translation.cpp +++ b/core/string/translation.cpp @@ -685,7 +685,7 @@ Ref<Translation> TranslationServer::get_tool_translation() const { String TranslationServer::get_tool_locale() { #ifdef TOOLS_ENABLED - if (TranslationServer::get_singleton()->get_tool_translation().is_valid() && (Engine::get_singleton()->is_editor_hint() || Main::is_project_manager())) { + if (TranslationServer::get_singleton()->get_tool_translation().is_valid() && (Engine::get_singleton()->is_editor_hint() || Engine::get_singleton()->is_project_manager_hint())) { return tool_translation->get_locale(); } else { #else |