mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 18:11:13 +00:00
Mono: Lazily load scripts metadata file
- Only load the scripts metadata file when it's really needed. This way we avoid false errors, when there is no C# project, about missing scripts metadata file.
(cherry picked from commit 791e1294c3)
This commit is contained in:
parent
7577dd804a
commit
c78c38d817
4 changed files with 21 additions and 9 deletions
|
|
@ -309,14 +309,17 @@ class CSharpLanguage : public ScriptLanguage {
|
|||
int lang_idx;
|
||||
|
||||
Dictionary scripts_metadata;
|
||||
bool scripts_metadata_invalidated;
|
||||
|
||||
// For debug_break and debug_break_parse
|
||||
int _debug_parse_err_line;
|
||||
String _debug_parse_err_file;
|
||||
String _debug_error;
|
||||
|
||||
void _load_scripts_metadata();
|
||||
|
||||
friend class GDMono;
|
||||
void _uninitialize_script_bindings();
|
||||
void _on_scripts_domain_unloaded();
|
||||
|
||||
public:
|
||||
StringNameCache string_names;
|
||||
|
|
@ -341,9 +344,15 @@ public:
|
|||
void reload_assemblies(bool p_soft_reload);
|
||||
#endif
|
||||
|
||||
void project_assembly_loaded();
|
||||
_FORCE_INLINE_ Dictionary get_scripts_metadata_or_nothing() {
|
||||
return scripts_metadata_invalidated ? Dictionary() : scripts_metadata;
|
||||
}
|
||||
|
||||
_FORCE_INLINE_ const Dictionary &get_scripts_metadata() { return scripts_metadata; }
|
||||
_FORCE_INLINE_ const Dictionary &get_scripts_metadata() {
|
||||
if (scripts_metadata_invalidated)
|
||||
_load_scripts_metadata();
|
||||
return scripts_metadata;
|
||||
}
|
||||
|
||||
virtual String get_name() const;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue