Commit Graph

12 Commits

Author SHA1 Message Date
GarandPLG 9300eef906 Initialize skirmish board and refactor states
- Create `GameStates` from a `&Cli` and initialize the skirmish board in
  `App::new`.
- Move map dimensions to `SkirmishState` and add a `board_cells` vector
  populated by `CellWidget`s.
- Refactor `SettingsState` to store only user‑specific settings (fields
  are cloned).
- Update `BoardWidget` to hold a reference to the cell vector and use
  the new dimensions.
- Adjust CLI defaults: map width to 50 and map height to 25.
2026-03-27 19:25:20 +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 cc179cee03 Add scrolling actions and board widget
Introduce directional and scroll actions, update keybindings, add
scrollbar
state to SkirmishState, and render the board with a new BoardWidget.
Adjust CLI
defaults and layout heights accordingly.
2026-03-26 11:05:43 +01:00
GarandPLG 0577697059 Replace settings module with skirmish mode
Removed the settings UI and its keybinding logic, added a skirmish view
and corresponding keybindings, simplified the SettingsState to hold
skirmish configuration, updated module exports, and changed the CLI
default map height from 25 to 21. Also fixed the main menu selection
limit.
2026-03-17 14:28:46 +01:00
GarandPLG aaa2c90426 Refactor gaamestates 2026-03-16 21:58:43 +01:00
GarandPLG 61e9dedfe8 Refactor view handling and keybinding API
Move the `View` enum to a dedicated module and implement `Widget` for
`&App` there.
Rename `default_view_keybindings` to `default_keybindings` and adjust
its
signature. Redesign `KeybindingsWidget` to accept an explicit list of
bindings instead of a `View`. Update imports, function signatures, and
rendering
logic across the codebase to reflect these changes.
2026-03-13 20:10:49 +01:00
GarandPLG f481f5dc87 Add GameStates, typed enums, and App::new constructor 2026-03-12 00:19:22 +01:00
GarandPLG ec1aa4fbe8 Refactor keybinding handling and update widgets
- Remove the old `keybindings.rs` and stop re‑exporting its symbols.
- Add view‑specific handling: `App::handle_key_event` now delegates to
  `main_menu_keybindings` when the view is `MainMenu`.
- Update imports in `app.rs`, `widget.rs`, and widget modules to use the
  new `app::keybindings` path.
- Enhance `keybindings_widget` to display ↑, ↓ and “Space” for special
  keys.
- Change main menu layout percentages from 90/10 to 87/13.
- Reorder the `clap` import in `cli.rs` for consistency.
2026-03-10 16:29:27 +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 a9b84bbe0f Add comprehensive CLI options for game settings
- Expanded `Cli` with arguments for username, game mode, map size, perk
  deck, resources, supply limit, XP modifier, and skill points limit.
- Enabled the `cli` module in `lib.rs` and activated argument parsing in
  `main.rs`.
- Added placeholder (commented) fields to `App` for future configuration
  integration.
2026-03-09 16:54:10 +01:00
GarandPLG 17e00610a7 init 2026-03-02 17:46:35 +01:00