From 536ea8561e00b8d6183ddc522476dd232c1d3bef Mon Sep 17 00:00:00 2001 From: David Snopek Date: Fri, 6 Sep 2024 17:24:07 -0500 Subject: Allow unicode class names --- test/src/example.cpp | 8 ++++++++ test/src/example.h | 10 ++++++++++ test/src/register_types.cpp | 1 + 3 files changed, 19 insertions(+) (limited to 'test/src') diff --git a/test/src/example.cpp b/test/src/example.cpp index 8075f55..ab85e22 100644 --- a/test/src/example.cpp +++ b/test/src/example.cpp @@ -736,3 +736,11 @@ ExampleRuntime::ExampleRuntime() { ExampleRuntime::~ExampleRuntime() { } + +void ExamplePrzykład::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_the_word"), &ExamplePrzykład::get_the_word); +} + +String ExamplePrzykład::get_the_word() const { + return U"słowo to przykład"; +} diff --git a/test/src/example.h b/test/src/example.h index 6d88cf1..6d31ca5 100644 --- a/test/src/example.h +++ b/test/src/example.h @@ -273,4 +273,14 @@ public: ~ExampleRuntime(); }; +class ExamplePrzykład : public RefCounted { + GDCLASS(ExamplePrzykład, RefCounted); + +protected: + static void _bind_methods(); + +public: + String get_the_word() const; +}; + #endif // EXAMPLE_CLASS_H diff --git a/test/src/register_types.cpp b/test/src/register_types.cpp index 7cfe689..d9290c8 100644 --- a/test/src/register_types.cpp +++ b/test/src/register_types.cpp @@ -30,6 +30,7 @@ void initialize_example_module(ModuleInitializationLevel p_level) { GDREGISTER_CLASS(ExampleBase); GDREGISTER_CLASS(ExampleChild); GDREGISTER_RUNTIME_CLASS(ExampleRuntime); + GDREGISTER_CLASS(ExamplePrzykład); } void uninitialize_example_module(ModuleInitializationLevel p_level) { -- cgit v1.2.3