Commit Graph

14 Commits

Author SHA1 Message Date
a489cdc5e8 Add some theme TODOs on the button widgets 2025-08-26 13:35:20 -05:00
9fb374059a Fix: Delete trailing semicolon in BRB::bundle()
Normally this would be a compilation error, but Bevy has an
`impl Bundle for ()` somewhere.

The intended bundle content gets discarded and a unit is implicitly
returned. That unit is implicitly converted into a `Bundle`, satisfying
the compiler.
2025-08-26 13:17:38 -05:00
9bb15b7511 Convert BigRedButton ctor into just a Bundle
The BigRedButton isn't doing anything that requires the `Commands`, so
it'll be turned back into just a Bundle.
2025-08-26 13:01:49 -05:00
c567bc3706 Fix: Filter for BigRedButton in it's observers
There was no BRB component so the Observer systems would only filter for
`Button`, which matched against the close button by accident.
2025-08-26 12:54:46 -05:00
85499f4156 Move BigRedButton's input handling observers
But there's a bug... the `CloseButton`s now get colored red and pink.
2025-08-26 12:49:37 -05:00
1c0681e67e Create a BigRedButton struct, like CloseButton
The `BigRedButton` should be a real struct and component so that I can
query for it later.

I'm following the same API pattern as the `CloseButton` struct, in that
there is a spawner using the `Commands` (or `ChildSpawnerCommands`) and
the observer functions are static methods.
2025-08-26 12:46:48 -05:00
da7f9b3152 Create a custom plugin to centralize UI setup
The UI elements need some things set up for them to work properly.
Namely, the `UiTheme` resource and the Observers which handle button
presses.
2025-08-26 12:34:35 -05:00
fb1b954262 Replace base-ui bundle with a spawning function 2025-08-26 12:25:49 -05:00
c833572f69 Reattach the close button to the rotator machine
That was much easier than I expected it to be. I'm still going to alter
how the `machine_ui_base` function works so that I don't have to
remember to attach a button all the time.
2025-08-26 09:49:47 -05:00
f89a0d2e66 Record target entity in CloseButton
I was originally planning to search up the entity hierarchy to find the
top-most entity and despawn that. This will become a problem if I ever
want to have panels in panels.

Instead, just record the target entity and despawn it.

This means the current usage doesn't work, so I've removed it from the
base machine UI bundle.
2025-08-26 09:10:34 -05:00
bda0bb7de3 Add most of a "CloseButton" widget
I'm trying out a new scope strategy. The CloseButton exists as a real
struct with the `Component` trait. There's a bundle spawning utility
function and several observer systems. The observer systems have been
added directly to the app, which I *believe* means they won't be
duplicated the way the Big Red Button's observers will.
2025-08-26 09:02:08 -05:00
f2f1674451 Rename machine button spawner, "big red button"
It's the big red button. Don't press it.

Or do.
2025-08-25 19:45:35 -05:00
e2b2d5b5d9 Move the machine UI spawners to a new submodule 2025-08-25 19:17:54 -05:00
4bf3c44b5e Move widgets to a folder module 2025-08-25 18:17:39 -05:00