Commit Graph

8 Commits

Author SHA1 Message Date
GarandPLG 7ec3eec6e3 Preload audio using once_cell and correct typo
Add once_cell 1.21.4 and a Lazy‑initialized HashMap to store OGG bytes.

Replace file reads with in‑memory Cursor decoding, fix the
SoundrackParts enum typo, and derive Hash traits for it.
2026-04-09 01:37:57 +02:00
GarandPLG 30f2e17ed7 Add audio deps; extract input handling to threads
Add ALSA and Rodio crates to Cargo.toml and lockfile to enable audio
playback.
Update Nix expressions to include `alsa-lib` as a build input.
Refactor input event handling into a new `app::threads` module:
 - Define `AppEvent` enum and `handle_input_events` function there.
 - Adjust imports in `app/app.rs` and `main.rs` accordingly.
   Remove the now‑unused `handle_input_events` and `AppEvent`
   definitions from
   `app/app.rs`.
2026-04-06 11:47:46 +02:00
GarandPLG ba0028b7a7 Refactor keybindings and add validated CLI arguments
Extracted common quit/esc handling into `common_keybindings`. Introduced
`Group::CtrlMovement` for Ctrl‑arrow keys and updated keybinding
definitions.
Removed duplicated quit logic in main_menu and skirmish modules. Bumped
clap to 4.6.0 and updated Cargo.lock. Added range‑checked parsers for
map
size, resources, supply limit, XP modifier and skill points in the CLI.
2026-03-27 20:15:15 +01:00
GarandPLG a0186ea0cb Add optional file logging and fix board offsets
Introduce --log CLI flag to enable logging to
war_in_tunnels.log via simplelog.
2026-03-27 18:28:16 +01:00
GarandPLG de42569a51 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.
2026-03-10 14:26:18 +01:00
GarandPLG 64eb906b5f Drop crossterm delete App add CLI defaults
Remove the crossterm dependency and its input handling, delete the
now‑unused
App module, and provide default values for all command‑line options.
2026-03-09 19:53:31 +01:00
GarandPLG 17e00610a7 init 2026-03-02 17:46:35 +01:00
GarandPLG 1575ff81c1 Initial commit 2026-03-02 16:15:20 +00:00