diff options
author | George Marques <george@gmarqu.es> | 2018-05-01 11:06:23 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2018-05-01 11:44:08 -0300 |
commit | decf178033d4176b0955b8efa8a081f7bccd7ed1 (patch) | |
tree | b69138dfb949dde62a8adfc206cdd9f9d478e4d9 /modules/gdscript/gdscript.h | |
parent | 613a8bee415381a8564d34092b479e1f159e8e60 (diff) | |
download | redot-engine-decf178033d4176b0955b8efa8a081f7bccd7ed1.tar.gz |
Enable autoload in editor
- Tool scripts will be executed and can be accessed by plugins.
- Other script languages can implement add/remove_named_global_constant
to make use of this functionality.
Diffstat (limited to 'modules/gdscript/gdscript.h')
-rw-r--r-- | modules/gdscript/gdscript.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 9566e3b32e..6885fbb7fe 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -262,6 +262,7 @@ class GDScriptLanguage : public ScriptLanguage { Variant *_global_array; Vector<Variant> global_array; Map<StringName, int> globals; + Map<StringName, Variant> named_globals; struct CallLevel { @@ -369,7 +370,8 @@ public: _FORCE_INLINE_ int get_global_array_size() const { return global_array.size(); } _FORCE_INLINE_ Variant *get_global_array() { return _global_array; } - _FORCE_INLINE_ const Map<StringName, int> &get_global_map() { return globals; } + _FORCE_INLINE_ const Map<StringName, int> &get_global_map() const { return globals; } + _FORCE_INLINE_ const Map<StringName, Variant> &get_named_globals_map() const { return named_globals; } _FORCE_INLINE_ static GDScriptLanguage *get_singleton() { return singleton; } @@ -403,6 +405,8 @@ public: virtual String _get_indentation() const; virtual void auto_indent_code(String &p_code, int p_from_line, int p_to_line) const; virtual void add_global_constant(const StringName &p_variable, const Variant &p_value); + virtual void add_named_global_constant(const StringName &p_name, const Variant &p_value); + virtual void remove_named_global_constant(const StringName &p_name); /* DEBUGGER FUNCTIONS */ |