refactor(shell): author shell scenes as editor-previewable node trees

Move the three shell scenes (SystemDock, NarrationBook, MainWindowShell)
from build-everything-in-_ready() to authored .tscn node trees with the
theme + type-variations set in the editor, so the layout previews and can
be arranged in the Godot editor. Scripts keep only on-load work: @onready
node refs, DM-loop wiring, the dock slide, and binding seed ShellState into
the fixed authored turn-order tokens + consumable slots.

Fixes the dock offset + over-long buttons (now fixed-width DockButtons in a
right-anchored menu). Headless probe: root 1920x1080, world/book split
1180/740, dock at the world's right edge — no collapse. Suite 138/138.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-11 09:38:22 -05:00
parent 578b3e86c9
commit 4698732285
6 changed files with 525 additions and 218 deletions

View File

@@ -1,6 +1,284 @@
[gd_scene load_steps=2 format=3]
[gd_scene load_steps=6 format=3]
[ext_resource type="Script" path="res://scripts/ui/shell/main_window_shell.gd" id="1"]
[ext_resource type="Theme" path="res://assets/theme/game_theme.tres" id="2"]
[ext_resource type="PackedScene" path="res://scenes/theme/surfaces/DarkBay.tscn" id="3"]
[ext_resource type="PackedScene" path="res://scenes/shell/SystemDock.tscn" id="4"]
[ext_resource type="PackedScene" path="res://scenes/shell/NarrationBook.tscn" id="5"]
[node name="MainWindowShell" type="Control"]
layout_mode = 3
anchors_preset = 0
offset_right = 1920.0
offset_bottom = 1080.0
theme = ExtResource("2")
script = ExtResource("1")
[node name="Split" type="HBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
theme_override_constants/separation = 0
[node name="World" type="Control" parent="Split"]
layout_mode = 2
size_flags_horizontal = 3
clip_contents = true
[node name="Bay" parent="Split/World" instance=ExtResource("3")]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
[node name="Caption" type="Label" parent="Split/World"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
grow_horizontal = 2
grow_vertical = 2
theme_type_variation = &"Mono"
text = "ISOMETRIC WORLD VIEW"
[node name="TurnRail" type="PanelContainer" parent="Split/World"]
layout_mode = 1
anchors_preset = 0
offset_left = 28.0
offset_top = 28.0
offset_right = 300.0
offset_bottom = 128.0
theme_type_variation = &"DarkPanel"
[node name="Col" type="VBoxContainer" parent="Split/World/TurnRail"]
layout_mode = 2
theme_override_constants/separation = 8
[node name="Title" type="Label" parent="Split/World/TurnRail/Col"]
layout_mode = 2
theme_type_variation = &"Mono"
text = "TURN ORDER"
[node name="Tokens" type="HBoxContainer" parent="Split/World/TurnRail/Col"]
layout_mode = 2
theme_override_constants/separation = 12
[node name="T0" type="Label" parent="Split/World/TurnRail/Col/Tokens"]
layout_mode = 2
theme_type_variation = &"Accent"
text = "EL"
[node name="T1" type="Label" parent="Split/World/TurnRail/Col/Tokens"]
layout_mode = 2
theme_type_variation = &"Accent"
text = "DW"
[node name="T2" type="Label" parent="Split/World/TurnRail/Col/Tokens"]
layout_mode = 2
theme_type_variation = &"Accent"
text = "HU"
[node name="T3" type="Label" parent="Split/World/TurnRail/Col/Tokens"]
layout_mode = 2
theme_type_variation = &"Accent"
text = "✕"
[node name="T4" type="Label" parent="Split/World/TurnRail/Col/Tokens"]
layout_mode = 2
theme_type_variation = &"Accent"
text = "—"
[node name="Minimap" type="PanelContainer" parent="Split/World"]
custom_minimum_size = Vector2(200, 200)
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -228.0
offset_top = 28.0
offset_right = -28.0
offset_bottom = 228.0
grow_horizontal = 0
theme_type_variation = &"DarkPanel"
[node name="Label" type="Label" parent="Split/World/Minimap"]
layout_mode = 2
horizontal_alignment = 1
vertical_alignment = 1
theme_type_variation = &"Mono"
text = "MINIMAP"
[node name="SystemDock" parent="Split/World" instance=ExtResource("4")]
layout_mode = 1
anchors_preset = 6
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -268.0
offset_top = -210.0
offset_right = -28.0
offset_bottom = 210.0
grow_horizontal = 0
grow_vertical = 2
[node name="CommandBar" type="HBoxContainer" parent="Split/World"]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 28.0
offset_top = -150.0
offset_right = -28.0
grow_vertical = 0
theme_override_constants/separation = 24
alignment = 1
[node name="Vitals" type="VBoxContainer" parent="Split/World/CommandBar"]
custom_minimum_size = Vector2(230, 0)
layout_mode = 2
size_flags_vertical = 8
theme_override_constants/separation = 8
[node name="HP" type="Label" parent="Split/World/CommandBar/Vitals"]
layout_mode = 2
theme_type_variation = &"Mono"
text = "HP 42 / 60"
[node name="MP" type="Label" parent="Split/World/CommandBar/Vitals"]
layout_mode = 2
theme_type_variation = &"Mono"
text = "MP 18 / 30"
[node name="Gold" type="Label" parent="Split/World/CommandBar/Vitals"]
layout_mode = 2
theme_type_variation = &"Mono"
text = "◈ 1240 gp"
[node name="Consumables" type="HBoxContainer" parent="Split/World/CommandBar"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 8
theme_override_constants/separation = 9
alignment = 1
[node name="Slot1" type="PanelContainer" parent="Split/World/CommandBar/Consumables"]
custom_minimum_size = Vector2(62, 62)
layout_mode = 2
size_flags_vertical = 4
theme_type_variation = &"ItemTile"
[node name="Label" type="Label" parent="Split/World/CommandBar/Consumables/Slot1"]
layout_mode = 2
horizontal_alignment = 1
vertical_alignment = 2
theme_type_variation = &"Mono"
text = "Salve"
[node name="Slot2" type="PanelContainer" parent="Split/World/CommandBar/Consumables"]
custom_minimum_size = Vector2(62, 62)
layout_mode = 2
size_flags_vertical = 4
theme_type_variation = &"ItemTile"
[node name="Label" type="Label" parent="Split/World/CommandBar/Consumables/Slot2"]
layout_mode = 2
horizontal_alignment = 1
vertical_alignment = 2
theme_type_variation = &"Mono"
text = "Draught"
[node name="Slot3" type="PanelContainer" parent="Split/World/CommandBar/Consumables"]
custom_minimum_size = Vector2(62, 62)
layout_mode = 2
size_flags_vertical = 4
theme_type_variation = &"ItemTile"
[node name="Label" type="Label" parent="Split/World/CommandBar/Consumables/Slot3"]
layout_mode = 2
horizontal_alignment = 1
vertical_alignment = 2
theme_type_variation = &"Mono"
text = "Bomb"
[node name="Slot4" type="PanelContainer" parent="Split/World/CommandBar/Consumables"]
custom_minimum_size = Vector2(62, 62)
layout_mode = 2
size_flags_vertical = 4
theme_type_variation = &"ItemTile"
[node name="Label" type="Label" parent="Split/World/CommandBar/Consumables/Slot4"]
layout_mode = 2
horizontal_alignment = 1
vertical_alignment = 2
theme_type_variation = &"Mono"
text = "Antidote"
[node name="Slot5" type="PanelContainer" parent="Split/World/CommandBar/Consumables"]
custom_minimum_size = Vector2(62, 62)
layout_mode = 2
size_flags_vertical = 4
theme_type_variation = &"ItemTile"
[node name="Label" type="Label" parent="Split/World/CommandBar/Consumables/Slot5"]
layout_mode = 2
horizontal_alignment = 1
vertical_alignment = 2
theme_type_variation = &"Mono"
text = "Ration"
[node name="Slot6" type="PanelContainer" parent="Split/World/CommandBar/Consumables"]
custom_minimum_size = Vector2(62, 62)
layout_mode = 2
size_flags_vertical = 4
theme_type_variation = &"ItemTile"
[node name="Label" type="Label" parent="Split/World/CommandBar/Consumables/Slot6"]
layout_mode = 2
horizontal_alignment = 1
vertical_alignment = 2
theme_type_variation = &"Mono"
text = "Torch"
[node name="Slot7" type="PanelContainer" parent="Split/World/CommandBar/Consumables"]
custom_minimum_size = Vector2(62, 62)
layout_mode = 2
size_flags_vertical = 4
theme_type_variation = &"ItemTileEmpty"
[node name="Label" type="Label" parent="Split/World/CommandBar/Consumables/Slot7"]
layout_mode = 2
horizontal_alignment = 1
vertical_alignment = 2
theme_type_variation = &"Mono"
[node name="Slot8" type="PanelContainer" parent="Split/World/CommandBar/Consumables"]
custom_minimum_size = Vector2(62, 62)
layout_mode = 2
size_flags_vertical = 4
theme_type_variation = &"ItemTileEmpty"
[node name="Label" type="Label" parent="Split/World/CommandBar/Consumables/Slot8"]
layout_mode = 2
horizontal_alignment = 1
vertical_alignment = 2
theme_type_variation = &"Mono"
[node name="EndTurn" type="Button" parent="Split/World/CommandBar"]
custom_minimum_size = Vector2(150, 60)
layout_mode = 2
size_flags_vertical = 4
theme_type_variation = &"PrimaryCTA"
text = "END TURN"
[node name="BookPanel" type="PanelContainer" parent="Split"]
custom_minimum_size = Vector2(740, 0)
layout_mode = 2
theme_type_variation = &"ParchmentCard"
[node name="Book" parent="Split/BookPanel" instance=ExtResource("5")]
layout_mode = 2

View File

@@ -1,6 +1,85 @@
[gd_scene load_steps=2 format=3]
[gd_scene load_steps=3 format=3]
[ext_resource type="Script" path="res://scripts/ui/shell/narration_book.gd" id="1"]
[ext_resource type="Theme" path="res://assets/theme/game_theme.tres" id="2"]
[node name="NarrationBook" type="Control"]
layout_mode = 3
anchors_preset = 0
offset_right = 740.0
offset_bottom = 1080.0
theme = ExtResource("2")
script = ExtResource("1")
[node name="Margin" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
theme_override_constants/margin_left = 40
theme_override_constants/margin_top = 34
theme_override_constants/margin_right = 40
theme_override_constants/margin_bottom = 34
[node name="Col" type="VBoxContainer" parent="Margin"]
layout_mode = 2
theme_override_constants/separation = 18
[node name="Header" type="Label" parent="Margin/Col"]
layout_mode = 2
theme_type_variation = &"Accent"
text = "ROUND 4 · THE LOWER WARD"
[node name="Prose" type="RichTextLabel" parent="Margin/Col"]
custom_minimum_size = Vector2(660, 320)
layout_mode = 2
size_flags_vertical = 3
bbcode_enabled = true
text = "The alley stinks of piss and rot. Rain beads on the cobbles and runs black into the gutter."
fit_content = true
[node name="DegradedTag" type="Label" parent="Margin/Col"]
visible = false
layout_mode = 2
theme_type_variation = &"Mono"
text = "THE MASTER'S VOICE COMES THIN"
[node name="Prompt" type="Label" parent="Margin/Col"]
layout_mode = 2
theme_type_variation = &"Accent"
text = "▸ Your turn. What do you do?"
[node name="Choice1" type="Button" parent="Margin/Col"]
layout_mode = 2
disabled = true
theme_type_variation = &"ParchmentButton"
text = "1 · Pay the fence double and keep your hand where he can see it"
alignment = 0
[node name="Choice2" type="Button" parent="Margin/Col"]
layout_mode = 2
disabled = true
theme_type_variation = &"ParchmentButton"
text = "2 · Draw your blade — he's closer than his guards"
alignment = 0
[node name="Choice3" type="Button" parent="Margin/Col"]
layout_mode = 2
disabled = true
theme_type_variation = &"ParchmentButton"
text = "3 · Lie — tell him the rest is coming with your dwarf"
alignment = 0
[node name="FreeText" type="Label" parent="Margin/Col"]
layout_mode = 2
theme_type_variation = &"Mono"
text = "⌨ …or describe your own action"
[node name="Refire" type="Button" parent="Margin/Col"]
layout_mode = 2
theme_type_variation = &"ParchmentButton"
text = "▸ The Master continues…"
[node name="Status" type="Label" parent="Margin/Col"]
layout_mode = 2
theme_type_variation = &"Mono"

View File

@@ -1,6 +1,86 @@
[gd_scene load_steps=2 format=3]
[gd_scene load_steps=3 format=3]
[ext_resource type="Script" path="res://scripts/ui/shell/system_dock.gd" id="1"]
[ext_resource type="Theme" path="res://assets/theme/game_theme.tres" id="2"]
[node name="SystemDock" type="Control"]
layout_mode = 3
anchors_preset = 0
offset_right = 240.0
offset_bottom = 420.0
theme = ExtResource("2")
script = ExtResource("1")
[node name="Menu" type="VBoxContainer" parent="."]
layout_mode = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -190.0
offset_right = -10.0
offset_bottom = 316.0
grow_horizontal = 0
theme_override_constants/separation = 10
[node name="Inventory" type="Button" parent="Menu"]
custom_minimum_size = Vector2(0, 42)
layout_mode = 2
theme_type_variation = &"DockButton"
text = "I Inventory"
alignment = 0
metadata/screen_id = &"inventory"
[node name="Character" type="Button" parent="Menu"]
custom_minimum_size = Vector2(0, 42)
layout_mode = 2
theme_type_variation = &"DockButton"
text = "C Character"
alignment = 0
metadata/screen_id = &"character"
[node name="QuestLog" type="Button" parent="Menu"]
custom_minimum_size = Vector2(0, 42)
layout_mode = 2
theme_type_variation = &"DockButton"
text = "J Quest Log"
alignment = 0
metadata/screen_id = &"quest_log"
[node name="Spellbook" type="Button" parent="Menu"]
custom_minimum_size = Vector2(0, 42)
layout_mode = 2
theme_type_variation = &"DockButton"
text = "K Spellbook"
alignment = 0
metadata/screen_id = &"spellbook"
[node name="WorldMap" type="Button" parent="Menu"]
custom_minimum_size = Vector2(0, 42)
layout_mode = 2
theme_type_variation = &"DockButton"
text = "M World Map"
alignment = 0
metadata/screen_id = &"world_map"
[node name="Party" type="Button" parent="Menu"]
custom_minimum_size = Vector2(0, 42)
layout_mode = 2
theme_type_variation = &"DockButton"
text = "P Party"
alignment = 0
metadata/screen_id = &"party"
[node name="Handle" type="Button" parent="."]
custom_minimum_size = Vector2(26, 104)
layout_mode = 1
anchor_left = 1.0
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_left = -222.0
offset_top = -52.0
offset_right = -196.0
offset_bottom = 52.0
grow_horizontal = 0
grow_vertical = 2
theme_type_variation = &"TabActive"
text = ""