Skip to content

Allow specifying Event bubbling info as proc macro attributes #14336

Open

Description

What problem does this solve or what need does it fill?

Event bubbling info currently requires manual implementation:

#[derive(Component)]
struct MyEvent;

impl Event for MyEvent {
    type Traverse = Parent;
    const AUTO_PROPAGATE: bool = true;
}

What solution would you like?

Allow the user to specify this information as proc macro attributes:

#[derive(Event)]
#[event(traverse = Parent, auto_propagate = true)]
struct MyEvent;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useD-MacrosCode that generates Rust codeCode that generates Rust code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions