add buttons to pause menu

This commit is contained in:
Crispy 2024-12-24 21:16:11 +01:00
parent a4cfbb4beb
commit 48082cf098

View file

@ -620,10 +620,20 @@ impl Editor {
} }
Popup::PauseMenu => { Popup::PauseMenu => {
let bounds = screen_centered_rect(d, 300, 400); 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 x = bounds.x as i32;
let y = bounds.y 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 => (), Popup::None => (),
} }