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

#[class(tool)] for per-class editor run behavior #374

Merged
merged 3 commits into from
Aug 6, 2023
Merged

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented Aug 6, 2023

Builds on top of #365 to allow per-class granularity.

If you want a class' lifecycle callbacks to be run within the Godot editor, add the #[class(tool)] key.

#[derive(GodotClass)]
#[class(init, tool, base=Node2D)]
struct MyClass { ... }

By default, only tool classes are run in the editor now. You can still enable all classes in ExtensionLibrary, which can be useful if you are building an editor plugin rather than a game.

Also fixes a bug where on_notification() was still running by default.

@Bromeon Bromeon added feature Adds functionality to the library c: register Register classes, functions and other symbols to GDScript labels Aug 6, 2023
@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-374

@Bromeon Bromeon enabled auto-merge August 6, 2023 16:04
@Bromeon Bromeon added this pull request to the merge queue Aug 6, 2023
Merged via the queue into master with commit 720824a Aug 6, 2023
@Bromeon Bromeon deleted the feature/tool branch August 6, 2023 16:14
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 this pull request may close these issues.

2 participants