Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property Hint don't work properly using godot-rust v0.11.2 with Godot 3.5.1 #1010

Open
quasardtm opened this issue Jan 21, 2023 · 2 comments · May be fixed by #1011
Open

Property Hint don't work properly using godot-rust v0.11.2 with Godot 3.5.1 #1010

quasardtm opened this issue Jan 21, 2023 · 2 comments · May be fixed by #1011
Labels
bug c: bindings Component: GDNative bindings (mod api) c: sys Component: low-level bindings (mod sys)
Milestone

Comments

@quasardtm
Copy link

Using godot-rust v0.11.2 with Godot v3.5.1, I created a property with StringHint::Dir as the property hint, but the directory icon is not displayed, it was just treated as a string property.

#[derive(NativeClass)]
#[inherit(Node)]
pub struct MyNode {
    #[property(hint = "dir_hint")]
    pub dir: GodotString,
}
pub fn dir_hint() -> StringHint {
    StringHint::Dir
}

This is probably because the version of gdnative-sys/godot_headers used by godot-rust v0.11.2 does not match the version used by Godot v3.5.1.
There is a difference in the typedef of godot_property_hint.
Godot v3.5.1 :
https://github.com/godotengine/godot-headers/blob/godot-3.5.1-stable/nativescript/godot_nativescript.h
godot-rust v0.11.2 :
https://github.com/godot-rust/gdnative/blob/0.11.2/gdnative-sys/godot_headers/nativescript/godot_nativescript.h

@quasardtm quasardtm added the bug label Jan 21, 2023
@Bromeon Bromeon added c: bindings Component: GDNative bindings (mod api) c: sys Component: low-level bindings (mod sys) labels Jan 21, 2023
@Bromeon
Copy link
Member

Bromeon commented Jan 21, 2023

Thanks for reporting! Man, this breaking change in Godot keeps causing problems 🙈

Could you maybe see if the #1011 addresses your issue? You could check out the branch as a Cargo.toml Git dependency.

@quasardtm
Copy link
Author

Thanks for the fix! It works correctly.

@chitoyuu chitoyuu added this to the v0.12.0 milestone Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug c: bindings Component: GDNative bindings (mod api) c: sys Component: low-level bindings (mod sys)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants