Engine: - AbilityDefinition: add SourceZoneGate (zone-restricted triggers) and TriggerLimitPerGame - Effects: add StatModOperator (Add/Subtract/Multiply/Divide/Percent) on all stat mod effects; reversal stored as delta - Action/CostEntry: add CostPickMode enum (Random/SelfPick/EnemySeePick/EnemyRandomPick/EnemyPick) - PendingCostPick: new model for interactive cost pause/resume (mirrors PendingTriggeredTarget) - GameState: PendingCostPick field - GameMessages: CostPickRequestPush, GameCostPickRequest, GameCostPickResponse records - AbilitySystem: FireTrigger scans Hand/Discard/Deck when SourceZoneGate set; per-game trigger limit tracking; ApplyStatOperator helper; PayCosts/ResumeCostPick for interactive cost flow - GameCostPickHandler + ServiceRegistration wiring Admin: - AbilityBuilderR3.razor: full ability builder at /cards/ability-builder-r3 (39 triggers, 69 effects, 32 conditions, form/canvas/mermaid modes, compiles to engine-native $type JSON) - AbilityBuilderR2-Draft.razor: fix switch expression no-best-type error Docs: - BuilderR3.md: master plan document 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>
79 lines
3.1 KiB
GDScript
79 lines
3.1 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 free_play_btn : Button = %FreePlayBtn
|
|
@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:
|
|
ContentCache.apply_scene_background(self)
|
|
welcome_label.text = "Welcome, %s!" % Auth.display_name
|
|
Chat.claim_bubble_visibility(self)
|
|
|
|
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"))
|
|
|
|
free_play_btn.pressed.connect(func():
|
|
get_tree().change_scene_to_file("res://scenes/free_play/FreePlayScreen.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.release_bubble_visibility(self)
|
|
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")
|