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::{
|
||||
game::machines::*,
|
||||
resources::UiTheme,
|
||||
widgets::{BigRedButton, machine_ui_base},
|
||||
widgets::{BigRedButton, SpawnUi, machine_ui_base},
|
||||
};
|
||||
|
||||
impl CuttingMachine {
|
||||
pub fn spawn_ui(mut commands: Commands, theme: Res<UiTheme>) {
|
||||
impl SpawnUi for CuttingMachine {
|
||||
fn spawn_ui(mut commands: Commands, theme: Res<UiTheme>) {
|
||||
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.
|
||||
@@ -51,8 +51,8 @@ impl CuttingMachine {
|
||||
}
|
||||
}
|
||||
|
||||
impl RotatingMachine {
|
||||
pub fn spawn_ui(mut commands: Commands, theme: Res<UiTheme>) {
|
||||
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((
|
||||
|
||||
Reference in New Issue
Block a user