Standardize programmatic UI to scene-based instantiation (Phases 1-5)

Convert all screens that built UI nodes in GDScript into proper .tscn
scene files. Each component gets its own scene; parent screens use
preload + instantiate; data flows through setup() methods; actions use
signals. Eliminates ~1000 lines of boilerplate node-creation code.

Phase 1 — Simple row components (6 new scenes):
  LeaderboardRow, NotificationRow, StarterDeckCard, DeckPickerButton,
  StatRow, AbilityRow
  Modifies: leaderboard_screen, account_screen, starter_deck_screen,
            matchmaking_screen, card_detail_popup (GridContainer→VBox)

Phase 2 — Lobby browser rows (2 new scenes):
  LobbyBrowserRow (signal join_requested), ActiveGameRow (signal spectate_requested)
  Modifies: free_play_screen

Phase 3 — RulesEditorDialog (1 new scene):
  Replaces 150+ line _open_rules_editor() in lobby_room_screen with
  4-line instantiate pattern; signal confirmed(overrides)

Phase 4 — DeckEditorPanel.tscn:
  Moves split-pane deck editor into scene file; removes _setup_ui(),
  _make_left_pane(), _make_right_pane(); switches to @onready refs;
  DecksView.tscn updated to instance the scene

Phase 5 — ChatOverlay.tscn:
  Fully populates ChatPanel with header, 7 tab buttons, 7 content panes
  (FriendsPane/PresencePane/GlobalPane/LobbyPane/GamePane/PartyPane/DmsPane),
  and InputBar; removes _build_panel() and all _make_*/_build_*_tab()
  functions from chat_overlay.gd; replaces with @onready refs and
  _ready() wiring from scene children

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-03-21 12:33:15 -04:00
co-authored by Claude Happy
parent d5d444c31d
commit b1a51cb862
31 changed files with 1340 additions and 1019 deletions
@@ -1,5 +1,7 @@
extends Control
## Matchmaking screen — join ranked queue, wait for opponent, cancel.
const DECK_BTN = preload("res://scenes/common/components/DeckPickerButton.tscn")
##
## Flow:
## 1. _ready: fetch player's decks via collection.get_decks
@@ -73,14 +75,14 @@ func _on_decks_response(_type: String, payload: Variant) -> void:
status_label.text = "Choose a deck"
sub_label.text = ""
for deck: Dictionary in decks:
var btn := Button.new()
btn.text = "%s (%d cards)" % [deck.get("name", "Unnamed"), int(deck.get("cardCount", 0))]
btn.alignment = HORIZONTAL_ALIGNMENT_LEFT
btn.custom_minimum_size = Vector2(0, 44)
btn.add_theme_font_size_override("font_size", 14)
var did := str(deck.get("id", ""))
btn.pressed.connect(func() -> void:
_selected_deck_id = did
var btn := DECK_BTN.instantiate()
btn.setup(
str(deck.get("id", "")),
str(deck.get("name", "Unnamed")),
int(deck.get("cardCount", 0))
)
btn.picked.connect(func(id: String) -> void:
_selected_deck_id = id
_join_queue())
deck_list.add_child(btn)