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:
@@ -0,0 +1,6 @@
|
||||
[gd_scene load_steps=2 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/common/components/deck_picker_button.gd" id="1_dpb"]
|
||||
|
||||
[node name="DeckPickerButton" type="Button"]
|
||||
script = ExtResource("1_dpb")
|
||||
@@ -0,0 +1,18 @@
|
||||
extends Button
|
||||
## Reusable deck-picker button — shows deck name + card count and emits picked(id).
|
||||
|
||||
signal picked(id: String)
|
||||
|
||||
var _id : String = ""
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
alignment = HORIZONTAL_ALIGNMENT_LEFT
|
||||
add_theme_font_size_override("font_size", 14)
|
||||
custom_minimum_size = Vector2(0, 44)
|
||||
pressed.connect(func(): picked.emit(_id))
|
||||
|
||||
|
||||
func setup(id: String, deck_name: String, card_count: int) -> void:
|
||||
_id = id
|
||||
text = "%s (%d cards)" % [deck_name, card_count]
|
||||
Reference in New Issue
Block a user