diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-05-09 18:09:58 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-05-09 18:09:58 -0300 |
commit | 65d48d6d39452e003381de7e2b0758f6580be197 (patch) | |
tree | 34550a346b92fcc5cf54a2a21701bb965c265b8b /modules/gdscript/gd_functions.cpp | |
parent | 1310e09c737c90b0754b9b4515958b57625631fd (diff) | |
download | redot-engine-65d48d6d39452e003381de7e2b0758f6580be197.tar.gz |
-Added prints() function, fixes #1132, #1859
-Tabs work inside built-in log window, fixes #1867
Diffstat (limited to 'modules/gdscript/gd_functions.cpp')
-rw-r--r-- | modules/gdscript/gd_functions.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/modules/gdscript/gd_functions.cpp b/modules/gdscript/gd_functions.cpp index e014921364..37ddb2bc41 100644 --- a/modules/gdscript/gd_functions.cpp +++ b/modules/gdscript/gd_functions.cpp @@ -88,6 +88,7 @@ const char *GDFunctions::get_func_name(Function p_func) { "str", "print", "printt", + "prints", "printerr", "printraw", "var2str", @@ -562,6 +563,22 @@ void GDFunctions::call(Function p_func,const Variant **p_args,int p_arg_count,Va } break; + case TEXT_PRINT_SPACED: { + + String str; + for(int i=0;i<p_arg_count;i++) { + + if (i) + str+=" "; + str+=p_args[i]->operator String(); + } + + //str+="\n"; + print_line(str); + r_ret=Variant(); + + + } break; case TEXT_PRINTERR: { @@ -1252,6 +1269,13 @@ MethodInfo GDFunctions::get_info(Function p_func) { return mi; } break; + case TEXT_PRINT_SPACED: { + + MethodInfo mi("prints",PropertyInfo(Variant::NIL,"what"),PropertyInfo(Variant::NIL,"...")); + mi.return_val.type=Variant::NIL; + return mi; + + } break; case TEXT_PRINTERR: { MethodInfo mi("printerr",PropertyInfo(Variant::NIL,"what"),PropertyInfo(Variant::NIL,"...")); |