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.
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.
Fixed struct field visibility, initialize the resource, and register it
with the EGUI Debug overlay. The button observers have also been updated
to use the resource.
Observers are "just" systems with a Trigger as their first parameter.
I've made 4 systems to handle the start and stop of the press and hover
actions.
Having the button *actually* do something (not just change colors) will
be achieved by attaching another button to the on-press trigger. I'm
expecting that the machine-ui-spawning system will do that, but in
principle it could be done by anything with access to the UI's button
entity ID.
I expect that we will not want to retain the original copy of a Card
after merging, cutting, rotating, etc. This function signature says that
the value moves into the method and goes away. If this becomes an
annoyance, then we change it.
The UI parts will end up in "widgets.rs". Buttons, labels, etc.
The "contsants.rs" module is meant to have compile-time configurables.
Bevy's reflection abilities make it possible to alter these at runtime,
which means this module will actually have the startup defaults rather
than true program constants.
Do some quick checks to make sure the merging function works the way we
expect. This also records how some edge cases will be handled, such as
merging two triangles.
Enable dynamic linking for faster cycle time during development. This
should be turned off for release, and *must* be turned off for WASM.
Also some optimization levels so the engine runs acceptably during
debug.