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:
+16
-8
@@ -118,8 +118,9 @@ func _ready() -> void:
|
||||
_info_panel.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
add_child(_info_panel)
|
||||
|
||||
# D-170: Register with HUD visibility groups
|
||||
# D-170: Register with HUD layer groups
|
||||
HudGroups.register(self, "implant/map/starchart")
|
||||
HudGroups.app_changed.connect(_on_app_changed)
|
||||
|
||||
_load_data()
|
||||
if _data_loaded:
|
||||
@@ -135,20 +136,27 @@ func _process(_delta: float) -> void:
|
||||
|
||||
|
||||
## Called from main.gd when insert state changes.
|
||||
## Only force-hides when insert is inactive. Does NOT auto-show — star map is
|
||||
## modal (player opens via toggle_visible()), not always-on like the minimap.
|
||||
## Called from main.gd when insert state changes.
|
||||
func set_insert_active(active: bool) -> void:
|
||||
_insert_active = active
|
||||
if not active:
|
||||
visible = false
|
||||
if not active and HudGroups.is_app_active("implant/map/starchart"):
|
||||
HudGroups.close_app()
|
||||
|
||||
|
||||
## Toggle visibility via HUD group system (D-170).
|
||||
## Opens implant/map (hides gameplay) or closes it (returns to gameplay).
|
||||
## Toggle via HUD layer system (D-170).
|
||||
func toggle_visible() -> void:
|
||||
HudGroups.toggle_app("implant/map/starchart")
|
||||
if visible:
|
||||
|
||||
|
||||
## Respond to app layer changes (D-170).
|
||||
func _on_app_changed(app_path: String, mode: HudGroups.Mode) -> void:
|
||||
if app_path != "implant/map/starchart":
|
||||
return
|
||||
if mode == HudGroups.Mode.FULLSCREEN or mode == HudGroups.Mode.INSERT:
|
||||
visible = true
|
||||
_dirty = true
|
||||
else:
|
||||
visible = false
|
||||
|
||||
|
||||
## Return the currently selected system data, or empty dict.
|
||||
|
||||
Reference in New Issue
Block a user