From 3b0dad7063c1b6af2d660e492e3c4ec7ac2fcd9f Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Wed, 27 Aug 2025 13:35:31 -0500 Subject: [PATCH] Impl SpawnUi for the machine structs Just add the `SpawnUi for` text to the impl blocks on the machine widgets. --- src/widgets/machines.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/widgets/machines.rs b/src/widgets/machines.rs index ac8c10b..c96ec32 100644 --- a/src/widgets/machines.rs +++ b/src/widgets/machines.rs @@ -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) { +impl SpawnUi for CuttingMachine { + fn spawn_ui(mut commands: Commands, theme: Res) { 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) { +impl SpawnUi for RotatingMachine { + fn spawn_ui(mut commands: Commands, theme: Res) { let base_entity = machine_ui_base(&mut commands, "Rotating Machine", &theme); commands.entity(base_entity).with_children(|commands| { commands.spawn((