rsnaker/graphics/menus/
status.rs1use crate::graphics::menus::layout_utils::render_full_centered_paragraph;
2use ratatui::style::Color;
3use ratatui::Frame;
4
5const GAME_OVER_TEXT: &str = "\n\
9 ██████╗ █████╗ ███╗ ███╗███████╗ ██████╗ ██╗ ██╗███████╗██████╗ \n\
10██╔═══ ██╔══██╗████╗ ████║██╔════╝ ██╔═══██╗██║ ██║██╔════╝██╔══██╗\n\
11██║ ████║███████║██╔████╔██║█████╗ ██║ ██║██║ ██║█████╗ ██████╔╝\n\
12██║ ██║██╔══██║██║╚██╔╝██║██╔══╝ ██║ ██║██║ ██║██╔══╝ ██╔══██╗\n\
13╚██████╔╝██║ ██║██║ ╚═╝ ██║███████╗ ╚██████╔╝╚██████╔╝███████╗██║ ██║\n\
14 ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝\n\
15 Press R to restart the game ! \n\
16 Press M to go back to menu ! \n\
17 Press Q to quit ! ";
18
19const PAUSE_TEXT: &str = "\n\
20██████╗ █████╗ ██╗ ██╗███████╗███████╗\n\
21██╔══██╗██╔══██╗██║ ██║██╔════╝██╔════╝\n\
22██████╔╝███████║██║ ██║███████╗█████╗ \n\
23██╔═══╝ ██╔══██║██║ ██║╚════██║██╔══╝ \n\
24██║ ██║ ██║╚██████╔╝███████║███████╗\n\
25╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚══════╝";
26const MENU_TEXT: &str = "\n\
28███╗ ███╗███████╗███╗ ██╗██╗ ██╗
29████╗ ████║██╔════╝████╗ ██║██║ ██║
30██╔████╔██║█████╗ ██╔██╗ ██║██║ ██║
31██║╚██╔╝██║██╔══╝ ██║╚██╗██║██║ ██║
32██║ ╚═╝ ██║███████╗██║ ╚████║╚██████╔╝
33╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ ╚═════╝ ";
34
35const FAREWELL_TEXT: &str = "\n\
36██████╗ ██╗ ██╗███████╗ ██████╗ ██╗ ██╗███████╗
37██╔══██╗╚██╗ ██╔╝██╔════╝ ██╔══██╗╚██╗ ██╔╝██╔════╝
38██████╔╝ ╚████╔╝ █████╗█████╗██████╔╝ ╚████╔╝ █████╗
39██╔══██╗ ╚██╔╝ ██╔══╝╚════╝██╔══██╗ ╚██╔╝ ██╔══╝
40██████╔╝ ██║ ███████╗ ██████╔╝ ██║ ███████╗
41╚═════╝ ╚═╝ ╚══════╝ ╚═════╝ ╚═╝ ╚══════╝";
42
43const RESTART_TEXT: &str = "\n\
44██████╗ ███████╗███████╗████████╗ █████╗ ██████╗ ████████╗
45██╔══██╗██╔════╝██╔════╝╚══██╔══╝██╔══██╗██╔══██╗╚══██╔══╝
46██████╔╝█████╗ ███████╗ ██║ ███████║██████╔╝ ██║
47██╔══██╗██╔══╝ ╚════██║ ██║ ██╔══██║██╔══██╗ ██║
48██║ ██║███████╗███████║ ██║ ██║ ██║██║ ██║ ██║
49╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ";
50
51pub fn game_over_paragraph(frame: &mut Frame) {
52 render_full_centered_paragraph(frame, GAME_OVER_TEXT, Some(Color::Red));
53}
54pub fn pause_paragraph(frame: &mut Frame) {
55 render_full_centered_paragraph(frame, PAUSE_TEXT, None);
56}
57pub fn byebye_paragraph(frame: &mut Frame) {
58 render_full_centered_paragraph(frame, FAREWELL_TEXT, Some(Color::DarkGray));
59}
60pub fn restart_paragraph(frame: &mut Frame) {
61 render_full_centered_paragraph(frame, RESTART_TEXT, Some(Color::LightYellow));
62}
63pub fn menu_paragraph(frame: &mut Frame) {
64 render_full_centered_paragraph(frame, MENU_TEXT, Some(Color::Gray));
66}