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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user