Esc and the main menu leave PLACE and DEMOLISH modes #139

Closed
opened 2026-09-30 21:50:53 +01:00 by liamjd · 0 comments
Owner

Part of milestone #6 (Selection and inspection).

Esc currently always toggles the main menu (common/game.gd:75, on ui_cancel), whatever the interaction mode is. Nothing clears GameState.interaction_mode when the menu opens, so a player in PLACE or DEMOLISH who presses Esc gets the menu on top of an armed ghost, and the mode is still armed when the menu closes.

The rule for leaving PLACE or DEMOLISH (decided 2026-09-30) is: do the action, right-click, press Esc, or open the main menu. Clicking another UI element, such as the #78 lists, does not leave the mode.

Acceptance criteria

  • In PLACE or DEMOLISH, Esc sets interaction_mode to NONE and does nothing else. The menu does not open.
  • In NONE, Esc toggles the main menu as it does now.
  • Opening the main menu by any route sets interaction_mode to NONE, so the mode never survives underneath the menu.
  • Esc inside the options or keybindings panels keeps its current behaviour (options_panel.gd, keybindings_panel.gd also handle ui_cancel).
  • Covered by a unit test on the mode transitions. A headed check confirms the ghost disappears on Esc.

Decisions

  • 2026-09-30: Esc leaves the mode first. A second Esc opens the menu. One press never does both.

Out of scope

  • Mode-specific cursors and a demolish confirmation dialog (#123 mentions both).
Part of milestone #6 (Selection and inspection). Esc currently always toggles the main menu (`common/game.gd:75`, on `ui_cancel`), whatever the interaction mode is. Nothing clears `GameState.interaction_mode` when the menu opens, so a player in PLACE or DEMOLISH who presses Esc gets the menu on top of an armed ghost, and the mode is still armed when the menu closes. The rule for leaving PLACE or DEMOLISH (decided 2026-09-30) is: do the action, right-click, press Esc, or open the main menu. Clicking another UI element, such as the #78 lists, does **not** leave the mode. ## Acceptance criteria - [ ] In PLACE or DEMOLISH, Esc sets `interaction_mode` to NONE and does nothing else. The menu does not open. - [ ] In NONE, Esc toggles the main menu as it does now. - [ ] Opening the main menu by any route sets `interaction_mode` to NONE, so the mode never survives underneath the menu. - [ ] Esc inside the options or keybindings panels keeps its current behaviour (`options_panel.gd`, `keybindings_panel.gd` also handle `ui_cancel`). - [ ] Covered by a unit test on the mode transitions. A headed check confirms the ghost disappears on Esc. ## Decisions - 2026-09-30: Esc leaves the mode first. A second Esc opens the menu. One press never does both. ## Out of scope - Mode-specific cursors and a demolish confirmation dialog (#123 mentions both).
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.

Dependencies

No dependencies set.

Reference
liamjd/UntitledColonyBuilder#139
No description provided.