Files
sor/Client/origin-client/scenes/free_play/LobbyRoomScreen.tscn
T
d61ebe66b8 Phase 8: Free Play ready-up system + client scenes
Server (Phase A):
- CustomLobby: +HostReady/GuestReady/HostFirstTurnPref/GuestFirstTurnPref/MaxPlayers
- Migration: AddReadyUpSystem — applied to prod DB
- GameJoinCustomLobbyHandler: no longer auto-creates session; sets Full status,
  resets readiness, pushes CustomLobbyGuestJoinedPush to host
- GameLobbyReadyHandler (NEW): game.custom.lobby.ready — marks caller ready,
  resolves first-turn, creates session + pushes game.custom.started when all ready
- GameUnreadyHandler (NEW): game.custom.lobby.unready
- GameChangeLobbyDeckHandler (NEW): game.custom.lobby.change_deck
- GameUpdateLobbyRulesHandler (NEW): game.custom.update_rules (host only)
- GameListActiveLobbiesHandler (NEW): game.custom.list_active (Status==Started)
- GameListCustomLobbiesHandler: now batch-loads host/guest display names
- GameMessages: +LobbyReadyRequest/Response, UnreadyInLobbyRequest/Response,
  ChangeLobbyDeckRequest/Response, UpdateLobbyRulesRequest/Response,
  ListActiveLobbiesRequest/Response, LobbyReadyStatusPush, LobbyDeckChangedPush,
  ActiveLobbyDto; CustomLobbyDto +HostDisplayName/GuestDisplayName
- ServiceRegistration: register 5 new handlers

Client (Phase B):
- CustomLobby.gd: new autoload for Free Play lobby state + all server calls
- project.godot: register CustomLobby autoload
- MainScreen: +Free Play button → FreePlayScreen.tscn
- FreePlayScreen (NEW): Open Lobbies tab + Active Games tab + Create dialog
- LobbyRoomScreen (NEW): ready-up UI, first-turn selector, preset voting
- Game.gd: +is_spectating, +start_spectating(), +stop_spectating()
- game_screen.gd: spectator mode — SPECTATING label, hidden action buttons,
  neutral HUD labels, stop_spectating() on exit

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>
2026-03-19 09:10:55 -04:00

308 lines
9.8 KiB
Plaintext

[gd_scene load_steps=2 format=3]
[ext_resource type="Script" path="res://scenes/free_play/lobby_room_screen.gd" id="1_lrs"]
[node name="LobbyRoomScreen" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_lrs")
[node name="Background" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.094, 0.094, 0.137, 1.0)
[node name="Layout" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 0
[node name="Header" type="HBoxContainer" parent="Layout"]
layout_mode = 2
custom_minimum_size = Vector2(0, 56)
[node name="HeaderMargin" type="MarginContainer" parent="Layout/Header"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/margin_left = 16
theme_override_constants/margin_right = 16
[node name="HeaderInner" type="HBoxContainer" parent="Layout/Header/HeaderMargin"]
layout_mode = 2
size_flags_horizontal = 3
[node name="LobbyTitleLabel" type="Label" parent="Layout/Header/HeaderMargin/HeaderInner"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
text = "LOBBY"
theme_override_font_sizes/font_size = 20
[node name="LeaveBtn" type="Button" parent="Layout/Header/HeaderMargin/HeaderInner"]
layout_mode = 2
text = "Leave"
theme_override_font_sizes/font_size = 14
[node name="Separator" type="HSeparator" parent="Layout"]
layout_mode = 2
[node name="VoteBanner" type="PanelContainer" parent="Layout"]
unique_name_in_owner = true
layout_mode = 2
visible = false
[node name="VoteInner" type="HBoxContainer" parent="Layout/VoteBanner"]
layout_mode = 2
theme_override_constants/separation = 12
[node name="VoteLabel" type="Label" parent="Layout/VoteBanner/VoteInner"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
text = "Accept preset?"
[node name="VoteYesBtn" type="Button" parent="Layout/VoteBanner/VoteInner"]
unique_name_in_owner = true
layout_mode = 2
text = "Yes"
[node name="VoteNoBtn" type="Button" parent="Layout/VoteBanner/VoteInner"]
unique_name_in_owner = true
layout_mode = 2
text = "No"
[node name="MainSplit" type="HSplitContainer" parent="Layout"]
layout_mode = 2
size_flags_vertical = 3
split_offset = 400
[node name="LeftPanel" type="ScrollContainer" parent="Layout/MainSplit"]
layout_mode = 2
[node name="LeftContent" type="VBoxContainer" parent="Layout/MainSplit/LeftPanel"]
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 12
[node name="LeftMargin" type="MarginContainer" parent="Layout/MainSplit/LeftPanel/LeftContent"]
layout_mode = 2
theme_override_constants/margin_left = 16
theme_override_constants/margin_right = 16
theme_override_constants/margin_top = 16
theme_override_constants/margin_bottom = 16
[node name="LeftInner" type="VBoxContainer" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin"]
layout_mode = 2
theme_override_constants/separation = 14
[node name="HostSection" type="Label" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner"]
layout_mode = 2
text = "HOST"
modulate = Color(0.6, 0.6, 0.65, 1.0)
theme_override_font_sizes/font_size = 11
[node name="HostNameLabel" type="Label" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner"]
unique_name_in_owner = true
layout_mode = 2
text = "Host: …"
theme_override_font_sizes/font_size = 15
[node name="HostDeckLabel" type="Label" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner"]
unique_name_in_owner = true
layout_mode = 2
text = "Deck: (none)"
modulate = Color(0.75, 0.75, 0.75, 1.0)
[node name="HostReadyIndicator" type="Label" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner"]
unique_name_in_owner = true
layout_mode = 2
text = "Not ready"
modulate = Color(0.6, 0.6, 0.6, 1.0)
[node name="GuestSep" type="HSeparator" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner"]
layout_mode = 2
[node name="GuestSection" type="Label" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner"]
layout_mode = 2
text = "GUEST"
modulate = Color(0.6, 0.6, 0.65, 1.0)
theme_override_font_sizes/font_size = 11
[node name="GuestNameLabel" type="Label" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner"]
unique_name_in_owner = true
layout_mode = 2
text = "Waiting for guest…"
theme_override_font_sizes/font_size = 15
[node name="GuestDeckLabel" type="Label" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner"]
unique_name_in_owner = true
layout_mode = 2
text = ""
modulate = Color(0.75, 0.75, 0.75, 1.0)
[node name="GuestReadyIndicator" type="Label" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner"]
unique_name_in_owner = true
layout_mode = 2
text = "Not ready"
modulate = Color(0.6, 0.6, 0.6, 1.0)
[node name="ActionSep" type="HSeparator" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner"]
layout_mode = 2
[node name="ChangeDeckBtn" type="Button" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner"]
unique_name_in_owner = true
layout_mode = 2
text = "Change Deck"
[node name="FirstTurnSection" type="Label" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner"]
layout_mode = 2
text = "WHO GOES FIRST?"
modulate = Color(0.6, 0.6, 0.65, 1.0)
theme_override_font_sizes/font_size = 11
[node name="FirstTurnBtns" type="HBoxContainer" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner"]
layout_mode = 2
theme_override_constants/separation = 8
[node name="FirstMeBtn" type="Button" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner/FirstTurnBtns"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
text = "Me"
toggle_mode = true
[node name="FirstOppBtn" type="Button" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner/FirstTurnBtns"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
text = "Opponent"
toggle_mode = true
[node name="FirstRandomBtn" type="Button" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner/FirstTurnBtns"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
text = "Random"
toggle_mode = true
button_pressed = true
[node name="ReadyBtn" type="Button" parent="Layout/MainSplit/LeftPanel/LeftContent/LeftMargin/LeftInner"]
unique_name_in_owner = true
layout_mode = 2
custom_minimum_size = Vector2(0, 52)
text = "✓ Ready"
theme_override_font_sizes/font_size = 16
[node name="RightPanel" type="ScrollContainer" parent="Layout/MainSplit"]
layout_mode = 2
[node name="RightContent" type="VBoxContainer" parent="Layout/MainSplit/RightPanel"]
layout_mode = 2
size_flags_horizontal = 3
[node name="RightMargin" type="MarginContainer" parent="Layout/MainSplit/RightPanel/RightContent"]
layout_mode = 2
theme_override_constants/margin_left = 16
theme_override_constants/margin_right = 16
theme_override_constants/margin_top = 16
theme_override_constants/margin_bottom = 16
[node name="RightInner" type="VBoxContainer" parent="Layout/MainSplit/RightPanel/RightContent/RightMargin"]
layout_mode = 2
theme_override_constants/separation = 12
[node name="RulesTitle" type="Label" parent="Layout/MainSplit/RightPanel/RightContent/RightMargin/RightInner"]
layout_mode = 2
text = "RULES"
modulate = Color(0.6, 0.6, 0.65, 1.0)
theme_override_font_sizes/font_size = 11
[node name="RulesLabel" type="Label" parent="Layout/MainSplit/RightPanel/RightContent/RightMargin/RightInner"]
unique_name_in_owner = true
layout_mode = 2
text = "(default rules)"
modulate = Color(0.85, 0.85, 0.85, 1.0)
autowrap_mode = 3
[node name="EditRulesBtn" type="Button" parent="Layout/MainSplit/RightPanel/RightContent/RightMargin/RightInner"]
unique_name_in_owner = true
layout_mode = 2
text = "Edit Rules"
[node name="PresetSep" type="HSeparator" parent="Layout/MainSplit/RightPanel/RightContent/RightMargin/RightInner"]
layout_mode = 2
[node name="PresetsTitle" type="Label" parent="Layout/MainSplit/RightPanel/RightContent/RightMargin/RightInner"]
layout_mode = 2
text = "PRESETS"
modulate = Color(0.6, 0.6, 0.65, 1.0)
theme_override_font_sizes/font_size = 11
[node name="PresetBtns" type="HBoxContainer" parent="Layout/MainSplit/RightPanel/RightContent/RightMargin/RightInner"]
layout_mode = 2
theme_override_constants/separation = 8
[node name="SavePresetBtn" type="Button" parent="Layout/MainSplit/RightPanel/RightContent/RightMargin/RightInner/PresetBtns"]
unique_name_in_owner = true
layout_mode = 2
text = "Save Preset"
[node name="LoadPresetBtn" type="Button" parent="Layout/MainSplit/RightPanel/RightContent/RightMargin/RightInner/PresetBtns"]
unique_name_in_owner = true
layout_mode = 2
text = "Load Preset"
[node name="DeckPickerDialog" type="AcceptDialog" parent="."]
unique_name_in_owner = true
visible = false
title = "Choose Deck"
initial_position = 4
min_size = Vector2(300, 280)
[node name="DeckPickerScroll" type="ScrollContainer" parent="DeckPickerDialog"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="DeckPickerContainer" type="VBoxContainer" parent="DeckPickerDialog/DeckPickerScroll"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 6
[node name="PresetListDialog" type="AcceptDialog" parent="."]
unique_name_in_owner = true
visible = false
title = "Load Preset"
initial_position = 4
min_size = Vector2(300, 280)
[node name="PresetListScroll" type="ScrollContainer" parent="PresetListDialog"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="PresetListContainer" type="VBoxContainer" parent="PresetListDialog/PresetListScroll"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 6