- Define `pname` once and inherit it in the package definition.
- Change description to “TUI underground RTS”.
- Set `mainProgram` to `pname` for consistency.
Export `block_title` and `helpers` with `pub mod` for external use.
Add Nix improvements: version check hook, update script, install check.
Include post‑install step to copy soundtracks and rename binary.
Extend meta with platforms, mainProgram, and maintainer handling.
Update docs to show required imports for block title helpers.
Move Units enum from the units module into the skirmish state module,
add a dedicated Players enum, and remove the now‑unused unit module.
Update all imports accordingly.
Adjust CellWidget's set_zoom_level and set_structure to return &mut
Self,
enabling method chaining.
The refactor removes the `Buildings` enum and the `building` module,
replacing
`CellTag` with a new `CellStructure` enum that directly holds a
`BaseBuilding`.
A `get_owner` method is added to `BaseBuilding` to support the new
structure.
All related imports, constructors, and rendering logic are updated to
use
`CellStructure` instead of the old tag and building fields.
Introduce BaseBuilding struct. Rename Building and Unit to enum types
(Buildings, Units). Move CellTag and Players enums to the skirmish state
module and update imports and re‑exports accordingly. Add placeholder
miner module.
Introduce empty Building and Unit types and expose them
through new modules. Extend CellWidget to store optional
Unit and Building, update its constructor, and adjust board
rendering to create cells with these new fields (currently always None).
CellWidget::set_selected and set_marked now return &mut Self for method
chaining. Added BoardState::undo_marked_cell to remove the last marked
cell and restore focus. Backspace triggers undo, Delete clears marking.
Introduce a public `BoardState::toggle_marking` that flips the
marking mode and starts or clears marking accordingly. Refactor
`set_marked_cell` to accept tuple coordinates and clean up its
logic. Update `change_focused_cell` to work with the new signature
and use the toggle helper. Adjust cell display to show coordinates
when a cell is marked.
Introduce a marking mode that lets users toggle cells with Space and
clear
them with Backspace. BoardState now stores `marking_cells` and a list of
`marked_cells` and provides methods to start, clear, and update marks.
CellWidget tracks a `marked` flag and renders marked cells in
LightMagenta.
Keybindings are updated: Space now reads “Marking cells”, Backspace
reads
“Cancel marking”, and the original Enter binding is commented out.
The former `resize_change` and `zoom_change` functions are renamed to
`change_resize` and `change_zoom`; all call sites are updated
accordingly.
Introduce `CellTag` and `Players` enums and extend `CellWidget` to carry
a tag.
Store player and enemy base coordinates in `BoardState` and tag those
cells.
Reduce horizontal margin from 3 to 1 in board layout helpers.
Change CLI defaults: map width default 42, map height min 11 and default
11.
Adjust offset calculation and render constraints to match the new
layout.
The event loop function is now defined in `events.rs`, the redundant
`handle_events.rs` file is removed, and the module re‑exports are
updated
to expose `handle_events` from `events`.
Introduce a `Soundtrack` enum with Clap `ValueEnum` support and expose
it in the CLI as a `--sound-track` option. Extend `AudioCmd` with a
`ChangeSoundtrack` variant and refactor audio handling to load and cache
soundtracks per‑track using a thread‑safe `RwLock`. Update the
`handle_audio` function signature to accept the selected soundtrack,
adjust re‑exports, and modify `main` to pass the chosen soundtrack to
the audio thread. Also reposition the logging flag in the CLI
definition.
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.
Introduce a `ChangePart` variant to `AudioCmd` and a `current_part`
state in
`handle_audio`. The audio sink is now created via
`DeviceSinkBuilder::from_default_device` with a fixed buffer size.
`load_audio`
now accepts a reference to `SoundrackParts`, and the player
automatically
queues the correct part when the queue becomes empty.
Update `CellWidget::new` to take a `selected` flag and remove the
chaining return values from `set_selected` and `set_zoom_level`. The
board code now passes the selection state directly during construction.
Store cells as a nested vector instead of a flat list, simplifying
indexing and
rendering. Add `is_focused_cell_visible` to detect when the focused cell
is
outside the viewport and adjust vertical/horizontal offsets accordingly
in
the skirmish keybindings. Update related methods and widget rendering to
use
the new 2‑D structure.
Introduce a MoveFocusedCell enum and a BoardState.change_focused_cell
method to
centralize focus movement logic. Update skirmish keybindings to use this
new
method and simplify board rendering by directly using stored CellWidget
state.
Make CellWidget setters chainable and expose the new enum in the module
re‑exports. Remove duplicated max_offset logic and old move_* methods.
- 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.
Rename the input event handler module and function.
Update imports, re‑exports, and main.rs to use handle_events.
Add a brief doc comment for the new function.
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`.
Store the input event thread handle and join it after the app finishes.
This
replaces the previous fire‑and‑forget spawn and ensures the thread is
cleanly
terminated before the program exits.
Rename the generic `Event` enum to `AppEvent` and propagate the change
through `app.rs`, `mod.rs`, and `main.rs`. Adjust function signatures,
imports, and channel usage to use the new name and the `read` helper
from crossterm. Ensure all senders/receivers now work with `AppEvent`.
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.
Extract Offset and FocusedCell structs from skirmish.rs into a new
skirmish_states module. Re-export the structs from the top-level states
module and adjust imports in skirmish.rs.
- 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
Introduce a new `zoom_level` module containing the `CellSizes` enum and
`cell_size_helper` function to map `ZoomLevel` values to width and
height
dimensions. Export the helper from `mod.rs` and refactor `BoardWidget`
to
import and use `cell_size_helper`, eliminating duplicated match
statements.
- Initialize FocusedCell with map dimensions and start near the map
centre.
- Store max rows/cols in FocusedCell and clamp moves to these bounds.
- Scroll actions now adjust the corresponding offset and also move the
focused cell, keeping navigation consistent.
- Zoom actions modify the vertical offset to keep the view centered
after
changing zoom levels.
- Cell widget now uses a Padding widget with dynamic top padding based
on
the area height.
Introduce `col_to_letters` to convert a zero‑based column index into
Excel‑style
letters. Add `display_coords` that returns the column letters followed
by the
row number. Update `render` to use this formatted coordinate as the
block
title instead of the previous row/col placeholder.
Extensive doc comments were added to keybindings, CLI options, logging,
and
widget modules. The `count_largest_group` function was introduced to
compute
the largest group size among actions. CLI validation for
`skill_points_limit`
was broadened to a 90‑690 range. Imports and signatures for `Display`
were
adjusted accordingly.
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.
Add `value_initiated` and `max_initiated` flags to prevent
repeated assignments. Provide `set_initial_value` for one‑time
initialisation and use it to centre the vertical offset when
creating the board widget. Remove stale comments on cell size constants.
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.
- 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.