DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

fbac14df11919339d32e9719a85248f9329ac20b — Jonni Liljamo 1 year, 9 months ago 5964797
feat(client): settings menu stub
M client/src/plugins/menu/mod.rs => client/src/plugins/menu/mod.rs +1 -0
@@ 25,6 25,7 @@ impl Plugin for MenuPlugin {
            .insert_resource(ui::play::PlayScreenData::default())
            .add_system(ui::connect::ui.run_in_state(MenuState::Connect))
            .add_system(ui::menu::ui.run_in_state(MenuState::Menu))
            .add_system(ui::settings::ui.run_in_state(MenuState::Settings))
            .add_system(ui::play::ui.run_in_state(MenuState::Play));
    }
}

M client/src/plugins/menu/ui/menu.rs => client/src/plugins/menu/ui/menu.rs +1 -1
@@ 32,7 32,7 @@ pub fn ui(
                }

                if ui.button("Settings").clicked() {
                    //
                    commands.insert_resource(NextState(MenuState::Settings));
                }

                if ui.button("Quit").clicked() {

M client/src/plugins/menu/ui/mod.rs => client/src/plugins/menu/ui/mod.rs +1 -0
@@ 10,3 10,4 @@ pub mod menu;

pub mod connect;
pub mod play;
pub mod settings;

A client/src/plugins/menu/ui/settings/mod.rs => client/src/plugins/menu/ui/settings/mod.rs +10 -0
@@ 0,0 1,10 @@
/*
 * This file is part of laurelin/client
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

mod ui;
pub use ui::*;

A client/src/plugins/menu/ui/settings/ui.rs => client/src/plugins/menu/ui/settings/ui.rs +26 -0
@@ 0,0 1,26 @@
/*
 * This file is part of laurelin/client
 * Copyright (C) 2023 Jonni Liljamo <jonni@liljamo.com>
 *
 * Licensed under GPL-3.0-only.
 * See LICENSE for licensing information.
 */

use bevy::ecs::system::{Commands, ResMut};
use bevy_inspector_egui::bevy_egui::{egui, EguiContext};
use iyes_loopless::state::NextState;

use crate::{plugins::menu::MenuState, util::egui::menuwindow};

pub fn ui(mut commands: Commands, mut egui_context: ResMut<EguiContext>) {
    menuwindow(
        egui_context.ctx_mut(),
        "Settings",
        &egui::Vec2::new(400., 600.),
        |ui| {
            if ui.button("Back").clicked() {
                commands.insert_resource(NextState(MenuState::Menu));
            }
        },
    );
}