Critical: - Protocol test assertions updated v6→v7 (test_protocol_v6.gd) - Dialogue signal connections wired (option_selected→DialogueResponse, dialogue_dismissed→DialogueEnd sent to server via SimBridge) - Consume-once race fixed: _consume_dialogue() checks is_dialogue_active() before re-showing; dialogue_id tracking prevents re-trigger during fade - Dialogue box responsive: _update_layout() clamps width to MAX_WIDTH_PX (832px) or 65% viewport, height to 20% viewport (MAX_HEIGHT_RATIO) - Auto-pause added: SimBridge.send_input(PAUSE) on dialogue open/close Warnings: - Test coverage: 16 new tests in test_protocol_v7.gd (pending_recognitions decode, current_dialogue, GameState, SimBridge mock data, insert colors) - queue_redraw() optimization: early return when no entities and no pings - Fixed 200px height → responsive 20% viewport via _update_layout() Suggestions: - WASD detection refactored to _WALK_AWAY_ACTIONS array loop - Button colors reference Constants.INSERT_COLOR_TEXT/HOVER/ACTIVE - Named constants: COLOR_TRANSITION_START, SILHOUETTE_APPEAR_THRESHOLD, SILHOUETTE_SIZE with explanatory comments - Bounds check: MAX_PENDING_RECOGNITIONS=64 with truncation warning - Mock dialogue sustained across ticks (not 1-tick flash) - COLOR_PING coupling with cursor documented as intentional - Consume helpers extracted: _consume_monologue(), _consume_dialogue() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
50 lines
1.4 KiB
Plaintext
50 lines
1.4 KiB
Plaintext
[gd_scene load_steps=2 format=3 uid="uid://d4k7g2nxp1h8j"]
|
|
|
|
[ext_resource type="Script" path="res://ui/dialogue_box.gd" id="1_dialogue"]
|
|
|
|
[node name="DialogueBox" type="Control"]
|
|
layout_mode = 3
|
|
anchors_preset = 12
|
|
anchor_top = 1.0
|
|
anchor_right = 1.0
|
|
anchor_bottom = 1.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 0
|
|
mouse_filter = 2
|
|
script = ExtResource("1_dialogue")
|
|
|
|
[node name="PanelContainer" type="PanelContainer" parent="."]
|
|
layout_mode = 1
|
|
anchors_preset = 7
|
|
anchor_left = 0.5
|
|
anchor_top = 1.0
|
|
anchor_right = 0.5
|
|
anchor_bottom = 1.0
|
|
offset_left = -416.0
|
|
offset_top = -200.0
|
|
offset_right = 416.0
|
|
grow_horizontal = 2
|
|
grow_vertical = 0
|
|
|
|
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"]
|
|
layout_mode = 2
|
|
theme_override_constants/margin_left = 20
|
|
theme_override_constants/margin_top = 14
|
|
theme_override_constants/margin_right = 20
|
|
theme_override_constants/margin_bottom = 14
|
|
|
|
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer"]
|
|
layout_mode = 2
|
|
theme_override_constants/separation = 10
|
|
|
|
[node name="NpcSpeech" type="RichTextLabel" parent="PanelContainer/MarginContainer/VBoxContainer"]
|
|
layout_mode = 2
|
|
bbcode_enabled = true
|
|
text = ""
|
|
fit_content = true
|
|
scroll_active = false
|
|
|
|
[node name="OptionsContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer/VBoxContainer"]
|
|
layout_mode = 2
|
|
theme_override_constants/separation = 4
|