From f262501f403d4556873a84fccdcabf9ae5cb6a14 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 3 Jun 2023 01:45:33 +0200 Subject: [PATCH] Added missing StringName conversions. --- generation/bindings_templates/method.tmpl.pyx | 3 +++ pythonscript/pandemonium/_hazmat/conversion.pxd | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/generation/bindings_templates/method.tmpl.pyx b/generation/bindings_templates/method.tmpl.pyx index bc6ddc1..7c5e16a 100644 --- a/generation/bindings_templates/method.tmpl.pyx +++ b/generation/bindings_templates/method.tmpl.pyx @@ -69,6 +69,9 @@ cdef GDString __gdstr_{{ arg.name }} = ensure_is_gdstring({{ arg.name }}) {% elif arg.type.c_type == "pandemonium_node_path" %} cdef NodePath __nodepath_{{ arg.name }} = ensure_is_nodepath({{ arg.name }}) {{ argsval }}[{{ i }}] = (&__nodepath_{{ arg.name }}._gd_data) +{% elif arg.type.c_type == "pandemonium_string_name" %} +cdef StringName __string_name_{{ arg.name }} = ensure_is_string_name({{ arg.name }}) +{{ argsval }}[{{ i }}] = (&__string_name_{{ arg.name }}._gd_data) {% elif arg.type.is_object %} {%- if arg.has_default_value and arg.default_value == "None" %} {{ argsval }}[{{ i }}] = {{ arg.name }}._gd_ptr if {{ arg.name }} is not None else NULL diff --git a/pythonscript/pandemonium/_hazmat/conversion.pxd b/pythonscript/pandemonium/_hazmat/conversion.pxd index 499b698..50b4a00 100644 --- a/pythonscript/pandemonium/_hazmat/conversion.pxd +++ b/pythonscript/pandemonium/_hazmat/conversion.pxd @@ -14,7 +14,7 @@ from pandemonium._hazmat.gdnative_api_struct cimport ( pandemonium_variant, pandemonium_variant_type, ) -from pandemonium.builtins cimport GDString, NodePath +from pandemonium.builtins cimport GDString, NodePath, StringName # Strings are now char32_t @@ -81,7 +81,7 @@ cdef pandemonium_variant_type pytype_to_pandemonium_type(object pytype) cdef GDString ensure_is_gdstring(object gdstring_or_pystr) cdef NodePath ensure_is_nodepath(object nodepath_or_pystr) - +cdef StringName ensure_is_string_name(object string_name_or_pystr) # TODO: finish this...