This commit is contained in:
CoCo_Sol 2024-02-04 17:07:03 +01:00
parent 316bbf77f0
commit 72503edbac
2 changed files with 7 additions and 5 deletions

View file

@ -1,9 +1,10 @@
//! The main entry point of the game.
use bevy::prelude::*;
mod menu;
use menu::MenuPlugin;
mod menu;
fn main() {
App::new()
.add_plugins(DefaultPlugins)

View file

@ -32,7 +32,8 @@ impl Plugin for MenuPlugin {
/// ```
/// App::new()
/// .add_plugins(DefaultPlugins)
/// .add_plugins(MenuPlugin); // .add_systems(Update, ui_connect_button)
/// .add_plugins(EguiPlugin)
/// .add_systems(Update, ui_connect_button);
/// ```
fn ui_connect_button(mut address: ResMut<Address>, mut egui_ctx: EguiContexts) {
// Create the window
@ -63,14 +64,14 @@ fn ui_connect_button(mut address: ResMut<Address>, mut egui_ctx: EguiContexts) {
/// ```
/// App::new()
/// .add_plugins(DefaultPlugins)
/// .add_plugins(MenuPlugin); // .add_systems(Update, ui_host_button)
/// ```
/// .add_plugins(EguiPlugin)
/// .add_systems(Update, ui_host_button);
fn ui_host_button(mut egui_ctx: EguiContexts, mut address: ResMut<Address>) {
// Create the window
egui::Window::new("Host")
.default_width(400.0)
.show(egui_ctx.ctx_mut(), |ui| {
// Create the text
// Create a button to create a new game
let button = ui.button("Create new game");
// Create the host button