M => +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 => +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 => +1 -0
@@ 10,3 10,4 @@ pub mod menu;
pub mod connect;
pub mod play;
pub mod settings;
A => +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 => +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));
}
},
);
}