Pawn list in the HUD, selectable #140

Closed
opened 2026-09-30 21:50:54 +01:00 by liamjd · 1 comment
Owner

Part of milestone #6 (Selection and inspection). Depends on #78.

A HUD list of every pawn in the colony. The player can click a row to select the pawn, as an alternative to clicking its capsule on the map.

Both lists follow the same rules, decided on 2026-09-30:

  • Clicking a row selects that entity (sets GameState.selected, from #78). It does not move the camera.
  • Only in NONE mode. In PLACE or DEMOLISH, clicks on the list are ignored and the list does not leave the mode (see #78 and #139). An accidental click on the list must not throw away an armed ghost.
  • Dimmed outside NONE. In PLACE or DEMOLISH the list is visibly inactive (lower opacity, or rows disabled), so the ignored click is clearly intentional.
  • Translucent over the map, but still catches the mouse. Translucency is only how it looks. The list's controls use mouse_filter = STOP, so a click on the list never reaches the map. PlacementController and DemolishController already skip frames where gui_get_hovered_control() is not null. Test this with a list row directly over a valid building site.
  • Follows the selection back. Selecting on the map highlights the matching row. Deselecting clears it. The row is a view of GameState.selected, not a second copy (the same principle as BuildingPanel following interaction_mode in #72).

Acceptance criteria

  • The list shows one row per pawn, with its id (pawns have no name yet) and its state.
  • It updates on GameState.pawn_spawned / pawn_removed, with no polling.
  • The state shown per row stays current as pawns change state.
  • In NONE, clicking a row sets GameState.selected to that pawn. The camera does not move.
  • In PLACE or DEMOLISH, clicking a row does nothing and the mode is unchanged. The list is dimmed.
  • Selecting a pawn on the map highlights its row. Deselecting clears the highlight.
  • A click on the list over a valid site never places or demolishes anything underneath it.
  • Unit tests cover selection from a row and the ignored click. A headed screenshot shows the list over the map.

Out of scope

  • Pawn names and portraits
  • Sorting and filtering
  • The details view (#142)
Part of milestone #6 (Selection and inspection). Depends on #78. A HUD list of every pawn in the colony. The player can click a row to select the pawn, as an alternative to clicking its capsule on the map. Both lists follow the same rules, decided on 2026-09-30: - **Clicking a row selects** that entity (sets `GameState.selected`, from #78). It does **not** move the camera. - **Only in NONE mode.** In PLACE or DEMOLISH, clicks on the list are ignored and the list does not leave the mode (see #78 and #139). An accidental click on the list must not throw away an armed ghost. - **Dimmed outside NONE.** In PLACE or DEMOLISH the list is visibly inactive (lower opacity, or rows disabled), so the ignored click is clearly intentional. - **Translucent over the map, but still catches the mouse.** Translucency is only how it looks. The list's controls use `mouse_filter = STOP`, so a click on the list never reaches the map. `PlacementController` and `DemolishController` already skip frames where `gui_get_hovered_control()` is not null. Test this with a list row directly over a valid building site. - **Follows the selection back.** Selecting on the map highlights the matching row. Deselecting clears it. The row is a view of `GameState.selected`, not a second copy (the same principle as `BuildingPanel` following `interaction_mode` in #72). ## Acceptance criteria - [x] The list shows one row per pawn, with its id (pawns have no name yet) and its `state`. - [x] It updates on `GameState.pawn_spawned` / `pawn_removed`, with no polling. - [x] The state shown per row stays current as pawns change state. - [x] In NONE, clicking a row sets `GameState.selected` to that pawn. The camera does not move. - [x] In PLACE or DEMOLISH, clicking a row does nothing and the mode is unchanged. The list is dimmed. - [x] Selecting a pawn on the map highlights its row. Deselecting clears the highlight. - [x] A click on the list over a valid site never places or demolishes anything underneath it. - [ ] Unit tests cover selection from a row and the ignored click. A headed screenshot shows the list over the map. ## Out of scope - Pawn names and portraits - Sorting and filtering - The details view (#142)
Author
Owner

I haven't written any unit tests

I haven't written any unit tests
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Depends on
#78 Select a pawn or building on the map
liamjd/UntitledColonyBuilder
Reference
liamjd/UntitledColonyBuilder#140
No description provided.