HUD: merge TimeDisplay into ImplantPanel (time/health/perception in one panel), remove dead tscn nodes, move HUD to InsertOverlay for D-051 bloom. Interaction prompt: convert from PanelContainer+StyleBoxFlat to Control with ImplantPanel+ImplantDataRow, fix panel height for 42px minimum. Tests updated for new scene structure and public API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
extends PanelContainer
|
||||
extends Control
|
||||
|
||||
# Interaction prompt — displays available interaction verb for nearby entity.
|
||||
# Server-driven: shows when GameState.nearby_interactions is non-empty,
|
||||
@@ -17,24 +17,28 @@ var _current_target_id: int = -1
|
||||
# OQ-07 (#522): when false, prompt is suppressed (z-layer 6 insert overlay only)
|
||||
var _insert_active: bool = true
|
||||
|
||||
@onready var prompt_label: Label = $MarginContainer/PromptLabel
|
||||
var _panel: ImplantPanel
|
||||
var _row: ImplantDataRow
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
modulate.a = 0.0
|
||||
visible = false
|
||||
_is_showing = false
|
||||
# D-169: Apply implant theme
|
||||
var t := load("res://ui/implant/default_implant.tres") as ImplantTheme
|
||||
if t:
|
||||
var style := StyleBoxFlat.new()
|
||||
style.bg_color = t.panel_bg
|
||||
style.border_color = t.separator
|
||||
style.set_border_width_all(int(t.border_width))
|
||||
style.set_content_margin_all(t.padding)
|
||||
add_theme_stylebox_override("panel", style)
|
||||
prompt_label.add_theme_color_override("font_color", t.text_primary)
|
||||
prompt_label.add_theme_font_size_override("font_size", t.font_body)
|
||||
mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
|
||||
var theme_res := load("res://ui/implant/default_implant.tres") as ImplantTheme
|
||||
|
||||
_panel = ImplantPanel.new()
|
||||
_panel.name = "PromptPanel"
|
||||
_panel.theme_resource = theme_res
|
||||
_panel.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
_panel.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
add_child(_panel)
|
||||
|
||||
_row = ImplantDataRow.new("", theme_res.text_primary if theme_res else Color.WHITE)
|
||||
_row.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
_panel.add_component(_row)
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
@@ -63,8 +67,8 @@ func _show_prompt(interaction: Dictionary) -> void:
|
||||
var verb_label: String = verbs[0].get("label", "")
|
||||
var display_text: String = "E - %s" % verb_label
|
||||
|
||||
if _current_target_id != target_id or prompt_label.text != display_text:
|
||||
prompt_label.text = display_text
|
||||
if _current_target_id != target_id or _row.text != display_text:
|
||||
_row.set_content(display_text)
|
||||
_current_target_id = target_id
|
||||
|
||||
if not _is_showing:
|
||||
|
||||
Reference in New Issue
Block a user