Block input behind open panels; keep craft-menu messages on screen

Three play-testing reports.

1. Buttons behind an open panel were still clickable. There are two
   input paths and both leaked. GUI clicks: the research and formation
   panels cannot block with mouse_filter = STOP, because their contents
   are driven from raw _unhandled_input and a Control consuming touches
   through the GUI system swallows them first - so the panels stay
   transparent and IconButton now checks whether it is behind one, via a
   "modal_menus" group. Raw input: a touch landing on the research panel
   but missing a node was left unhandled, so it fell through to
   GameController - which sits on the ROOT node and sees whatever its
   children ignore - and moved the fleet or pinch-zoomed the world.

2. "Store ore here" looked dead. It was working: the confirmation was
   overwritten one frame later by the per-frame status refresh added in
   #16, so it flashed for a single frame. Craft-panel messages now
   outlive a refresh (3s), and the button stays ENABLED with an empty
   hold so pressing it can say why - a greyed button that cannot explain
   itself is the same dead-button problem.

3. The mothership's description could overlap the button below it. The
   description block was positioned from the TOP while the buttons were
   anchored to the BOTTOM, so the gap between them was whatever the
   screen height left over - overlapping at 1280 and separating at 960.
   It is one bottom-anchored stack now, checked at both.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Loïc Wisniewski 2026-08-11 20:17:58 +02:00
commit da8f6a81ea
7 changed files with 232 additions and 33 deletions

View file

@ -50,7 +50,25 @@ func _ready() -> void:
queue_redraw()
func _blocked_by_modal() -> bool:
# A panel is open and this button is not part of it, so it is sitting
# BEHIND the panel and must not react.
#
# The panels cannot simply swallow GUI input with a mouse_filter of STOP:
# the skill tree and the formation editor are driven from raw
# _unhandled_input (see SkillTreeView), and a Control that consumes
# touches through the GUI system swallows them before they ever get
# there. So the panels stay transparent to input and the buttons check
# instead.
for menu in get_tree().get_nodes_in_group("modal_menus"):
if menu.visible and not menu.is_ancestor_of(self):
return true
return false
func _gui_input(event: InputEvent) -> void:
if _blocked_by_modal():
return
if event is InputEventScreenTouch:
_handle_press(event.pressed, event.position)
accept_event()