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.
This commit is contained in:
parent
613a8bee41
commit
decf178033
10 changed files with 330 additions and 101 deletions
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue