From 8c1731b67995add31361ae526b0e6af76346181e Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 15 Feb 2014 21:16:33 -0300 Subject: -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 --- script/gdscript/gd_functions.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'script/gdscript/gd_functions.cpp') 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")); -- cgit v1.2.3