From df28a16a550cae8532a65130282c2706edac73dc Mon Sep 17 00:00:00 2001 From: Bence <76205860+kbence04@users.noreply.github.com> Date: Sun, 30 Nov 2025 15:26:32 +0100 Subject: [PATCH] Added "Return to main menu" button to Private Play --- ui/src/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ui/src/main.rs b/ui/src/main.rs index b05da00..8ceaa35 100644 --- a/ui/src/main.rs +++ b/ui/src/main.rs @@ -14,7 +14,6 @@ use uuid::Uuid; #[tokio::main] async fn main() -> anyhow::Result<(), eframe::Error> { - // Set up logging let env = Env::default().filter_or("MY_LOG_LEVEL", "INFO"); env_logger::init_from_env(env); warn!("Initialized logger"); @@ -500,7 +499,13 @@ impl eframe::App for ChessApp { } self.connect_to_server(); } - + ui.add_space(20.0); + if ui.add_sized( + egui::Vec2::new(button_width, button_height), + egui::Button::new(egui::RichText::new("Return to main menu").size(font_size)) + ).clicked(){ + self.state=AppState::MainMenu; + } }) }); } @@ -585,7 +590,6 @@ impl eframe::App for ChessApp { ); let board_top_left = response.rect.left_top(); - // Draw board and pieces for row in 0..8 { for col in 0..8 {