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:
@@ -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)),
|
||||
|
||||
Reference in New Issue
Block a user