generated from GarandPLG/rust-flake-template
Add tab navigation for building and recruitment UI
- Add selection indices and option lists to SkirmishState. - Implement `cycle_popup_option` and expose Left/Right actions in keybindings. - Introduce `cancel_focused_tasks` in BoardState for Delete handling. - CellWidget now displays recruitment progress on Base structures. - Update README and documentation to describe new tabs and arrow navigation. - Adjust test counts and add extensive task‑cancellation tests.
This commit is contained in:
1 parent
6c1141a711
commit
110d4c411a
16 files changed
+546
-48
No files matched your search
@@ -354,7 +354,7 @@ fn cancellation_restores_original_ore_and_refunds_cost_exactly_once() -> () {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn panel_shows_progress_and_delete_cancels_while_escape_only_closes_panel() -> () {
|
||||
fn panel_shows_progress_delete_cancels_and_escape_is_ignored() -> () {
|
||||
let mut app: App = app();
|
||||
for _ in 0..2 {
|
||||
handle_keybindings(&mut app, KeyEvent::new(KeyCode::Left, KeyModifiers::NONE));
|
||||
@@ -389,6 +389,7 @@ fn panel_shows_progress_and_delete_cancels_while_escape_only_closes_panel() -> (
|
||||
assert!(text.contains("Construction: 0%"));
|
||||
assert!(text.contains("Delete - Cancel construction"));
|
||||
handle_keybindings(&mut app, KeyEvent::new(KeyCode::Esc, KeyModifiers::NONE));
|
||||
assert!(app.states_ref().unwrap().skirmish.building_view);
|
||||
assert!(matches!(
|
||||
app.states_ref().unwrap().skirmish.board.cells[5][1].get_structure(),
|
||||
Structures::MineConstruction(_)
|
||||
@@ -397,6 +398,11 @@ fn panel_shows_progress_and_delete_cancels_while_escape_only_closes_panel() -> (
|
||||
&mut app,
|
||||
KeyEvent::new(KeyCode::Char('b'), KeyModifiers::NONE),
|
||||
);
|
||||
assert!(!app.states_ref().unwrap().skirmish.building_view);
|
||||
handle_keybindings(
|
||||
&mut app,
|
||||
KeyEvent::new(KeyCode::Char('b'), KeyModifiers::NONE),
|
||||
);
|
||||
handle_keybindings(&mut app, KeyEvent::new(KeyCode::Delete, KeyModifiers::NONE));
|
||||
assert!(matches!(
|
||||
app.states_ref().unwrap().skirmish.board.cells[5][1].get_structure(),
|
||||
|
||||
Reference in new issue
Block a user