Commit Graph

11 Commits

Author SHA1 Message Date
GarandPLG cd1822d05e Add lifetime parameter and MarkedCells struct
Refactor App, GameStates, SkirmishState and BoardState to carry a
generic
lifetime `'a`. Introduce a new `MarkedCells` type that holds marking
state
and selected unit, replacing the previous `marking_cells` flag and raw
deque. Update related methods, keybindings, view implementations and
module exports to use the new structures.
2026-05-06 21:39:53 +02:00
GarandPLG e3fea75983 Add zoom support and emoji keybinding icons
- CellWidget now stores a ZoomLevel, renders size‑dependent text, and
  provides
  methods to set the zoom level and build its block.
- BoardState creates cells with the current zoom level, adds a helper to
  get a
  mutable cell, and updates each cell’s zoom level in `zoom_change`.
- KeybindingsWidget constructor now takes the widget height, calculates
  vertical padding to centre groups, and adds left borders between
  groups.
- Views (default, main_menu, skirmish) pass the area height to the new
  constructor.
- Keybinding descriptions are replaced with emoji symbols (🔈, 🔊, 🔉).
- BoardWidget clones the cell template instead of dereferencing it.
2026-04-07 19:21:43 +02:00
GarandPLG 8e01c8c33a Add audio subsystem with mute and volume controls
Update flake.lock dependencies to latest revisions
2026-04-07 01:05:33 +02:00
GarandPLG 923af91aeb Lazy init game states and extract board module
App now stores CLI arguments and an optional GameStates, initializing
the
states lazily on the first window resize. Skirmish board logic is moved
to
a new BoardState module with dedicated helpers (cells_area_helper and
updated cell size handling). Views and keybindings are updated to use
the
optional state accessors.
2026-04-02 00:45:57 +02:00
GarandPLG f405c3cde1 Track window area and refactor keybinding APIs
- Track terminal size in `App::window_area` and update on resize
- Accept action slices in `count_largest_group` and
  `KeybindingsWidget::new`
- Add ACTIONS slices and layout helpers for default, main_menu, skirmish
- Add `main_menu_option_helper` for formatting menu strings and export
  it
2026-04-01 20:27:50 +02:00
GarandPLG 1d1dc0f2f7 Add zoom support and dynamic keybinding layout
Introduce ZoomIn/ZoomOut actions and a Zoom group with corresponding
keybindings.
Add a CLI option to set the initial zoom level and a ZoomLevel enum.
Expose a utility to compute the largest keybinding group size for layout
sizing.
Refactor board widget to adjust cell dimensions based on zoom level and
simplify offset calculations.
Update views to use the new layout sizing helper and integrate zoom
handling in skirmish logic.
2026-03-29 14:12:03 +02:00
GarandPLG 53a713b5ea 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.
2026-03-16 21:42:08 +01:00
GarandPLG fd0f6defea Rename GameStates to States and adjust keybindings
Replace the old `GameStates` struct with a new `states` module, rename
the
field in `App` to `states`, and update construction to pass CLI args.
Remove the now‑unused `game_states.rs` file and adjust imports
accordingly.
Update keybinding definitions: change the wildcard symbol to "[All]" and
simplify the wildcard detection logic by dropping the modifiers check.
2026-03-16 10:27:44 +01:00
GarandPLG 9d4ff19b6e KeybindingsWidget now accepts actions
Views now pass a list of `Action` values to `KeybindingsWidget` instead
of
pre‑resolved `KeyBinding` references. The widget resolves the bindings
internally using `binding_for`, simplifying import statements and view
logic.
2026-03-15 22:00:00 +01:00
GarandPLG 3d0aa42d7d Adopt clap::ValueEnum for Group and tidy menu view
- Derive `ValueEnum` for `Group` and remove its custom `iter` method.
- Update keybindings widget to use `Group::value_variants()` and adjust
  containment and filtering logic.
- Replace view option generation with a `format_view_string` helper that
  inserts a space before the second capital letter, eliminating the
  previous filter for “MAIN MENU”.
- Adjust imports to include `clap::ValueEnum` where needed.
2026-03-14 20:13:41 +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