refactor(ui): HudGroups z-index model + gameplay occlusion (D-170)

Replaced visibility toggling with z-index layer management. Nothing
gets hidden — fullscreen apps render on top, gameplay stays underneath.
Supports future hybrid layouts (insert-mode map alongside gameplay).

Added gameplay_occluded signal: WorldRenderer skips tile/fog/entity
updates when a fullscreen implant app covers it. Prevents wasted
render work behind opaque overlays. Other renderers can connect to
the same signal.

Modes: GAMEPLAY (z=0), INSERT (z=10), FULLSCREEN (z=20), MODAL (z=30).
Star map uses app_changed signal to toggle its own visibility based
on whether its app is active.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-05 11:21:31 +02:00
co-authored by Claude Opus 4.6
parent 09e0c522bd
commit 2e01081de7
4 changed files with 125 additions and 75 deletions
@@ -21,13 +21,23 @@ var _last_tick: int = -1
@onready var sound_indicator_renderer = $SoundIndicators # #126 D-018 medium-range indicators
var _occluded: bool = false # D-170: skip rendering when fullscreen implant app is covering us
func _ready() -> void:
HudGroups.gameplay_occluded.connect(_on_gameplay_occluded)
print("WorldRenderer: Initialized (D-049 z-stack)")
func _on_gameplay_occluded(occluded: bool) -> void:
_occluded = occluded
# Called each frame to update visuals from game state.
# Uses tick-based invalidation — re-renders all layers when a new snapshot arrives.
func update_from_state() -> void:
if _occluded:
return # D-170: skip rendering while fullscreen implant app is active
var tick := GameState.current_tick
if tick == _last_tick:
return