Skip to content

Commit a6103ac

Browse files
committed
Add back support for Godot 4.3
1 parent 2940959 commit a6103ac

File tree

19 files changed

+304545
-23
lines changed

19 files changed

+304545
-23
lines changed

binding_generator.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,9 +1135,11 @@ def generate_builtin_class_header(builtin_api, size, used_classes, fully_used_cl
11351135
if class_name == "Dictionary":
11361136
result.append("\tconst Variant &operator[](const Variant &p_key) const;")
11371137
result.append("\tVariant &operator[](const Variant &p_key);")
1138+
result.append("#if GODOT_VERSION_MINOR >= 4")
11381139
result.append(
11391140
"\tvoid set_typed(uint32_t p_key_type, const StringName &p_key_class_name, const Variant &p_key_script, uint32_t p_value_type, const StringName &p_value_class_name, const Variant &p_value_script);"
11401141
)
1142+
result.append("#endif")
11411143

11421144
result.append("};")
11431145

@@ -1888,7 +1890,9 @@ def generate_engine_class_header(class_api, used_classes, fully_used_classes, us
18881890
# condition returns false (in such cases it can't compile due to ambiguity).
18891891
f"\t\tif constexpr (!std::is_same_v<decltype(&B::{method_name}), decltype(&T::{method_name})>) {{"
18901892
)
1891-
result.append(f"\t\t\tBIND_VIRTUAL_METHOD(T, {method_name}, {method['hash']});")
1893+
# If using an `extension_api.json` from Godot 4.3 or earlier, there will be no hash for virtual functions.
1894+
method_hash = method.get("hash", 0)
1895+
result.append(f"\t\t\tBIND_VIRTUAL_METHOD(T, {method_name}, {method_hash});")
18921896
result.append("\t\t}")
18931897

18941898
result.append("\t}")

0 commit comments

Comments
 (0)