Skip to content

Commit e3b60af

Browse files
committed
Work around 3 OpenXR* classes only available in editor, but declared as "core"
1 parent a29dc33 commit e3b60af

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

godot-codegen/src/special_cases/special_cases.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,15 @@ pub fn is_godot_type_deleted(godot_ty: &str) -> bool {
141141
| "MovieWriterPNGWAV"
142142
| "ResourceFormatImporterSaver"
143143
=> true,
144-
// Previously loaded lazily; in 4.2 it loads at the Scene level. See: https://github.com/godotengine/godot/pull/81305
144+
145+
// Previously loaded lazily; in 4.2 it loads at the Scene level: https://github.com/godotengine/godot/pull/81305
145146
| "ThemeDB"
146147
=> cfg!(before_api = "4.2"),
147-
// reintroduced in 4.3. See: https://github.com/godotengine/godot/pull/80214
148+
149+
// Reintroduced in 4.3: https://github.com/godotengine/godot/pull/80214
148150
| "UniformSetCacheRD"
149151
=> cfg!(before_api = "4.3"),
152+
150153
_ => false
151154
}
152155
}

godot-codegen/src/util.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,17 @@ pub fn make_sname_ptr(identifier: &str) -> TokenStream {
6060
pub fn get_api_level(class: &JsonClass) -> ClassCodegenLevel {
6161
// Work around wrong classification in https://github.com/godotengine/godot/issues/86206.
6262
fn override_editor(class_name: &str) -> bool {
63-
cfg!(before_api = "4.3")
64-
&& matches!(
65-
class_name,
66-
"ResourceImporterOggVorbis" | "ResourceImporterMP3"
67-
)
63+
match class_name {
64+
// https://github.com/godotengine/godot/issues/103867
65+
"OpenXRInteractionProfileEditorBase"
66+
| "OpenXRInteractionProfileEditor"
67+
| "OpenXRBindingModifierEditor" => cfg!(before_api = "4.5"),
68+
69+
// https://github.com/godotengine/godot/issues/86206
70+
"ResourceImporterOggVorbis" | "ResourceImporterMP3" => cfg!(before_api = "4.3"),
71+
72+
_ => false,
73+
}
6874
}
6975

7076
if special_cases::is_class_level_server(&class.name) {

0 commit comments

Comments
 (0)