use crate::graphics::menus::retro_parameter_table::generic_logic::{
get_default_action_input, CellValue, FooterData, GenericMenu, RowData,
};
use ratatui::DefaultTerminal;
pub fn setup_and_run_doc_table_parameters(terminal: &mut DefaultTerminal) {
GenericMenu::new(
load_doc_info_in_table(),
&doc_get_headers(),
doc_get_footer_data(),
None,
)
.run(get_default_action_input(), terminal);
}
#[must_use]
fn load_doc_info_in_table() -> Vec<RowData> {
let rows = vec![
RowData::new(vec![
CellValue::new("đ¯ Goal".to_string()),
CellValue::new("Eat fruits, grow, and score points.".to_string()),
]),
RowData::new(vec![
CellValue::new("đ Fruits".to_string()),
CellValue::new(
"Different fruits give various scores and effects.\n\
Some can even reduce your size (and score)."
.to_string(),
),
]),
RowData::new(vec![
CellValue::new("đ Speed".to_string()),
CellValue::new(
"Game speed changes difficulty and score multipliers.\n\
See the Speed menu for more details."
.to_string(),
),
]),
RowData::new(vec![
CellValue::new("đŽ Movement".to_string()),
CellValue::new("Use â â â to control the snake.".to_string()),
]),
RowData::new(vec![
CellValue::new("đĨ Collisions".to_string()),
CellValue::new("Avoid hitting yourself or your own tail.".to_string()),
]),
RowData::new(vec![
CellValue::new("đ Walls".to_string()),
CellValue::new(
"The arena wraps around: going out on one side\n\
makes you appear on the opposite side."
.to_string(),
),
]),
RowData::new(vec![
CellValue::new("â¸ī¸ Pause".to_string()),
CellValue::new("Press P or Space to pause / resume.".to_string()),
]),
RowData::new(vec![
CellValue::new("đ New game".to_string()),
CellValue::new("Press R to start a new game.".to_string()),
]),
RowData::new(vec![
CellValue::new("đ Main menu".to_string()),
CellValue::new("Press M to return to the main menu.".to_string()),
]),
RowData::new(vec![
CellValue::new("đĒ Quit".to_string()),
CellValue::new("Press Q to quit at any time.".to_string()),
]),
];
rows
}
#[must_use]
fn doc_get_headers() -> Vec<String> {
vec!["đ Topic".to_string(), "âšī¸ Details".to_string()]
}
#[must_use]
fn doc_get_footer_data() -> Vec<FooterData> {
vec![
FooterData {
symbol: "Esc".into(),
text: "Return to home".into(),
value: None,
},
FooterData {
symbol: "â".into(),
text: "Move".into(),
value: None,
},
]
}