119 Commits

Author SHA1 Message Date
GarandPLG acc6ba08f3 Add popup toggle to settings view
Introduce `show_popup` flag in SettingsState, toggle it with the Space
key, and
render a yellow test popup in the settings view when the flag is true.
2026-03-14 20:35:03 +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
GarandPLG d563bbc966 Add Settings view, widget, and keybindings
Introduce Settings view handling in key events and widgets.
Add `Enter` action with its keybinding.
Refactor keybinding lookup to use `Option<&KeyBinding>` for missing
entries.
Update view option generation to safely filter possible values.
Export `settings_keybindings` and `settings_widget` from their modules.
2026-03-13 09:31:55 +01:00
GarandPLG 7226a09bb4 Extract default view keybindings and widget
Move generic view rendering and keybinding logic into a new default
module and
replace inline implementations with calls to the new helpers.
2026-03-12 23:06:55 +01:00
GarandPLG 70a8ac348e Refactor keybindings widget and reorder Group enum
- Introduce `KeybindingsWidget::new(view)` constructor and remove the
  standalone `keybindings_widget` function.
- Update all imports and call sites to use `KeybindingsWidget` directly.
- Reorder `Group` enum to place `Quit` after `Select` and adjust its
  iterator accordingly.
2026-03-12 22:47:22 +01:00
GarandPLG 073e70441f Add group filtering and layout for keybindings UI
Return the set of used groups from `binding_for_view` and adjust
`keybindings_widget` to render only those groups. Introduce a vertical
layout in the main widget to display a placeholder paragraph above
the keybindings area, and update imports and border logic accordingly.
2026-03-12 17:31:31 +01:00
GarandPLG 8b7c2c55ce Extract keybinding handling to separate module 2026-03-12 16:37:52 +01:00
GarandPLG ef271c0d87 Add Quit2 action bound to Ctrl+C 2026-03-12 16:30:54 +01:00
GarandPLG c3886ca0cf Add resize handling and non-blocking input loop
Use `recv_timeout` to prevent UI blocking, forward terminal resize
events,
adjust keybinding width calculation, and replace percentage layout with
fill/length for the main menu.
2026-03-12 16:23:54 +01:00
GarandPLG 71b9d44a77 Refactor keybindings with groups and symbols
Introduce a `Group` enum to categorize actions and add `group` and
`symbol`
fields to `KeyBinding`. Extend `Action` with `Up`, `Down`, `Space`, and
`Esc`, updating all keybinding definitions accordingly.

Update `binding_for_view` to return the new actions per view and handle
`Esc` by returning to the main menu.

Rewrite the keybindings widget as a custom `Widget` that renders grouped
paragraphs with proper layout.

Adjust the main menu layout percentages to accommodate the new widget.
2026-03-12 16:00:45 +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 e98f1ddc24 dodanie draftów ui 2026-03-06 10:08: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