@@ -249,15 +249,11 @@ fn to_rust_type_uncached(full_ty: &GodotTy, ctx: &mut Context) -> RustTy {
249
249
/// I.e. just `Mesh.ArrayFormat` or `Error`.
250
250
pub ( crate ) fn to_enum_type_uncached ( enum_or_bitfield : & str , is_bitfield : bool ) -> RustTy {
251
251
if let Some ( ( class, enum_) ) = enum_or_bitfield. split_once ( '.' ) {
252
- // Class-local enum or bitfield.
253
- let module = ModName :: from_godot ( class) ;
254
- let enum_or_bitfield_name = conv:: make_enum_name ( enum_) ;
255
-
256
- RustTy :: EngineEnum {
257
- tokens : quote ! { crate :: classes:: #module:: #enum_or_bitfield_name } ,
258
- surrounding_class : Some ( class. to_string ( ) ) ,
259
- is_bitfield,
260
- }
252
+ to_class_enum_uncached ( class, enum_, is_bitfield)
253
+ } else if enum_or_bitfield == "ResourceDeepDuplicateMode" {
254
+ // FIXME – in https://github.com/godotengine/godot/pull/100673#issuecomment-2916116489 `ResourceDeepDuplicateMode` has been wrongly marked as an Engine Enum.
255
+ // Remove this workaround after the fix appears.
256
+ to_class_enum_uncached ( "Resource" , enum_or_bitfield, is_bitfield)
261
257
} else {
262
258
// Global enum or bitfield.
263
259
let enum_or_bitfield_name = conv:: make_enum_name ( enum_or_bitfield) ;
@@ -270,6 +266,18 @@ pub(crate) fn to_enum_type_uncached(enum_or_bitfield: &str, is_bitfield: bool) -
270
266
}
271
267
}
272
268
269
+ fn to_class_enum_uncached ( class : & str , enum_ : & str , is_bitfield : bool ) -> RustTy {
270
+ // Class-local enum or bitfield.
271
+ let module = ModName :: from_godot ( class) ;
272
+ let enum_or_bitfield_name = conv:: make_enum_name ( enum_) ;
273
+
274
+ RustTy :: EngineEnum {
275
+ tokens : quote ! { crate :: classes:: #module:: #enum_or_bitfield_name } ,
276
+ surrounding_class : Some ( class. to_string ( ) ) ,
277
+ is_bitfield,
278
+ }
279
+ }
280
+
273
281
// ----------------------------------------------------------------------------------------------------------------------------------------------
274
282
// Godot -> Rust expressions
275
283
0 commit comments