Skip to content

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

@quasardtm

Description

@quasardtm

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

Activity

added
c: bindingsComponent: GDNative bindings (mod api)
c: sysComponent: low-level bindings (mod sys)
on Jan 21, 2023
Bromeon

Bromeon commented on Jan 21, 2023

@Bromeon
Member

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

quasardtm commented on Jan 21, 2023

@quasardtm
Author

Thanks for the fix! It works correctly.

added this to the v0.12.0 milestone on Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugc: bindingsComponent: GDNative bindings (mod api)c: sysComponent: low-level bindings (mod sys)

    Projects

    No projects

    Relationships

    None yet

      Participants

      @Bromeon@quasardtm@chitoyuu

      Issue actions

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