Commit Graph

37 Commits

Author SHA1 Message Date
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
d235d6af5e (autoformat) 2025-08-25 19:18:06 -05:00
e2b2d5b5d9 Move the machine UI spawners to a new submodule 2025-08-25 19:17:54 -05:00
655bc5d3e2 Add new module for game bits 2025-08-25 18:55:38 -05:00
Patrick Gelvin
d98b28cb36 Cut triangle test 2025-08-25 18:25:59 -05:00
4bf3c44b5e Move widgets to a folder module 2025-08-25 18:17:39 -05:00
45e44ef8b1 Begin work on a rotator UI 2025-08-25 18:07:53 -05:00
e362df8682 Plug in the new UiTheme resource
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.
2025-08-25 13:10:09 -05:00
4d8a178b74 Remove print-debug observer system
This was just so I could see two Observers executing from the same
trigger.
2025-08-25 13:04:40 -05:00
74302afab1 Replace "constants" module with "resources"
These aren't constants and they were never meant to be.

I've also started collecting the UI theme values. For now, just button
colors.
2025-08-25 12:54:29 -05:00
aa0c8b421b Handle machine button UI events with observers
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.
2025-08-25 11:36:26 -05:00
875d157a21 Check-in the progress
Lots of nested components are making my head hurt. I'm not sure how to
solve the button call-back problem, yet.
2025-08-25 08:22:08 -05:00
a0cfc86f59 Center & Span the red rectangle to be a banner
Figured out how to place nodes in the grid. This will eventually become
the banner that says what the machine does.
2025-08-25 08:22:08 -05:00
79f66b2868 Colored squares on a grid layout
I'm still kinda figuring out how to do more complex UIs, so I'll be
making several commits that aren't very interesting to review... such as
this one.
2025-08-25 08:22:08 -05:00
Patrick Gelvin
7fb798edbe Initial asset library impl + tile images 2025-08-24 11:33:31 -07:00
Patrick Gelvin
b0ddc9236b Fix my busted implementations 2025-08-23 12:56:10 -07:00
031a487fb5 Add rotation unit tests 2025-08-23 13:33:44 -05:00
8d75a40475 Add unit tests for transposition 2025-08-23 13:27:39 -05:00
761729900f Add unit tests card flipping in both directions 2025-08-23 12:53:34 -05:00
b7bbadfc51 Add cut test on octagon for all CutLines 2025-08-23 12:53:34 -05:00
Patrick Gelvin
e59b65e034 Initial implementations of all card ops 2025-08-23 10:03:38 -07:00
e7f4a00f2a Drop unused import 2025-08-23 09:43:33 -05:00
bd324807e8 Fix visibility on items in card.rs 2025-08-23 09:42:37 -05:00
4a17666bba Card's methods take values, not references
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.
2025-08-23 09:38:49 -05:00
Patrick Gelvin
daf05e3609 Add merge door tests 2025-08-22 17:37:19 -07:00
205111d25f Outline some modules for coming steps
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.
2025-08-22 19:26:08 -05:00
2024ad6e95 Outline more tests for the other Card methods 2025-08-22 19:22:48 -05:00
b3b8d1a814 Add unit tests for Card floor merging
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.
2025-08-22 17:15:06 -07:00
Patrick Gelvin
6bbc31304e Add card merge impl 2025-08-22 17:14:32 -07:00
5dcae119f0 Begin a Card module for handling the tile parts 2025-08-22 18:30:56 -05:00
393473c6f9 Dummy window
With EGUI inspector!... I guess
2025-08-22 16:57:54 -05:00
52fe190b1f Add EGUI debug inspector 2025-08-22 16:47:11 -05:00
80d854d4d9 Add configuration for development
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.
2025-08-22 16:45:06 -05:00
Patrick Gelvin
9ecffd17d0 Specify stable toolchain 2025-08-22 14:35:52 -07:00
59be4c936f Start new repo for game 2025-08-22 16:32:16 -05:00