generated from GarandPLG/rust-flake-template
Refactor settings UI and add typed option handling
- Rename `GameMode::Frontlines` to `FrontLines`. - Introduce `SettingsValue` enum and `SettingsOption` vector for typed settings. - Implement `Display` for `SettingsValue`, `GameMode`, and `PerkDecks`. - Enhance settings keybindings: navigation with Up/Down, value parsing on Enter, and error messages. - Update settings view to render options list, selection marker, and popup with error feedback. - Restyle main menu selector and keybindings widget title. - Add required imports and minor layout adjustments.
This commit is contained in:
@@ -66,9 +66,9 @@ pub fn main_menu_view(app: &App, area: Rect, buf: &mut Buffer) {
|
||||
let view_string: String = format_view_string(format!("{:?}", view));
|
||||
|
||||
let styled: Line<'_> = if app.states.main_menu.selected_view == i {
|
||||
Line::from(format!("> {view_string}")).yellow()
|
||||
Line::from_iter(["> ".cyan(), view_string.yellow()]).yellow()
|
||||
} else {
|
||||
Line::from(view_string).white()
|
||||
Line::from(format!(" {view_string}")).white()
|
||||
};
|
||||
|
||||
styled
|
||||
|
||||
Reference in New Issue
Block a user