Commit d35fb0e 1 parent d477589 commit d35fb0e Copy full SHA for d35fb0e
File tree 5 files changed +24
-1
lines changed
include/godot_cpp/classes
5 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ public:
250
250
} \
251
251
\
252
252
static const ::godot::StringName &get_class_static () { \
253
- static const ::godot::StringName string_name = ::godot::StringName (# m_class); \
253
+ static const ::godot::StringName string_name = ::godot::StringName (U## # m_class); \
254
254
return string_name; \
255
255
} \
256
256
\
Original file line number Diff line number Diff line change @@ -276,6 +276,10 @@ func _ready():
276
276
assert_equal (library_path , ProjectSettings .globalize_path (library_path ))
277
277
assert_equal (FileAccess .file_exists (library_path ), true )
278
278
279
+ # Test a class with a unicode name.
280
+ var przyk ład = ExamplePrzyk ład .new ()
281
+ assert_equal (przyk ład .get_the_word (), "słowo to przykład" )
282
+
279
283
exit_with_status ()
280
284
281
285
func _on_Example_custom_signal (signal_name , value ):
Original file line number Diff line number Diff line change @@ -736,3 +736,11 @@ ExampleRuntime::ExampleRuntime() {
736
736
737
737
ExampleRuntime::~ExampleRuntime () {
738
738
}
739
+
740
+ void ExamplePrzykład::_bind_methods() {
741
+ ClassDB::bind_method (D_METHOD (" get_the_word" ), &ExamplePrzykład::get_the_word);
742
+ }
743
+
744
+ String ExamplePrzykład::get_the_word() const {
745
+ return U" słowo to przykład" ;
746
+ }
Original file line number Diff line number Diff line change @@ -273,4 +273,14 @@ class ExampleRuntime : public Node {
273
273
~ExampleRuntime ();
274
274
};
275
275
276
+ class ExamplePrzyk ład : public RefCounted {
277
+ GDCLASS (ExamplePrzykład, RefCounted);
278
+
279
+ protected:
280
+ static void _bind_methods ();
281
+
282
+ public:
283
+ String get_the_word () const ;
284
+ };
285
+
276
286
#endif // EXAMPLE_CLASS_H
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ void initialize_example_module(ModuleInitializationLevel p_level) {
30
30
GDREGISTER_CLASS (ExampleBase);
31
31
GDREGISTER_CLASS (ExampleChild);
32
32
GDREGISTER_RUNTIME_CLASS (ExampleRuntime);
33
+ GDREGISTER_CLASS (ExamplePrzykład);
33
34
}
34
35
35
36
void uninitialize_example_module (ModuleInitializationLevel p_level) {
You can’t perform that action at this time.
0 commit comments