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

Can't export variable with suffix #731

Closed
TheTrueWhiteOwl opened this issue May 26, 2024 · 3 comments · Fixed by #783
Closed

Can't export variable with suffix #731

TheTrueWhiteOwl opened this issue May 26, 2024 · 3 comments · Fixed by #783
Labels
c: register Register classes, functions and other symbols to GDScript feature Adds functionality to the library

Comments

@TheTrueWhiteOwl
Copy link

TheTrueWhiteOwl commented May 26, 2024

I cannot recreate the following gdscript code in rust:
@export_range(0, 10000, 1, "or_greater", "suffix:ms") var delay: int = 1000
Specifically this part __________________________^^^^^^^

I have tried to find how to do this in the documentation, but it is very empty, devoid of examples and still very unhelpful right now.

Is there a way to support this? Maybe something like this?
#[export(range=(0,1000,1,or_greater), suffix="ms")]
But I hope you understand I have no clue exactly how attributes work or how this feature could be implemented.

@lilizoey
Copy link
Member

i was not aware this is something you could do in gdscript? do you know where this is documented?

@lilizoey lilizoey added feature Adds functionality to the library c: register Register classes, functions and other symbols to GDScript labels May 26, 2024
@lilizoey
Copy link
Member

as a workaround, it should be possible to do

#[export]
#[var(
    hint = RANGE,
    hint_string = "write your custom hint string here",   
)]

if you know what the hint string should look like

@StatisMike
Copy link
Contributor

@lilizoey Seems to be available only for export_range:

https://docs.godotengine.org/en/stable/classes/class_%40gdscript.html#class-gdscript-annotation-export-range

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: register Register classes, functions and other symbols to GDScript feature Adds functionality to the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants