From e74b8f593ecd412ee410f538ac88aa8b91d24b33 Mon Sep 17 00:00:00 2001 From: danielytics Date: Wed, 7 Mar 2018 12:21:33 +0000 Subject: adds variadic printing function, makes String.format custom placeholder work --- include/core/GodotGlobal.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/core/GodotGlobal.hpp') diff --git a/include/core/GodotGlobal.hpp b/include/core/GodotGlobal.hpp index 7d28dba..a913359 100644 --- a/include/core/GodotGlobal.hpp +++ b/include/core/GodotGlobal.hpp @@ -3,6 +3,7 @@ #include #include "String.hpp" +#include "Array.hpp" namespace godot { @@ -20,6 +21,11 @@ public: static void gdnative_init(godot_gdnative_init_options *o); static void gdnative_terminate(godot_gdnative_terminate_options *o); static void nativescript_init(void *handle); + + template + static void print(const String& fmt, Args... values) { + print(fmt.format(Array::make(values...))); + } }; -- cgit v1.2.3