diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-05-14 17:59:34 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-14 17:59:34 -0300 |
commit | 47d4a011d8cacbdf95f9cae6d29db1f4dc1de734 (patch) | |
tree | 6f2376ca997b9899f37f5d25aa30d515cdd91d98 /modules/gdscript/gdscript.cpp | |
parent | 92f1debf0824f8eb8e2e38450dc34542be079375 (diff) | |
parent | decf178033d4176b0955b8efa8a081f7bccd7ed1 (diff) | |
download | redot-engine-47d4a011d8cacbdf95f9cae6d29db1f4dc1de734.tar.gz |
Merge pull request #18545 from vnen/editor-autoload
Enable autoload in editor
Diffstat (limited to 'modules/gdscript/gdscript.cpp')
-rw-r--r-- | modules/gdscript/gdscript.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 4e3ee4d22c..14bdce50ec 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1333,6 +1333,15 @@ void GDScriptLanguage::add_global_constant(const StringName &p_variable, const V _add_global(p_variable, p_value); } +void GDScriptLanguage::add_named_global_constant(const StringName &p_name, const Variant &p_value) { + named_globals[p_name] = p_value; +} + +void GDScriptLanguage::remove_named_global_constant(const StringName &p_name) { + ERR_FAIL_COND(!named_globals.has(p_name)); + named_globals.erase(p_name); +} + void GDScriptLanguage::init() { //populate global constants |