Fix @onready null crash: add_child before setup() across all scene rows
@onready vars are resolved when a node enters the scene tree. Calling setup() before add_child() means all %NodeName refs are still null, causing "Invalid assignment... on base object of type Nil" errors. Fixed ordering in every affected screen: - free_play_screen.gd: LobbyBrowserRow, ActiveGameRow, DeckPickerButton - lobby_room_screen.gd: RulesEditorDialog - matchmaking_screen.gd: DeckPickerButton - card_detail_popup.gd: StatRow, AbilityRow - starter_deck_screen.gd: StarterDeckCard - account_screen.gd: NotificationRow - leaderboard_screen.gd: LeaderboardRow 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:
@@ -76,15 +76,15 @@ func _on_decks_response(_type: String, payload: Variant) -> void:
|
||||
sub_label.text = ""
|
||||
for deck: Dictionary in decks:
|
||||
var btn := DECK_BTN.instantiate()
|
||||
btn.picked.connect(func(id: String) -> void:
|
||||
_selected_deck_id = id
|
||||
_join_queue())
|
||||
deck_list.add_child(btn)
|
||||
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)
|
||||
|
||||
# ── Queue actions ─────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Reference in New Issue
Block a user