diff --git a/src/bin/trees/main.rs b/src/bin/trees/main.rs index 60a25ff..a13b3a8 100644 --- a/src/bin/trees/main.rs +++ b/src/bin/trees/main.rs @@ -61,8 +61,6 @@ fn main() { .add_observer(add_dialog_option) .add_observer(add_tree_monologue) .add_observer(remove_tree_monologue) - .add_observer(show_monologue_list) - .add_observer(hide_monologue_list) .run(); } @@ -125,7 +123,9 @@ fn init_debug_ui(mut commands: Commands) { commands .spawn(( Name::new("Tree Planter"), - Text::new("+Tree"), + children![ + Text::new("+Tree"), + ], Node { top: Val::Px(0.0), left: Val::Px(0.0), @@ -133,7 +133,6 @@ fn init_debug_ui(mut commands: Commands) { min_height: Val::Px(25.0), ..default() }, - BackgroundColor(RED.into()), DebuggingState::On, MonologuesContainer, Button, @@ -143,7 +142,9 @@ fn init_debug_ui(mut commands: Commands) { let monologue_button = commands .spawn(( Name::new("Monologue Assignment Menu"), - Text::new("+Monologue"), + children![ + Text::new("+Monologue"), + ], Node { top: Val::Px(25.0), left: Val::Px(0.0), @@ -151,7 +152,6 @@ fn init_debug_ui(mut commands: Commands) { min_height: Val::Px(25.0), ..default() }, - BackgroundColor(RED.into()), DebuggingState::On, MonologuesContainer, )) @@ -168,7 +168,6 @@ fn init_debug_ui(mut commands: Commands) { width: Val::Percent(80.0), ..default() }, - BackgroundColor(BLACK.into()), )) .with_children(|parent| { parent @@ -182,7 +181,6 @@ fn init_debug_ui(mut commands: Commands) { ..default() }, ScrollPosition::default(), - BackgroundColor(ORANGE.into()), MonologuesList, )) .observe(scroll); @@ -199,7 +197,6 @@ fn init_debug_ui(mut commands: Commands) { width: Val::Percent(60.0), ..default() }, - BackgroundColor(ORANGE_RED.into()), )); }); } @@ -595,46 +592,27 @@ fn spawn_debug_buttons( parent .spawn(( Button, - Text::new( - handle - .path() - .unwrap() - .to_string() - .trim_prefix("trees/") - .trim_suffix(".mono"), - ), - TextLayout::new(JustifyText::Left, LineBreak::WordBoundary), + children![ + Text::new( + handle + .path() + .unwrap() + .to_string() + .trim_prefix("trees/") + .trim_suffix(".mono"), + ), + TextLayout::new(JustifyText::Left, LineBreak::WordBoundary), + ], TreeMonologue(handle.clone()), MonologuesList, - BackgroundColor(PINK.into()), )) .observe(assign_monologue_event) - .observe(preview_monologue) - .observe(toggle_debug_button_color_over) - .observe(toggle_debug_button_color_out); + .observe(preview_monologue); }); } }); } -fn toggle_debug_button_color_over( - trigger: Trigger>, - mut buttons: Query<&mut BackgroundColor, With