aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript.cpp
diff options
context:
space:
mode:
authorGeorge Marques2018-05-01 11:06:23 -0300
committerGeorge Marques2018-05-01 11:44:08 -0300
commitdecf178033d4176b0955b8efa8a081f7bccd7ed1 (patch)
treeb69138dfb949dde62a8adfc206cdd9f9d478e4d9 /modules/gdscript/gdscript.cpp
parent613a8bee415381a8564d34092b479e1f159e8e60 (diff)
downloadgodot-decf178033d4176b0955b8efa8a081f7bccd7ed1.tar.gz
godot-decf178033d4176b0955b8efa8a081f7bccd7ed1.tar.zst
godot-decf178033d4176b0955b8efa8a081f7bccd7ed1.zip
Diffstat (limited to 'modules/gdscript/gdscript.cpp')
-rw-r--r--modules/gdscript/gdscript.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp
index 4e3ee4d22..14bdce50e 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