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.
This commit is contained in:
2025-08-26 09:18:36 -05:00
parent f89a0d2e66
commit c833572f69
2 changed files with 17 additions and 18 deletions

View File

@@ -2,7 +2,7 @@ use bevy::{color::palettes::css::*, prelude::*, ui::Val::*};
use crate::{
game::machines::*,
widgets::{machine_ui_base, spawn_big_red_button},
widgets::{CloseButton, machine_ui_base, spawn_big_red_button},
};
impl CuttingMachine {
@@ -52,6 +52,7 @@ impl RotatingMachine {
commands
.spawn((machine_ui_base("Rotating Machine"),))
.with_children(|commands| {
commands.spawn(CloseButton::bundle(commands.target_entity()));
commands.spawn((
Node {
padding: UiRect::all(Px(10.0)),