From 48082cf098dcc23b78c625e1187c59073eb14f07 Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Tue, 24 Dec 2024 21:16:11 +0100 Subject: [PATCH] add buttons to pause menu --- src/editor.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/editor.rs b/src/editor.rs index a02f3fe..77ea49e 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -620,10 +620,20 @@ impl Editor { } Popup::PauseMenu => { let bounds = screen_centered_rect(d, 300, 400); - d.draw_rectangle_rec(bounds, BG_DARK); + d.draw_rectangle_rec(bounds, BG_MEDIUM); let x = bounds.x as i32; let y = bounds.y as i32; - d.draw_text("Menu", x + 5, y + 5, 30, Color::LIGHTBLUE); + d.draw_text("Menu", x + 10, y + 10, 30, Color::LIGHTBLUE); + if text_button(d, &self.mouse, x + 10, y + 40, 280, "Resume") { + self.popup = Popup::None; + } + if text_button(d, &self.mouse, x + 10, y + 80, 280, "Save") { + self.exit_state = ExitState::Save; + self.popup = Popup::None; + } + if text_button(d, &self.mouse, x + 10, y + 120, 280, "Exit to main menu") { + self.exit_state = ExitState::ExitAndSave; + } } Popup::None => (), }