Skip to content

Commit ae789d9

Browse files
tomsepBromeon
authored andcommitted
Map Vector2.Axis and Vector2i.Axis to Vector2Axis
Missing mapping can cause problems when building bindings for custom Godot or GDExtensions using those enums.
1 parent 7768d90 commit ae789d9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

godot-codegen/src/conv/type_conversions.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,14 @@ fn to_hardcoded_rust_ident(full_ty: &GodotTy) -> Option<&str> {
7575
}
7676

7777
fn to_hardcoded_rust_enum(ty: &str) -> Option<&str> {
78+
// Some types like Vector2[i].Axis may not appear in Godot's current JSON, but they are encountered
79+
// in custom Godot builds, e.g. when extending PhysicsServer2D.
7880
let result = match ty {
7981
//"enum::Error" => "GodotError",
8082
"enum::Variant.Type" => "VariantType",
8183
"enum::Variant.Operator" => "VariantOperator",
84+
"enum::Vector2.Axis" => "Vector2Axis",
85+
"enum::Vector2i.Axis" => "Vector2Axis",
8286
"enum::Vector3.Axis" => "Vector3Axis",
8387
"enum::Vector3i.Axis" => "Vector3Axis",
8488
_ => return None,

0 commit comments

Comments
 (0)