Actually: Add ranked gameplay UI — matchmaking + 3D game screen
- Game.gd autoload: stores session/state, handles match_found and
game.state_update.push, exposes helpers and all server action methods
- MatchmakingScreen: fetches decks, joins ranked queue, shows elapsed
timer, cancels cleanly; navigates to GameScreen on match_found push
- GameScreen (3D + 2D overlay):
- 3D board: 1×1×0.5 BoxMesh tiles colored by affinity (24 affinities),
StaticBody3D per tile for raycast picking
- Unit placeholders: sphere=Spirit, cylinder=ArchSpirit, box=Ruin,
team-colored (blue/red), exhaust dimming
- Camera: orbit (left-drag / one-finger), zoom (scroll / pinch),
pan (middle-drag / two-finger); isometric default ~40° pitch
- Hand: scrollable row of GameCardWidgets; hover → scale+rise anim;
click → select; selected card highlights valid play tiles green
- Unit selection: click unit → movement range (green), attack
range (red); click target tile → move; click enemy → attack
- Placement phase: valid ArchSpirit tiles highlighted automatically
- Draw phase: auto-draws after 0.3s delay
- Context popup: hold 0.5s on tile → tile coord/affinity + unit
stats + ability names
- Discard viewer: own + opponent, scrollable card list
- Game-over overlay: result, rank delta, return to main menu
- All game actions wired: play, move, attack, sacrifice, end turn,
draw, concede, ascend, transition, activate ability
- main_screen.gd: MatchBtn → MatchmakingScreen
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>
74 lines
2.9 KiB
GDScript
74 lines
2.9 KiB
GDScript
extends Control
|
|
## Main hub screen — shown after successful authentication.
|
|
##
|
|
## Session expiry is handled centrally by Auth.gd, which calls logout() and
|
|
## navigates to LoginScreen when auth.hello is rejected on reconnect.
|
|
|
|
@onready var welcome_label : Label = %WelcomeLabel
|
|
@onready var status_label : Label = %StatusLabel
|
|
@onready var logout_btn : Button = %LogoutBtn
|
|
@onready var match_btn : Button = %MatchBtn
|
|
@onready var collection_btn : Button = %CollectionBtn
|
|
@onready var bazaar_btn : Button = %BazaarBtn
|
|
@onready var leaderboard_btn : Button = %LeaderboardBtn
|
|
@onready var account_btn : Button = %AccountBtn
|
|
@onready var settings_btn : Button = %SettingsBtn
|
|
@onready var report_bug_btn : Button = %ReportBugBtn
|
|
@onready var bug_report_dialog = %BugReportDialog
|
|
|
|
# ── Lifecycle ─────────────────────────────────────────────────────────────────
|
|
|
|
func _ready() -> void:
|
|
welcome_label.text = "Welcome, %s!" % Auth.display_name
|
|
Chat.set_bubble_visible(true)
|
|
|
|
Network.connected.connect(_update_status)
|
|
Network.disconnected.connect(_update_status)
|
|
_update_status()
|
|
|
|
logout_btn.pressed.connect(_on_logout_pressed)
|
|
|
|
match_btn.pressed.connect(func():
|
|
get_tree().change_scene_to_file("res://scenes/matchmaking/MatchmakingScreen.tscn"))
|
|
|
|
collection_btn.pressed.connect(func():
|
|
get_tree().change_scene_to_file("res://scenes/collection/CollectionScreen.tscn"))
|
|
|
|
bazaar_btn.pressed.connect(func():
|
|
get_tree().change_scene_to_file("res://scenes/bazaar/BazaarScreen.tscn"))
|
|
|
|
leaderboard_btn.pressed.connect(func():
|
|
get_tree().change_scene_to_file("res://scenes/leaderboard/LeaderboardScreen.tscn"))
|
|
|
|
account_btn.pressed.connect(func():
|
|
get_tree().change_scene_to_file("res://scenes/account/AccountScreen.tscn"))
|
|
|
|
settings_btn.pressed.connect(func():
|
|
get_tree().change_scene_to_file("res://scenes/settings/SettingsScreen.tscn"))
|
|
|
|
report_bug_btn.pressed.connect(func():
|
|
bug_report_dialog.popup_centered())
|
|
|
|
|
|
func _exit_tree() -> void:
|
|
Chat.set_bubble_visible(false)
|
|
if Network.connected.is_connected(_update_status):
|
|
Network.connected.disconnect(_update_status)
|
|
if Network.disconnected.is_connected(_update_status):
|
|
Network.disconnected.disconnect(_update_status)
|
|
|
|
# ── Signal handlers ───────────────────────────────────────────────────────────
|
|
|
|
func _update_status() -> void:
|
|
if Network.is_online():
|
|
status_label.text = "● Online"
|
|
status_label.modulate = Color(0.3, 0.9, 0.4)
|
|
else:
|
|
status_label.text = "● Reconnecting…"
|
|
status_label.modulate = Color(1.0, 0.8, 0.2)
|
|
|
|
|
|
func _on_logout_pressed() -> void:
|
|
Auth.logout()
|
|
get_tree().change_scene_to_file("res://scenes/login/LoginScreen.tscn")
|