summaryrefslogtreecommitdiff
path: root/script/gdscript/gd_functions.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2014-02-15 21:16:33 -0300
committerJuan Linietsky <reduzio@gmail.com>2014-02-15 21:16:33 -0300
commit8c1731b67995add31361ae526b0e6af76346181e (patch)
treef96080fdbb6e0f0f3fcc12bf10fc92928f0310cb /script/gdscript/gd_functions.cpp
parent9afdb3e0ad5bfbdafe307212f5d4ebcc7c3ac852 (diff)
-project settings are saved when changed
-load() was in the GDScript docs but missing in the scripting-different music for platformer 2D and 3D -fix how documentation is generated, built in doc browser should be always up to date -copypaste, scrolling, etc in builtin doc -built-in scripts get saved now (though debugger may not always work on them) -Theme can be set to controls as a property
Diffstat (limited to 'script/gdscript/gd_functions.cpp')
-rw-r--r--script/gdscript/gd_functions.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/script/gdscript/gd_functions.cpp b/script/gdscript/gd_functions.cpp
index 4fc45eda9e..2930d9322c 100644
--- a/script/gdscript/gd_functions.cpp
+++ b/script/gdscript/gd_functions.cpp
@@ -88,6 +88,7 @@ const char *GDFunctions::get_func_name(Function p_func) {
"printerr",
"printraw",
"range",
+ "load",
"inst2dict",
"dict2inst",
"print_stack",
@@ -668,6 +669,16 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va
}
} break;
+ case RESOURCE_LOAD: {
+ VALIDATE_ARG_COUNT(1);
+ if (p_args[0]->get_type()!=Variant::STRING) {
+ r_error.error=Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_error.argument=0;
+ r_ret=Variant();
+ }
+ r_ret=ResourceLoader::load(*p_args[0]);
+
+ }
case INST2DICT: {
VALIDATE_ARG_COUNT(1);
@@ -1170,6 +1181,12 @@ MethodInfo GDFunctions::get_info(Function p_func) {
mi.return_val.type=Variant::ARRAY;
return mi;
} break;
+ case RESOURCE_LOAD: {
+
+ MethodInfo mi("load",PropertyInfo(Variant::STRING,"path"));
+ mi.return_val.type=Variant::OBJECT;
+ return mi;
+ } break;
case INST2DICT: {
MethodInfo mi("inst2dict",PropertyInfo(Variant::OBJECT,"inst"));