Fill out UI parts for the remaining machines
This commit is contained in:
@@ -11,15 +11,7 @@ impl SpawnUi for CuttingMachine {
|
||||
let base_entity = machine_ui_base(&mut commands, "Cutting Machine", &theme);
|
||||
commands.entity(base_entity).with_children(|commands| {
|
||||
// Left panel. For fuel or machine stats or whatever.
|
||||
commands.spawn((
|
||||
Node {
|
||||
padding: UiRect::all(Px(10.0)),
|
||||
..default()
|
||||
},
|
||||
BackgroundColor(GREEN.into()),
|
||||
Pickable::default(),
|
||||
children![(Text::new("Uses: <n>"), TextColor(BLACK.into()),)],
|
||||
));
|
||||
commands.spawn(fuel_gauge_placeholder());
|
||||
|
||||
// Center panel (placeholder for the Card view)
|
||||
commands.spawn((
|
||||
@@ -55,15 +47,7 @@ impl SpawnUi for RotatingMachine {
|
||||
fn spawn_ui(mut commands: Commands, theme: Res<UiTheme>) {
|
||||
let base_entity = machine_ui_base(&mut commands, "Rotating Machine", &theme);
|
||||
commands.entity(base_entity).with_children(|commands| {
|
||||
commands.spawn((
|
||||
Node {
|
||||
padding: UiRect::all(Px(10.0)),
|
||||
..Default::default()
|
||||
},
|
||||
BackgroundColor(GREEN.into()),
|
||||
Pickable::default(),
|
||||
children![(Text::new("Uses: <n>"), TextColor(BLACK.into()))],
|
||||
));
|
||||
commands.spawn(fuel_gauge_placeholder());
|
||||
|
||||
// Center panel (placeholder for input-output rotation)
|
||||
commands.spawn((
|
||||
@@ -93,3 +77,85 @@ impl SpawnUi for RotatingMachine {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
impl SpawnUi for FlippingMachine {
|
||||
fn spawn_ui(mut commands: Commands, theme: Res<UiTheme>) {
|
||||
let base_entity = machine_ui_base(&mut commands, "Flipping Machine", &theme);
|
||||
commands.entity(base_entity).with_children(|commands| {
|
||||
commands.spawn(fuel_gauge_placeholder());
|
||||
|
||||
// Center panel (placeholder)
|
||||
commands.spawn((
|
||||
Node::default(),
|
||||
BackgroundColor(BLUE.into()),
|
||||
Pickable::default(),
|
||||
children![
|
||||
Text::new("Card Flipping placeholder"),
|
||||
TextColor(MAGENTA.into()),
|
||||
],
|
||||
));
|
||||
|
||||
// Right panel go button
|
||||
commands
|
||||
.spawn((
|
||||
Node {
|
||||
align_items: AlignItems::End,
|
||||
..Default::default()
|
||||
},
|
||||
BackgroundColor(DARK_GRAY.into()),
|
||||
Pickable::default(),
|
||||
))
|
||||
.with_children(|cmds| {
|
||||
let _button_cmds = cmds.spawn(BigRedButton::bundle("FLIP"));
|
||||
// TODO: Attach on-press observer to the button.
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
impl SpawnUi for TransposingMachine {
|
||||
fn spawn_ui(mut commands: Commands, theme: Res<UiTheme>) {
|
||||
let base_entity = machine_ui_base(&mut commands, "Transposing Machine", &theme);
|
||||
commands.entity(base_entity).with_children(|commands| {
|
||||
commands.spawn(fuel_gauge_placeholder());
|
||||
|
||||
// Center panel (placeholder)
|
||||
commands.spawn((
|
||||
Node::default(),
|
||||
BackgroundColor(BLUE.into()),
|
||||
Pickable::default(),
|
||||
children![
|
||||
Text::new("Card Transposition placeholder"),
|
||||
TextColor(MAGENTA.into()),
|
||||
],
|
||||
));
|
||||
|
||||
// Right panel go button
|
||||
commands
|
||||
.spawn((
|
||||
Node {
|
||||
align_items: AlignItems::End,
|
||||
..Default::default()
|
||||
},
|
||||
BackgroundColor(DARK_GRAY.into()),
|
||||
Pickable::default(),
|
||||
))
|
||||
.with_children(|cmds| {
|
||||
let _button_cmds = cmds.spawn(BigRedButton::bundle("SWAP"));
|
||||
// TODO: Attach on-press observer to the button.
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
fn fuel_gauge_placeholder() -> impl Bundle {
|
||||
(
|
||||
Node {
|
||||
padding: UiRect::all(Px(10.0)),
|
||||
..default()
|
||||
},
|
||||
BackgroundColor(GREEN.into()),
|
||||
Pickable::default(),
|
||||
children![(Text::new("Uses: <n>"), TextColor(BLACK.into()),)],
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user