generated from GarandPLG/rust-flake-template
Refactor to View enum and add keybindings
Replace the `default_window` string field with a `View` enum throughout the application. Introduce a new keybinding module providing `Action`, `KeyBinding` structs and helper functions, and integrate a keybindings widget into the main menu. Update the CLI to accept a `View` value enum and adjust imports and event handling accordingly. Add a release profile in `Cargo.toml` with LTO, single codegen unit, higher optimisation level and binary stripping for smaller, faster builds.
This commit is contained in:
+6
-3
@@ -1,15 +1,18 @@
|
||||
use clap::Parser;
|
||||
|
||||
use crate::app::View;
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(version, about = "War in Tunnels", long_about = "War in Tunnels")]
|
||||
pub struct Cli {
|
||||
#[arg(
|
||||
long,
|
||||
help = "Default window",
|
||||
value_name = "main_menu | skirmish | skills_config | perk_decks | settings",
|
||||
default_value = "main_menu"
|
||||
value_name = "...",
|
||||
default_value_t = View::MainMenu,
|
||||
value_enum
|
||||
)]
|
||||
pub default_window: String,
|
||||
pub window: View,
|
||||
|
||||
#[arg(
|
||||
long,
|
||||
|
||||
Reference in New Issue
Block a user