diff options
4 files changed, 10 insertions, 0 deletions
diff --git a/doc/classes/Directory.xml b/doc/classes/Directory.xml index 6a126204c6..a9d7960501 100644 --- a/doc/classes/Directory.xml +++ b/doc/classes/Directory.xml @@ -6,6 +6,7 @@ <description> Directory type. It is used to manage directories and their content (not restricted to the project folder). When creating a new [Directory], it must be explicitly opened using [method open] before most methods can be used. However, [method file_exists] and [method dir_exists] can be used without opening a directory. If so, they use a path relative to [code]res://[/code]. + [b]Note:[/b] Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. Use [ResourceLoader] to access imported resources. Here is an example on how to iterate through the files of a directory: [codeblocks] [gdscript] diff --git a/modules/gdnative/include/pluginscript/godot_pluginscript.h b/modules/gdnative/include/pluginscript/godot_pluginscript.h index cbd65e3772..b76f89cc99 100644 --- a/modules/gdnative/include/pluginscript/godot_pluginscript.h +++ b/modules/gdnative/include/pluginscript/godot_pluginscript.h @@ -56,6 +56,7 @@ typedef struct { int p_argcount, godot_variant_call_error *r_error); void (*notification)(godot_pluginscript_instance_data *p_data, int p_notification); + godot_string (*to_string)(godot_pluginscript_instance_data *p_data, godot_bool *r_valid); //this is used by script languages that keep a reference counter of their own //you can make make Ref<> not die when it reaches zero, so deleting the reference diff --git a/modules/gdnative/pluginscript/pluginscript_instance.cpp b/modules/gdnative/pluginscript/pluginscript_instance.cpp index 432aa80325..7f8dba0906 100644 --- a/modules/gdnative/pluginscript/pluginscript_instance.cpp +++ b/modules/gdnative/pluginscript/pluginscript_instance.cpp @@ -93,6 +93,13 @@ void PluginScriptInstance::notification(int p_notification) { _desc->notification(_data, p_notification); } +String PluginScriptInstance::to_string(bool *r_valid) { + godot_string ret = _desc->to_string(_data, r_valid); + String str_ret = *(String *)&ret; + godot_string_destroy(&ret); + return str_ret; +} + Vector<ScriptNetData> PluginScriptInstance::get_rpc_methods() const { return _script->get_rpc_methods(); } diff --git a/modules/gdnative/pluginscript/pluginscript_instance.h b/modules/gdnative/pluginscript/pluginscript_instance.h index 536eb550e0..b263c0e62c 100644 --- a/modules/gdnative/pluginscript/pluginscript_instance.h +++ b/modules/gdnative/pluginscript/pluginscript_instance.h @@ -63,6 +63,7 @@ public: virtual Variant call(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error); virtual void notification(int p_notification); + virtual String to_string(bool *r_valid); virtual Ref<Script> get_script() const; |