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