Trait SpawnUi for things that can spawn a UI

I don't want to copy-paste a bunch of code, so I'm going to get the
compiler to do it for me.
This commit is contained in:
2025-08-27 13:34:31 -05:00
parent 4d8c8b5302
commit 04fb8519f6

View File

@@ -28,6 +28,14 @@ impl Plugin for GameUiPlugin {
}
}
/// Anything that can spawn a themed UI should impl this trait.
///
/// This exists mainly so that I can write generic functions and have the *compiler*
/// expand the code for me, instead of doing it by hand.
pub trait SpawnUi {
fn spawn_ui(commands: Commands, theme: Res<UiTheme>);
}
/// The base panel for the machines that manipulate the room cards.
///
/// This function is not a valid Bevy System because of how the Commands struct