Use the radio and wand mockups behind their forms
Draw radio_report/emergency_radio behind a transparent, padded form and switch the backdrop with the call type. The wand HUD popup now shows wand_screening behind its text while open. Both covers use the mockup panel bounds so baked-in controls stay hidden. Headless 226/226 verified in a clean HEAD worktree.
This commit is contained in:
1 parent
8582e496ff
commit
8032999a4d
3 files changed
+66
-7
No files matched your search
@@ -8,6 +8,7 @@ signal submitted(report: Dictionary, emergency: bool)
|
||||
signal cancelled()
|
||||
|
||||
const Rules := preload("res://src/core/rules.gd")
|
||||
const UiArt := preload("res://src/game/ui/art.gd")
|
||||
|
||||
var panel: PanelContainer
|
||||
var npc_name_label: Label
|
||||
@@ -26,19 +27,32 @@ var _hold_time := 0.0
|
||||
const HOLD_NEEDED := 1.6
|
||||
var _truth := {"weapons_seen": false, "danger_level": 0}
|
||||
|
||||
var _art := UiArt.new()
|
||||
var _art_layer: Control = null
|
||||
|
||||
func _init() -> void:
|
||||
name = "RadioPanel"
|
||||
layer = 20
|
||||
var dim := ColorRect.new()
|
||||
dim.color = Color(0, 0, 0, 0.55)
|
||||
dim.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
add_child(dim)
|
||||
_art_layer = Control.new()
|
||||
_art_layer.name = "RadioArt"
|
||||
_art_layer.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
_art_layer.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
add_child(_art_layer)
|
||||
_paint_backdrop()
|
||||
|
||||
var center := CenterContainer.new()
|
||||
center.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
center.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
add_child(center)
|
||||
panel = PanelContainer.new()
|
||||
panel.custom_minimum_size = Vector2(560, 0)
|
||||
var panel_style := StyleBoxFlat.new()
|
||||
panel_style.bg_color = Color(0, 0, 0, 0)
|
||||
panel_style.content_margin_left = 28
|
||||
panel_style.content_margin_right = 28
|
||||
panel_style.content_margin_top = 22
|
||||
panel_style.content_margin_bottom = 22
|
||||
panel.add_theme_stylebox_override("panel", panel_style)
|
||||
center.add_child(panel)
|
||||
|
||||
var vbox := VBoxContainer.new()
|
||||
@@ -99,13 +113,28 @@ func _init() -> void:
|
||||
|
||||
var _title_label: Label
|
||||
|
||||
func _paint_backdrop() -> void:
|
||||
if _art_layer == null:
|
||||
return
|
||||
for child in _art_layer.get_children():
|
||||
_art_layer.remove_child(child)
|
||||
child.queue_free()
|
||||
var art_name := "emergency_radio" if _emergency else "radio_report"
|
||||
var rect := Rect2(0.120, 0.058, 0.697, 0.882) if _emergency else Rect2(0.176, 0.033, 0.585, 0.923)
|
||||
if not _art.add_screen_backdrop(_art_layer, art_name, rect):
|
||||
var dim := ColorRect.new()
|
||||
dim.color = Color(0, 0, 0, 0.55)
|
||||
dim.set_anchors_preset(Control.PRESET_FULL_RECT)
|
||||
_art_layer.add_child(dim)
|
||||
|
||||
func open(controller: Object, emergency: bool, truth: Dictionary) -> void:
|
||||
_emergency = emergency
|
||||
_paint_backdrop()
|
||||
_truth = truth
|
||||
_npc_id = controller.npc_id if controller else ""
|
||||
npc_name_label.text = "Target: %s" % (controller.profile.display_name if controller else "?")
|
||||
var title: Label = panel.find_child("RadioTitle", true, false)
|
||||
title.text = "EMERGENCY CALL" if emergency else "Security Assistance"
|
||||
title.text = "EMERGENCY RADIO" if emergency else "RADIO DISPATCH"
|
||||
weapons_check.button_pressed = truth.get("weapons_seen", false)
|
||||
danger_option.select(truth.get("danger_level", 1))
|
||||
hold_hint.text = "Hold the button for %.1fs" % HOLD_NEEDED if emergency else ""
|
||||
|
||||
Reference in new issue
Block a user