From 17616d0c201c7e4fb22123c6837d5be4a8101ddb Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Mon, 9 Dec 2024 22:52:26 -0800 Subject: [PATCH] Stubbed out deck and sets view too --- src/menu.rs | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/src/menu.rs b/src/menu.rs index 5fa9392..86cfef1 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -1,5 +1,5 @@ use bevy::{ - color::palettes::css::{BLACK, BLUE, GREEN, ORANGE, PURPLE, RED, TEAL}, + color::palettes::css::{BLACK, INDIGO, ORANGE, PURPLE, RED, TEAL}, prelude::*, }; @@ -10,7 +10,16 @@ pub struct MenuPlugin; impl Plugin for MenuPlugin { fn build(&self, app: &mut App) { - app.add_systems(Startup, (setup, setup_about, setup_how_to_play)); + app.add_systems( + Startup, + ( + setup, + setup_about, + setup_how_to_play, + setup_deck, + setup_sets, + ), + ); } } @@ -54,13 +63,13 @@ fn setup(mut commands: Commands) { }) .observe(button_set_state(ViewState::Menu)); parent - .spawn((Button, BackgroundColor(GREEN.into()), GlobalZIndex(1))) + .spawn((Button, BackgroundColor(INDIGO.into()), GlobalZIndex(1))) .with_children(|parent| { parent.spawn(Text("Deck".to_string())); }) .observe(button_set_state(ViewState::Deck)); parent - .spawn((Button, BackgroundColor(BLUE.into()), GlobalZIndex(1))) + .spawn((Button, BackgroundColor(ORANGE.into()), GlobalZIndex(1))) .with_children(|parent| { parent.spawn(Text("Sets".to_string())); }) @@ -102,6 +111,32 @@ fn setup_how_to_play(mut commands: Commands) { }); } +fn setup_deck(mut commands: Commands) { + commands + .spawn((ViewState::Deck, Node::default())) + .with_children(|parent| { + parent + .spawn((Button, BackgroundColor(TEAL.into()))) + .with_children(|parent| { + parent.spawn(Text("Back".to_string())); + }) + .observe(button_set_state(ViewState::Play)); + }); +} + +fn setup_sets(mut commands: Commands) { + commands + .spawn((ViewState::Sets, Node::default())) + .with_children(|parent| { + parent + .spawn((Button, BackgroundColor(TEAL.into()))) + .with_children(|parent| { + parent.spawn(Text("Back".to_string())); + }) + .observe(button_set_state(ViewState::Play)); + }); +} + fn quit_button(_trigger: Trigger>, mut exit_event: EventWriter) { exit_event.send(AppExit::Success); }