fix(ui): gameplay_occluded signal never fired on first fullscreen toggle

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) <noreply@anthropic.com>
This commit is contained in:
2026-04-10 23:53:54 +02:00
co-authored by Claude Opus 4.6
parent 6f02b9f4f4
commit b5dff8c55e
+3 -1
View File
@@ -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)