Building list in the HUD, selectable #141

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

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

A HUD list of every placed building. The player can click a row to select the building, as an alternative to clicking it 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 placed building, with its type name and status (PLANNED, UNDER_CONSTRUCTION, BUILT, RUINED).
  • It updates on building_placed, building_removed and building_status_changed, with no polling.
  • In NONE, clicking a row sets GameState.selected to that building. 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 building 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

  • Grouping by type or status, and filtering
  • The details view (#142)
  • Worker slot controls (#136)
Part of milestone #6 (Selection and inspection). Depends on #78. A HUD list of every placed building. The player can click a row to select the building, as an alternative to clicking it 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 placed building, with its type name and `status` (PLANNED, UNDER_CONSTRUCTION, BUILT, RUINED). - [ ] It updates on `building_placed`, `building_removed` and `building_status_changed`, with no polling. - [ ] In NONE, clicking a row sets `GameState.selected` to that building. 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 building 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 - Grouping by type or status, and filtering - The details view (#142) - Worker slot controls (#136)
Author
Owner

Closed in PR#147

Closed in PR#147
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#141
No description provided.