Impl SpawnUi for the machine structs
Just add the `SpawnUi for` text to the impl blocks on the machine widgets.
This commit is contained in:
@@ -3,11 +3,11 @@ use bevy::{color::palettes::css::*, prelude::*, ui::Val::*};
|
|||||||
use crate::{
|
use crate::{
|
||||||
game::machines::*,
|
game::machines::*,
|
||||||
resources::UiTheme,
|
resources::UiTheme,
|
||||||
widgets::{BigRedButton, machine_ui_base},
|
widgets::{BigRedButton, SpawnUi, machine_ui_base},
|
||||||
};
|
};
|
||||||
|
|
||||||
impl CuttingMachine {
|
impl SpawnUi for CuttingMachine {
|
||||||
pub fn spawn_ui(mut commands: Commands, theme: Res<UiTheme>) {
|
fn spawn_ui(mut commands: Commands, theme: Res<UiTheme>) {
|
||||||
let base_entity = machine_ui_base(&mut commands, "Cutting Machine", &theme);
|
let base_entity = machine_ui_base(&mut commands, "Cutting Machine", &theme);
|
||||||
commands.entity(base_entity).with_children(|commands| {
|
commands.entity(base_entity).with_children(|commands| {
|
||||||
// Left panel. For fuel or machine stats or whatever.
|
// Left panel. For fuel or machine stats or whatever.
|
||||||
@@ -51,8 +51,8 @@ impl CuttingMachine {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RotatingMachine {
|
impl SpawnUi for RotatingMachine {
|
||||||
pub fn spawn_ui(mut commands: Commands, theme: Res<UiTheme>) {
|
fn spawn_ui(mut commands: Commands, theme: Res<UiTheme>) {
|
||||||
let base_entity = machine_ui_base(&mut commands, "Rotating Machine", &theme);
|
let base_entity = machine_ui_base(&mut commands, "Rotating Machine", &theme);
|
||||||
commands.entity(base_entity).with_children(|commands| {
|
commands.entity(base_entity).with_children(|commands| {
|
||||||
commands.spawn((
|
commands.spawn((
|
||||||
|
|||||||
Reference in New Issue
Block a user