Skip to content

Commit b11d438

Browse files
authored
GH-835 Fix enum registration (#847)
* GH-835 Fix enum registration * Store enum entries as map instead of looping over array each time * Rename godot enum id to value and provide backwards compatible api which is marked as deprecated
1 parent f8e42c3 commit b11d438

File tree

353 files changed

+4972
-4490
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

353 files changed

+4972
-4490
lines changed

harness/tests/scripts/godot/tests/Invocation.gdj

Lines changed: 148 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -7,160 +7,160 @@ relativeSourcePath = src/main/kotlin/godot/tests/Invocation.kt
77
baseType = Node3D
88
supertypes = [
99
godot.api.Node3D,
10-
godot.api.Node,
11-
godot.api.Object,
12-
godot.core.KtObject,
13-
godot.common.interop.NativeWrapper,
14-
godot.common.interop.NativePointer,
15-
kotlin.Any
10+
godot.api.Node,
11+
godot.api.Object,
12+
godot.core.KtObject,
13+
godot.common.interop.NativeWrapper,
14+
godot.common.interop.NativePointer,
15+
kotlin.Any
1616
]
1717
signals = [
1818

1919
]
2020
properties = [
2121
button,
22-
enum_list,
23-
vector_list,
24-
enum_list_mutable,
25-
register_object,
26-
register_object_nullable,
27-
register_object_nullable_pre_init,
28-
register_object_non_nullable_pre_init,
29-
vector,
30-
x,
31-
y,
32-
z,
33-
custom_name,
34-
invocation,
35-
enum_test,
36-
resource_test,
37-
jvm_id,
38-
test_array_any,
39-
nav_meshes,
40-
nullable_array,
41-
any_to_any_dictionary,
42-
nav_meshes_dictionary,
43-
nullable_dictionary,
44-
color,
45-
rid,
46-
packed_byte_array,
47-
packed_int32_array,
48-
packed_float64_array,
49-
packed_color_array,
50-
packed_string_array,
51-
packed_vector2_array,
52-
packed_vector3_array,
53-
p1,
54-
p1_1,
55-
p2,
56-
p3,
57-
p4,
58-
p5,
59-
p6,
60-
p7,
61-
p8,
62-
p9,
63-
p10,
64-
p11,
65-
p12,
66-
p13,
67-
p14,
68-
p15,
69-
p16,
70-
p17,
71-
stringtemplation,
72-
test_string,
73-
ascii_string,
74-
utf8_string
22+
enum_list,
23+
vector_list,
24+
enum_list_mutable,
25+
register_object,
26+
register_object_nullable,
27+
register_object_nullable_pre_init,
28+
register_object_non_nullable_pre_init,
29+
vector,
30+
x,
31+
y,
32+
z,
33+
custom_name,
34+
invocation,
35+
enum_test,
36+
resource_test,
37+
jvm_id,
38+
test_array_any,
39+
nav_meshes,
40+
nullable_array,
41+
any_to_any_dictionary,
42+
nav_meshes_dictionary,
43+
nullable_dictionary,
44+
color,
45+
rid,
46+
packed_byte_array,
47+
packed_int32_array,
48+
packed_float64_array,
49+
packed_color_array,
50+
packed_string_array,
51+
packed_vector2_array,
52+
packed_vector3_array,
53+
p1,
54+
p1_1,
55+
p2,
56+
p3,
57+
p4,
58+
p5,
59+
p6,
60+
p7,
61+
p8,
62+
p9,
63+
p10,
64+
p11,
65+
p12,
66+
p13,
67+
p14,
68+
p15,
69+
p16,
70+
p17,
71+
stringtemplation,
72+
test_string,
73+
ascii_string,
74+
utf8_string
7575
]
7676
functions = [
7777
int_value,
78-
long_value,
79-
float_value,
80-
double_value,
81-
boolean_value,
82-
string_value,
83-
int_addition,
84-
init_nullables,
85-
_enter_tree,
86-
_ready,
87-
get_rid_id,
88-
get_nav_mesh_rid,
89-
append_to_any_dict,
90-
remove_from_any_dict,
91-
get_from_any_dict,
92-
any_dict_size,
93-
append_to_string_nav_mesh_dict,
94-
remove_from_string_nav_mesh_dict,
95-
get_from_string_nav_mesh_dict,
96-
string_nav_mesh_dict_size,
97-
append_to_string_nav_mesh_nullable_dict,
98-
remove_from_string_nav_mesh_nullable_dict,
99-
string_nav_mesh_nullable_dict_size,
100-
append_nullable_standard_nav_mesh,
101-
append_nullable_nav_mesh,
102-
remove_nullable_nav_mesh,
103-
remove_nullable_nav_mesh_with_index,
104-
nullable_nav_meshes_size,
105-
append_standard_nav_mesh,
106-
append_nav_mesh,
107-
remove_nav_mesh,
108-
remove_nav_mesh_with_index,
109-
get_nav_mesh_from_array,
110-
nav_meshes_size,
111-
append_any_to_array,
112-
remove_any_from_array,
113-
get_any_from_array,
114-
array_any_size,
115-
count_namesh_instance,
116-
get_nav_mesh_count,
117-
parent_is_node3_d,
118-
is_object_node3_d,
119-
other_jvm_id,
120-
has_camera_node,
121-
add_byte_to_packed_array,
122-
add_byte_array_to_packed_array,
123-
delete_byte_from_packed_array,
124-
get_byte_from_packed_array,
125-
set_byte_in_packed_array,
126-
resize_byte_packed_array,
127-
add_color_to_packed_array,
128-
add_color_array_to_packed_array,
129-
delete_color_from_packed_array,
130-
get_color_from_packed_array,
131-
set_color_in_packed_array,
132-
resize_color_packed_array,
133-
add_int_to_packed_array,
134-
add_int_array_to_packed_array,
135-
delete_int_from_packed_array,
136-
get_int_from_packed_array,
137-
set_int_in_packed_array,
138-
resize_int_packed_array,
139-
add_real_to_packed_array,
140-
add_real_array_to_packed_array,
141-
read_string_from_byte_array,
142-
delete_real_from_packed_array,
143-
get_real_from_packed_array,
144-
set_real_in_packed_array,
145-
resize_real_packed_array,
146-
add_string_to_packed_array,
147-
add_string_array_to_packed_array,
148-
delete_string_from_packed_array,
149-
get_string_from_packed_array,
150-
set_string_in_packed_array,
151-
resize_string_packed_array,
152-
add_vector2_to_packed_array,
153-
add_vector2_array_to_packed_array,
154-
delete_vector2_from_packed_array,
155-
get_vector2_from_packed_array,
156-
set_vector2_in_packed_array,
157-
resize_vector2_packed_array,
158-
add_vector3_to_packed_array,
159-
add_vector3_array_to_packed_array,
160-
delete_vector3_from_packed_array,
161-
get_vector3_from_packed_array,
162-
set_vector3_in_packed_array,
163-
resize_vector3_packed_array,
164-
is_sent_xr_same_instance_as_jvm_singleton,
165-
create_variant_array_of_user_type
166-
]
78+
long_value,
79+
float_value,
80+
double_value,
81+
boolean_value,
82+
string_value,
83+
int_addition,
84+
init_nullables,
85+
_enter_tree,
86+
_ready,
87+
get_rid_id,
88+
get_nav_mesh_rid,
89+
append_to_any_dict,
90+
remove_from_any_dict,
91+
get_from_any_dict,
92+
any_dict_size,
93+
append_to_string_nav_mesh_dict,
94+
remove_from_string_nav_mesh_dict,
95+
get_from_string_nav_mesh_dict,
96+
string_nav_mesh_dict_size,
97+
append_to_string_nav_mesh_nullable_dict,
98+
remove_from_string_nav_mesh_nullable_dict,
99+
string_nav_mesh_nullable_dict_size,
100+
append_nullable_standard_nav_mesh,
101+
append_nullable_nav_mesh,
102+
remove_nullable_nav_mesh,
103+
remove_nullable_nav_mesh_with_index,
104+
nullable_nav_meshes_size,
105+
append_standard_nav_mesh,
106+
append_nav_mesh,
107+
remove_nav_mesh,
108+
remove_nav_mesh_with_index,
109+
get_nav_mesh_from_array,
110+
nav_meshes_size,
111+
append_any_to_array,
112+
remove_any_from_array,
113+
get_any_from_array,
114+
array_any_size,
115+
count_namesh_instance,
116+
get_nav_mesh_count,
117+
parent_is_node3_d,
118+
is_object_node3_d,
119+
other_jvm_id,
120+
has_camera_node,
121+
add_byte_to_packed_array,
122+
add_byte_array_to_packed_array,
123+
delete_byte_from_packed_array,
124+
get_byte_from_packed_array,
125+
set_byte_in_packed_array,
126+
resize_byte_packed_array,
127+
add_color_to_packed_array,
128+
add_color_array_to_packed_array,
129+
delete_color_from_packed_array,
130+
get_color_from_packed_array,
131+
set_color_in_packed_array,
132+
resize_color_packed_array,
133+
add_int_to_packed_array,
134+
add_int_array_to_packed_array,
135+
delete_int_from_packed_array,
136+
get_int_from_packed_array,
137+
set_int_in_packed_array,
138+
resize_int_packed_array,
139+
add_real_to_packed_array,
140+
add_real_array_to_packed_array,
141+
read_string_from_byte_array,
142+
delete_real_from_packed_array,
143+
get_real_from_packed_array,
144+
set_real_in_packed_array,
145+
resize_real_packed_array,
146+
add_string_to_packed_array,
147+
add_string_array_to_packed_array,
148+
delete_string_from_packed_array,
149+
get_string_from_packed_array,
150+
set_string_in_packed_array,
151+
resize_string_packed_array,
152+
add_vector2_to_packed_array,
153+
add_vector2_array_to_packed_array,
154+
delete_vector2_from_packed_array,
155+
get_vector2_from_packed_array,
156+
set_vector2_in_packed_array,
157+
resize_vector2_packed_array,
158+
add_vector3_to_packed_array,
159+
add_vector3_array_to_packed_array,
160+
delete_vector3_from_packed_array,
161+
get_vector3_from_packed_array,
162+
set_vector3_in_packed_array,
163+
resize_vector3_packed_array,
164+
is_sent_xr_same_instance_as_jvm_singleton,
165+
create_variant_array_of_user_type
166+
]

harness/tests/scripts/godot/tests/packedarray/PackedArrayTest.gdj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,15 @@ functions = [
2525
convert_long_array,
2626
convert_float_array,
2727
convert_double_array,
28+
convert_vector2_array,
29+
convert_vector3_array,
30+
convert_vector4_array,
2831
get_byte_array_value,
2932
get_int_array_value,
3033
get_long_array_value,
3134
get_float_array_value,
32-
get_double_array_value
35+
get_double_array_value,
36+
get_vector2_array_value,
37+
get_vector3_array_value,
38+
get_vector4_array_value
3339
]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// THIS FILE IS GENERATED! DO NOT EDIT OR DELETE IT. EDIT OR DELETE THE ASSOCIATED SOURCE CODE FILE INSTEAD
2+
// Note: You can however freely move this file inside your godot project if you want. Keep in mind however, that if you rename the originating source code file, this file will be deleted and regenerated as a new file instead of being updated! Other modifications to the source file however, will result in this file being updated.
3+
4+
registeredName = EnumRegistration
5+
fqName = godot.tests.registration.EnumRegistration
6+
relativeSourcePath = src/main/kotlin/godot/tests/registration/EnumRegistration.kt
7+
baseType = Node
8+
supertypes = [
9+
godot.api.Node,
10+
godot.api.Object,
11+
godot.core.KtObject,
12+
godot.common.interop.NativeWrapper,
13+
godot.common.interop.NativePointer,
14+
kotlin.Any
15+
]
16+
signals = [
17+
18+
]
19+
properties = [
20+
enum_value,
21+
godot_error_enum_value,
22+
godot_enum_value
23+
]
24+
functions = [
25+
provide_enum_value,
26+
provide_godot_error_enum_value,
27+
provide_godot_enum_value
28+
]

harness/tests/src/main/java/godot/tests/JavaTestClass.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public void connectAndTriggerSignal() {
9999
connect(
100100
StringNames.asStringName("test_signal"),
101101
new NativeCallable(this, StringNames.asStringName("signal_callback")),
102-
(int) ConnectFlags.ONE_SHOT.getId()
102+
(int) ConnectFlags.ONE_SHOT.getValue()
103103
);
104104
emitSignal(StringNames.asStringName("test_signal"));
105105
}

0 commit comments

Comments
 (0)