-
-
Notifications
You must be signed in to change notification settings - Fork 223
Classname Alias #332
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
Labels
c: register
Register classes, functions and other symbols to GDScript
feature
Adds functionality to the library
good first issue
Good for newcomers
Comments
Suggested syntax: #[derive(GodotClass)]
#[class(init, base=Node2D, rename=GodotName)]
struct RustName {
...
} Should also be documented in the |
fpdotmonkey
added a commit
to fpdotmonkey/gdext
that referenced
this issue
Sep 21, 2023
There's an issue that two structs with the same name in different modules will conflict with each other when sent to Godot since only the struct name is considered. This resolves that by allowing the API user to manually change the name of the class as Godot understands it. This also improves the error message that occurs when theres are aliased classes. Future work may seek to catch this issue at compile time rather than at runtime. Relevant to godot-rust#332
fpdotmonkey
added a commit
to fpdotmonkey/gdext
that referenced
this issue
Sep 21, 2023
There's an issue that two structs with the same name in different modules will conflict with each other when sent to Godot since only the struct name is considered. This resolves that by allowing the API user to manually change the name of the class as Godot understands it. This also improves the error message that occurs when theres are aliased classes. Future work may seek to catch this issue at compile time rather than at runtime. Relevant to godot-rust#332
fpdotmonkey
added a commit
to fpdotmonkey/gdext
that referenced
this issue
Sep 21, 2023
There's an issue that two structs with the same name in different modules will conflict with each other when sent to Godot since only the struct name is considered. This resolves that by allowing the API user to manually change the name of the class as Godot understands it. This also improves the error message that occurs when theres are aliased classes. Future work may seek to catch this issue at compile time rather than at runtime. Relevant to godot-rust#332
fpdotmonkey
added a commit
to fpdotmonkey/gdext
that referenced
this issue
Sep 21, 2023
There's an issue that two structs with the same name in different modules will conflict with each other when sent to Godot since only the struct name is considered. This resolves that by allowing the API user to manually change the name of the class as Godot understands it. This also improves the error message that occurs when theres are aliased classes. Future work may seek to catch this issue at compile time rather than at runtime. Relevant to godot-rust#332
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
good first issue
Good for newcomers
Uh oh!
There was an error while loading. Please reload this page.
In godot engine, each class should have unique name, since their's no
mod
/package
/namespace
. But in rust, we can have multiple structs with a same name (in different mods). When you try to export two or more structs with the same name to Godot, a very subtle runtime error occurs. If you don't start the editor from the command line, you won't see the error message.So we need a way to provide an alias to the registered class.
The text was updated successfully, but these errors were encountered: