Use the access-inspection mockup behind the inspection panel
Add the access_inspection art layer to the HUD, keep the panel transparent and padded, center the title/status/issue text and artifact cards, and hide the art with the panel. Also record the pop-up visual pass as done. Headless 226/226 verified in a clean HEAD worktree.
This commit is contained in:
1 parent
c8b98fdb30
commit
dc4bc6c511
3 files changed
+34
-3
No files matched your search
+32
-1
@@ -56,6 +56,8 @@ var _log_lines: Array[String] = []
|
||||
var _cam_overlay: Control = null
|
||||
var _wand_art_layer: Control = null
|
||||
var _wand_art := UiArt.new()
|
||||
var _inspect_art_layer: Control = null
|
||||
var _inspect_art := UiArt.new()
|
||||
var _body_camera_on := false
|
||||
var _font_scale := 1.0
|
||||
var _base_font_sizes: Dictionary = {}
|
||||
@@ -256,6 +258,19 @@ func _init() -> void:
|
||||
icon_row.add_child(wand_icon)
|
||||
|
||||
# --- inspect panel (popup center) ---
|
||||
_inspect_art_layer = Control.new()
|
||||
_inspect_art_layer.name = "InspectArt"
|
||||
_inspect_art_layer.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
_inspect_art_layer.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
_inspect_art_layer.visible = false
|
||||
add_child(_inspect_art_layer)
|
||||
if not _inspect_art.add_screen_backdrop(_inspect_art_layer, "access_inspection",
|
||||
Rect2(0.220, 0.026, 0.474, 0.935)):
|
||||
var inspect_dim := ColorRect.new()
|
||||
inspect_dim.color = Color(0, 0, 0, 0.55)
|
||||
inspect_dim.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
inspect_dim.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
_inspect_art_layer.add_child(inspect_dim)
|
||||
var inspect_center := CenterContainer.new()
|
||||
inspect_center.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
inspect_center.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
@@ -263,18 +278,29 @@ func _init() -> void:
|
||||
inspect_panel = PanelContainer.new()
|
||||
inspect_panel.visible = false
|
||||
inspect_panel.modulate.a = 1.0
|
||||
inspect_panel.custom_minimum_size = Vector2(520, 0)
|
||||
var inspect_style := StyleBoxFlat.new()
|
||||
inspect_style.bg_color = Color(0, 0, 0, 0)
|
||||
inspect_style.content_margin_left = 28
|
||||
inspect_style.content_margin_right = 28
|
||||
inspect_style.content_margin_top = 20
|
||||
inspect_style.content_margin_bottom = 20
|
||||
inspect_panel.add_theme_stylebox_override("panel", inspect_style)
|
||||
var ivbox := VBoxContainer.new()
|
||||
inspect_panel.add_child(ivbox)
|
||||
inspect_text = Label.new()
|
||||
inspect_text.add_theme_font_size_override("font_size", 15)
|
||||
inspect_text.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
ivbox.add_child(inspect_text)
|
||||
inspect_meta = Label.new()
|
||||
inspect_meta.add_theme_font_size_override("font_size", 12)
|
||||
inspect_meta.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
inspect_meta.modulate = Color(0.8, 0.85, 1.0)
|
||||
ivbox.add_child(inspect_meta)
|
||||
var insp_hint := Label.new()
|
||||
insp_hint.text = "A = allow entry D = deny entry"
|
||||
insp_hint.add_theme_font_size_override("font_size", 12)
|
||||
insp_hint.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
ivbox.add_child(insp_hint)
|
||||
inspect_center.add_child(inspect_panel)
|
||||
|
||||
@@ -531,10 +557,11 @@ func show_inspection(controller: Object, artifacts: Array, result: Dictionary) -
|
||||
var profile: Object = controller.profile
|
||||
var npc_display: String = (profile.display_name if profile else "Person")
|
||||
var granted: bool = result.get("granted", false)
|
||||
inspect_text.text = "Access check — %s\nGranted: %s" % [npc_display, "YES" if granted else "NO"]
|
||||
inspect_text.text = "ACCESS INSPECTION\n\nAccess check — %s\nGranted: %s" % [npc_display, "YES" if granted else "NO"]
|
||||
_clear_card_row()
|
||||
var card_row := HBoxContainer.new()
|
||||
card_row.name = "INSPECT_CARD_ROW"
|
||||
card_row.alignment = BoxContainer.ALIGNMENT_CENTER
|
||||
card_row.add_theme_constant_override("separation", 6)
|
||||
var added_card := false
|
||||
for artifact in artifacts:
|
||||
@@ -563,10 +590,14 @@ func show_inspection(controller: Object, artifacts: Array, result: Dictionary) -
|
||||
lines.append("Issues: " + "; ".join(result.get("issues", [])))
|
||||
inspect_meta.text = "\n".join(lines)
|
||||
inspect_panel.visible = true
|
||||
if _inspect_art_layer:
|
||||
_inspect_art_layer.visible = true
|
||||
|
||||
func hide_inspection() -> void:
|
||||
_clear_card_row()
|
||||
inspect_panel.visible = false
|
||||
if _inspect_art_layer:
|
||||
_inspect_art_layer.visible = false
|
||||
|
||||
## Remove previously added artifact cards so reopening rebuilds them.
|
||||
func _clear_card_row() -> void:
|
||||
|
||||
Reference in new issue
Block a user