Add settings menu to control audio and return to main menu

This commit is contained in:
Ben Calegari 2026-07-28 22:01:28 -07:00
parent c88d3fc625
commit 0b7bc936ef
13 changed files with 697 additions and 22 deletions

View file

@ -139,10 +139,11 @@ namespace TD.Gameplay
// Escape: clear selection. Allowed during placement mode too — Escape never
// means anything else here, and clearing selection during placement is fine.
// Suppressed while chat (or any HUD text field) has focus, since Escape there
// means "cancel typing" and should not also clear the unit selection.
// Suppressed while chat (or any HUD text field) has focus or the gear menu is
// open, since Escape there means "cancel typing" / "back out of the menu" and
// should not also clear the unit selection.
if (keyboard != null && keyboard.escapeKey.wasPressedThisFrame
&& !HUDController.IsTextInputActive)
&& !HUDController.IsUiCapturingInput)
{
SelectionState.Instance?.Clear();
}
@ -153,7 +154,7 @@ namespace TD.Gameplay
// Tab: select the builder, or (if already selected) recenter the camera on it.
if (keyboard != null && keyboard.tabKey.wasPressedThisFrame
&& !HUDController.IsTextInputActive)
&& !HUDController.IsUiCapturingInput)
{
var selection = SelectionState.Instance;
if (selection != null && selection.IsSelected(builder))