From b5dff8c55eff569155d2eece7fd7f122e17990b9 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Fri, 10 Apr 2026 23:53:54 +0200 Subject: [PATCH] fix(ui): gameplay_occluded signal never fired on first fullscreen toggle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit was_occluded was computed AFTER _active_mode and _active_app were updated to the new values, so it always matched now_occluded on the first toggle (both TRUE). The signal condition (was != now) never triggered. Moved the check before the state mutation. This bug affected every GameplayRenderer (world, entities, fog, cursor) and the stance indicator — none of them hid on first fullscreen app open. Co-Authored-By: Claude Opus 4.6 (1M context) --- client/scripts/autoloads/hud_groups.gd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/scripts/autoloads/hud_groups.gd b/client/scripts/autoloads/hud_groups.gd index a89b940a9..d199dd74a 100644 --- a/client/scripts/autoloads/hud_groups.gd +++ b/client/scripts/autoloads/hud_groups.gd @@ -61,6 +61,9 @@ func unregister(node: CanvasItem, group: String) -> void: ## Open an implant app in fullscreen (default) or insert mode. func open_app(app: String, mode: Mode = Mode.FULLSCREEN) -> void: + # Capture occlusion state BEFORE mutating — used for change detection below + var was_occluded := _active_mode == Mode.FULLSCREEN and not _active_app.is_empty() + # Close previous app if different if not _active_app.is_empty() and _active_app != app: _set_group_z(_active_app, Z_GAMEPLAY) @@ -70,7 +73,6 @@ func open_app(app: String, mode: Mode = Mode.FULLSCREEN) -> void: _active_mode = mode # Set z-levels based on mode - var was_occluded := _active_mode == Mode.FULLSCREEN and not _active_app.is_empty() if mode == Mode.FULLSCREEN: _set_group_z("gameplay", Z_GAMEPLAY) _set_group_z(app, Z_FULLSCREEN)