Skip to content

Commit a3e748c

Browse files
authored
Gdext 0.3.2 had internal breaking change (#78)
There was an internal change in `godot-ffi` that broke the VARIANT_TYPE of Godot types.
1 parent 46f0be4 commit a3e748c

File tree

5 files changed

+82
-58
lines changed

5 files changed

+82
-58
lines changed

Cargo.lock

Lines changed: 75 additions & 53 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ version = "0.1.0"
1010
edition = "2021"
1111

1212
[workspace.dependencies]
13-
godot = { version = "0.3", features = ["experimental-threads"] }
13+
godot = { version = "0.3.2", features = ["experimental-threads"] }
1414
godot-cell = "0.3"
1515
godot-bindings = "0.3"
1616
itertools = "0.10"

derive/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ fn rust_to_variant_type(ty: &syn::Type) -> Result<TokenStream, TokenStream> {
184184
use #godot_types::sys::GodotFfi;
185185
use #godot_types::meta::GodotType;
186186

187-
<<#path as #godot_types::meta::GodotConvert>::Via as GodotType>::Ffi::VARIANT_TYPE
187+
<<#path as #godot_types::meta::GodotConvert>::Via as GodotType>::Ffi::VARIANT_TYPE.variant_as_nil()
188188
}
189189
}),
190190
T::Verbatim(_) => Err(syn::Error::new(
@@ -206,7 +206,7 @@ fn rust_to_variant_type(ty: &syn::Type) -> Result<TokenStream, TokenStream> {
206206
use #godot_types::sys::GodotFfi;
207207
use #godot_types::meta::GodotType;
208208

209-
<<#tuple as #godot_types::meta::GodotConvert>::Via as GodotType>::Ffi::VARIANT_TYPE
209+
<<#tuple as #godot_types::meta::GodotConvert>::Via as GodotType>::Ffi::VARIANT_TYPE.variant_as_nil()
210210
}
211211
})
212212
}

rust-script/src/interface/export.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ where
9595

9696
impl<T: ArrayElement + GodotScriptExport + GodotType> GodotScriptExport for Array<T> {
9797
fn hint_string(custom_hint: Option<PropertyHint>, custom_string: Option<String>) -> String {
98-
let element_type = <<T as GodotType>::Ffi as GodotFfi>::VARIANT_TYPE.ord();
98+
let element_type = <<T as GodotType>::Ffi as GodotFfi>::VARIANT_TYPE
99+
.variant_as_nil()
100+
.ord();
99101
let element_hint = <T as GodotScriptExport>::hint(custom_hint).ord();
100102
let element_hint_string = <T as GodotScriptExport>::hint_string(custom_hint, custom_string);
101103

rust-script/src/interface/signals.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ macro_rules! signal_argument_desc {
123123
($name:literal, $type:ty) => {
124124
RustScriptPropDesc {
125125
name: $name,
126-
ty: <<<$type as GodotConvert>::Via as GodotType>::Ffi as godot::sys::GodotFfi>::VARIANT_TYPE,
126+
ty: <<<$type as GodotConvert>::Via as GodotType>::Ffi as godot::sys::GodotFfi>::VARIANT_TYPE.variant_as_nil(),
127127
class_name: <<$type as GodotConvert>::Via as GodotType>::class_name(),
128128
exported: false,
129129
hint: PropertyHint::NONE,

0 commit comments

Comments
 (0)