The full-rect Control wrapper had default MOUSE_FILTER_STOP, eating
all clicks across the entire screen. Set MOUSE_FILTER_IGNORE so input
passes through to the 3D scene and HUD beneath it.
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>
CenterContainer/ScrollContainer require a proper Control parent to
compute sizes. Adding CardDetailPopup directly to a CanvasLayer broke
the nested container layout chain, causing zero-height Panel (invisible
content despite the grey overlay showing correctly).
Fix: spawn a dedicated CanvasLayer (layer 20, above HUD at layer 10)
containing a full-rect Control anchor, then parent the popup to that
Control. This restores proper anchor→Control→Container sizing.
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>
theme_override_constants["key"] and theme_override_font_sizes["key"]
throw on nodes not yet in the scene tree. Replaced with the proper
add_theme_constant_override() / add_theme_font_size_override() calls.
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>
Client (game_screen.gd):
- Fix crash when clicking a unit with null abilitiesJson: server sends the key
with a null value, so dict.get(key,default) returns null — guard both uses
(_show_ability_panel and _on_hold_timer_fired) with explicit null check.
- Add double-click on battlefield units to open a full CardDetailPopup showing
name, affinity, stats, and ability descriptions. Popup is instantiated once
in _ready() and reused; aliases movementPoints/abilities keys as expected.
Server (Filters.cs / AbilitySystem.cs):
- IsSelf filter now matches by CardDefinitionId (definition-level: any copy of
the same card). This is the appropriate semantic for "self" as a type scope.
- IsExactSelf filter added: matches by InstanceId (instance-level: only this
specific unit on the battlefield). Use this to prevent duplicate-instance
trigger bleed where two copies of a card both fire when only one acted.
- TriggerMatches now accepts the evaluating FieldCard and forwards its
InstanceId to Own() for all ownership checks.
- Own() gains "ExactSelf" scope: fires only when occ.Data.SourceId matches the
evaluating unit's InstanceId — eliminating the definition-level bleed bug.
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>
Root cause: _rebuild_hand used queue_free() alone, which keeps nodes in the
GUI tree (and receiving input events) until end-of-frame. When two state
updates arrive in the same frame, stale and live CardWidget instances overlap
at the same screen position — both emit card_pressed → _on_hand_card_clicked
fires twice per physical click, alternating select/deselect.
Fix 1 (root cause): _rebuild_hand now calls remove_child(c) before queue_free(c),
so the old widget is immediately detached from the HBoxContainer and can no
longer receive GUI input.
Fix 2 (defensive): _on_hand_card_clicked deduplicates calls within the same
engine frame for the same card instance using Engine.get_process_frames().
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>
Setting widget.z_index = 20 synchronously while a mouse button is held causes
Godot 4 to re-evaluate GUI focus and deliver a synthetic second pressed=true
event to the widget. This fired card_pressed a second time in the same frame,
making _on_hand_card_clicked see the card already selected → immediate deselect.
Fix: move tween creation and z_index assignment into a new _tween_hand_card()
helper, called via call_deferred() so it runs after the current input event is
fully processed (mouse button already released by then).
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>
Godot 4 fires two separate pressed=true InputEventMouseButton events for a
fast click: a normal press and a double_click press, both in the same frame.
The previous _gui_input emitted card_pressed for both, so the first emission
selected the card and the second (double_click) immediately deselected it.
Fix:
- Skip card_pressed emission when event.double_click is true
- Consume RELEASE as well as PRESS so neither can leak to the 3D board's
_unhandled_input handler (belt-and-suspenders over the _press_was_on_board
guard that already exists in game_screen.gd)
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>
- _add_highlight: use emission (emission_energy_multiplier=2) + 75% opaque base
so tiles glow visibly regardless of depth-sort/transparency ordering; raised
Y to 0.58 (clear of tile top at 0.50); thicker mesh (0.06 vs 0.02)
- Remove Godot-3-only flags_transparent property (no-op in Godot 4)
- _on_state_updated: preserve CARD_FROM_HAND / TERRAMORPHA_SELECT through server
state pushes if selected card is still in hand (re-apply highlights after
_rebuild_hand); only clear UNIT_SELECTED and other transient modes
- Add diagnostic prints to _add_highlight and _on_state_updated to trace when
state updates arrive relative to card selection
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>
- Spirit tile null safety: dict.get(key, default) only uses the default when
the key is absent. Server sends nullable ints as JSON null, so the key EXISTS
but the value is null. GDScript returns null which coerces to 0 on a typed int,
collapsing min_r/max_r to 0 and producing zero valid tiles. Fixed by reading
channel range as Variant and substituting the default (1/2) when null.
- Channel range source: read from arch (ArchSpirit), not the Spirit card — the
ArchSpirit defines how far away from itself it can channel Spirits.
- Ruin: auto-placed by server. Clicking a Ruin card now immediately calls
send_play_card without entering CARD_FROM_HAND mode or requiring a tile click.
Added Ruin to the board-click immediate-play guard as well.
- Deselect previous: before entering a new CARD_FROM_HAND selection, explicitly
call _set_mode(NONE) when already in CARD_FROM_HAND or TERRAMORPHA_SELECT.
This guarantees _refresh_hand_selection fires a deselect tween on the old
card before the new card's select tween begins.
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>
- Spirit/Ruin valid tiles: channel range was read from arch (archSpirit) instead
of card (the Spirit being played). Fixed to card.get("minChannelRange", 1) /
card.get("maxChannelRange", 2). Also restored "Ruin" to the tile-target branch
(it needs a tile target, not the no-target branch).
- Terramorpha: skip entering TERRAMORPHA_SELECT if currentSp < spCost. Player
can see their SP in the HUD; clicking an unaffordable card does nothing.
- Hand card tween: removed mouse_entered/mouse_exited hover animation. Tween
now fires only on selection state change in _refresh_hand_selection, tracking
previous state via "_sel" widget metadata.
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>
- Input bug: CardWidget only consumed mouse PRESS via accept_event(), not RELEASE.
This caused _unhandled_input to fire _handle_board_click on release of a card
click, hitting the tile physically behind the hand area in 3D — accidentally
sending play_card to the wrong tile (Spirit/Ruin) or picking the first tile for
Terramorpha. Fixed by tracking _press_was_on_board: board clicks only fire when
the originating PRESS also reached _unhandled_input (i.e., was not consumed by
a UI card widget).
- Server: added SpCost, StCost, Genus, MinChannelRange, MaxChannelRange,
MinAttackRange, MaxAttackRange, CanMove, CanAttack, ExtraAttacksRemaining,
CanBeAttacked, AbilitiesJson to CardInstanceDto and ToCardDto mapping.
All fields were already on CardInstance; they were simply not exposed to clients.
- Client: build def dict in _make_hand_card with maxMp → movementPoints alias
so CardWidget displays movement points correctly.
- Client: show MetaRow (genus + type) in compact hand card; only StatsGrid is
hidden. HandArea / RightPanel height raised 190 → 220px for better visibility.
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>
Two root causes broke unit movement and card play:
1. Camera yaw=180° for P1 pushed P1's own row to the bottom of the 3D
projection, directly behind the 260px HandArea panel → tiles unreachable
2. HandArea grew from 180→260px, blocking even more of the lower board
Fixes:
- Compact CardWidget in hand: hide MetaRow + StatsGrid, shrink ArtArea
min height to 80px → card ~150px, fits in 190px HandArea
- HandArea / RightPanel height: 260→190px
- Camera orientation: when setting yaw for P1/P2, also shift _cam_pivot
30% of board half-length toward the player's own side so their row
sits mid-screen (above the HandArea), not hidden behind it
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>
Hand display:
- Replace bespoke _make_hand_card() with CardWidget.tscn (the shared collection
card widget) — shows art, stats, affinity border, SP/ST costs
- Pass live game card dict as both dto and def; all camelCase fields match
- _refresh_hand_selection() now calls widget.set_selected() instead of
manipulating StyleBoxFlat directly
- HandArea/RightPanel height 180 → 260px to fit CardWidget (238px natural height)
- HBoxContainer separation -12 (overlap) → 6px (proper spacing)
Terramorpha tile selection (Dimorpha / Trimorpha):
- After each tile pick, re-highlight: orange for already-selected tiles, green
for valid adjacent tiles for the next pick — no more silent rejection of
non-adjacent clicks
Attack range visualization:
- _attack_range_tiles(): returns all tiles within minAttackRange–maxAttackRange
for units with maxRange > 1 (ranged spirits)
- _select_unit() shows orange range area first, then red on top for actual
attackable enemies — players can now see a ranged unit's full reach
Camera orientation:
- On first state that includes playerOneAccountId, orient camera behind the
local player's row: P1 (row 0, world -Z) gets yaw=180°, P2 keeps yaw=0°
- _camera_oriented flag ensures this only runs once per scene entry
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>
activePlayerAccountId stays as P1 for the entire Placement phase, so
P2 always saw "waiting for opponent". Now each player checks whether
their own ArchSpirit has been placed to decide which UI to show.
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>
- Block unit selection in Placement phase (prevents sending game.move_unit
when opponent hasn't placed yet)
- All accountId comparisons now case-insensitive (Guid serialization may
differ between auth response and state DTO)
- Add debug log in _on_state_updated: phase, player found, hand size
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>
Server sends occupantId as JSON null for empty tiles, not "".
- dict.get("occupantId", "") returns null (not "") when key is present with null value
- Fixed all four occupantId checks to use truthiness instead of "" comparison
- Hold timer: extract to untyped var first then cast, avoids Nil→String assignment crash
- Valid placement/move/channel tiles now correctly identify empty tiles
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>
- Server pushes "game.state_update" not "game.state_update.push"
- On "AlreadyStarted" ack (reconnect), explicitly fetch state via game.get_state
instead of expecting state in the ready ack (it's never there)
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>
- Game.gd: fix push type "game.over" (not "game.over.push"), store opponent_name
- game_screen.gd full rewrite:
- Unit ownership via _rebuild_ownership() + _is_enemy_unit()/_is_friendly_unit()
(CardInstanceDto has no ownerAccountId; build sets from PlayerStateDto instead)
- Hand card hover y-reset fixed to 0.0 (was incorrectly using container position)
- Opponent name from Game.opponent_name
- Terramorpha multi-tile sequential selection with adjacency validation
- Sacrifice: click ArchSpirit → PopupMenu → select spirit → ConfirmationDialog
- Ascend/Transition: detected by card tier vs current arch tier, confirmation dialogs
- Ability panel: parses abilitiesJson, filters Active abilities, floating HUD buttons
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>
- ChatGetChannelsHandler: for Direct channels, look up the other
member's display name from identity DB and return it as the channel
name (per-caller, no DB schema change)
- ChatDmOpenHandler: same — returns recipient display name in the DTO
for both new and existing DM channels
- New ChatPartyRenameHandler (chat.party.rename): updates the party
channel name, returns updated DTO
- Chat.gd: rename_party() calls the new handler and upserts locally
- chat_overlay.gd: "Rename" button in party action bar opens a dialog
to set a new party name
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>
- Chat bubble now hidden on all scenes; MainScreen shows/hides it via
Chat.set_bubble_visible() in _ready/_exit_tree
- send_friend_request now uses Network.request so _fetch_social() fires
on success, making the friends list update immediately after adding
- Added DM close button (✕) to each conversation row in the DMs tab;
_close_dm removes the channel from local state via Chat.close_dm()
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>
- Fix social response key mismatch (incomingRequests, blocked)
- Fix DmOpenResponse to return full ChatChannelDto so client can
add the channel without a separate fetch
- Add Party channel type to ChatChannelType enum
- Add PartyInviteHandler, PartyInviteRespondHandler, PartyLeaveHandler
with IClientPush invite notification to the invitee
- Add party tab to chat overlay (action bar, messages, Leave button)
- Wire Invite to Party in both player and friend context menus
- Show accept/decline popup dialog on incoming party invite push
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>
- Chat.gd autoload: data layer for channels, messages, social graph,
presence, and notifications; wires to Network/Auth singletons
- ChatOverlay.tscn + chat_overlay.gd: CanvasLayer (layer=100) that
persists across all scenes; bubble toggle at bottom-right corner
- Six tabs: Friends, Presence, Global, Lobby, Game, DMs
- Message rows show [HH:MM] [source] Name: text with color-coded
source badges (global/lobby/game/private/party/system)
- Friends list: online/offline sections, right-click context menu
(Private Message, Set Nickname, Block, Remove Friend)
- Player name click: Add Friend, Invite to Party (stub), Mute/Unmute,
Hi Scores (disabled placeholder)
- Presence tab: own status selector (Online/Away/Offline) + friends
presence overview with status dots
- DMs tab: conversation sidebar + message pane, input bar shown when
a conversation is selected
- Unread notification badge on chat bubble
- Per-session nickname overrides and muting
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>
card_widget.gd uses @onready vars which are null until _ready() fires.
_ready() only fires after add_child(), so both cards_view.gd and decks_view.gd
must call add_child(widget) before widget.setup().
login_screen.gd called change_scene_to_file() synchronously from _ready(),
causing "parent busy" crash. Deferred with call_deferred().
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>
Replace placeholder Fire/Water/Earth/Air/Lightning/Dark/Light affinities
with the actual enum values: Void, Aether, Lake, Hill, Forest, Field (basics)
plus their non-basic combos (Ocean, Island, Marsh, Swamp, Mountain, Steppe,
Fort, Plains, Grove, Jungle, PerfectAether, PureVoid).
- Rename 7 wrong SVG icons → 6 correct ones (Void/Aether/Lake/Hill/Forest/Field)
- card_widget.gd: rewrite AFFINITY_BORDER, AFFINITY_BG for all 18 card affinities;
add static affinity_icon() helper that maps non-basics to their primary basic icon
- card_detail_popup.gd: use affinity_icon() instead of direct dict lookup
- cars_view.gd: affinity filter now lists all 18 card-valid affinities
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>
Remember Me (login screen):
- AES-256-CBC encrypted credential storage in user://creds.dat
- Key XOR-obfuscated across two halves; random IV stored with ciphertext
- Checkbox pre-fills email/password on next launch; unchecking clears saved creds
SVG affinity icons (web-compatible):
- Replace emoji art symbols (🔥💧⛰💨⚡✦★) with SVG TextureRect in CardWidget
- 7 new icons/affinity_*.svg — monochrome white, modulate-tinted at runtime
- ArtSymbol node changed from Label to TextureRect (stretch_mode = keep-aspect-centred)
Card detail popup (collection screen):
- Tap any card in Cards tab to see full stats + abilities overlay
- CardDetailPopup added to viewport root (avoids VBoxContainer layout conflict)
- Shows: name, affinity icon, foil badge, type/affinity/rarity, all 6 stats,
and parsed ability list with names + descriptions
- Dismiss by tapping ✕ or the dim background overlay
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>
logout() now calls Network.force_reconnect() to tear down the existing Phase-5
connection; the next auth.login / auth.register is then the very first message
on the new connection, which is the only point where ConnectionLoop handles auth.
Also adds Network.force_reconnect() public method.
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>
Godot discards buffered data packets when the close frame arrives, so the
JSON error sent by RejectAsync is never received. Map known server close
reasons (auth_failed, auth_required) from the close frame's reason field
to AUTH_FAILED / AUTH_REQUIRED so Auth.gd's logout+navigate logic fires
correctly instead of treating every rejection as a transient DISCONNECTED.
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>
When auth.hello is rejected (session expired/revoked), Auth.gd now calls
logout() to wipe all auth state (including auth.cfg) and drives the scene
change to LoginScreen directly, instead of relying on each scene's own
auth_failed handler.
This covers all screens (main, collection, etc.) without each needing a
handler, and eliminates the race where the auth.hello reply arrived as
DISCONNECTED (STATE_CLOSING path, token kept) → reconnect → resend token.
main_screen.gd no longer subscribes to auth_failed; session expiry redirect
is fully owned by Auth.gd.
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>
Network.gd — drain packets before handling close (main bug fix):
When the server rejects auth.hello it sends an error frame then closes
the connection. Godot's WebSocketPeer.poll() can transition directly to
STATE_CLOSED while the error packet sits unread in the buffer. The old
code returned early on STATE_CLOSED without calling _poll_packets(), so
_on_ws_closed() fired DISCONNECTED for the pending auth.hello instead of
the real AUTH_FAILED. Auth kept the session token and retried forever.
Fix: drain any buffered packets before _on_ws_closed().
Network.gd — fail request() immediately when not connected:
Previously request() silently dropped the send but left a dangling
pending entry that was never resolved until the next disconnect. Now
on_error("DISCONNECTED") is called immediately, giving the caller
consistent feedback and keeping _pending clean.
main_screen.gd — stay on screen for DISCONNECTED auth errors:
A transient network drop during auth.hello was sending the user back
to the login screen unnecessarily. Only navigate to login when the
session is explicitly rejected (AUTH_FAILED, ACCOUNT_LOCKED, etc.).
The "● Reconnecting…" status label already handles the transient case.
login_screen.gd — add missing friendly error translations:
INVALID_PASSWORD / USER_NOT_FOUND → "Wrong email or password."
DISPLAY_NAME_TAKEN, ACCOUNT_LOCKED, AUTH_REQUIRED,
AUTH_SERVICE_UNAVAILABLE all now map to clear human-readable strings
instead of falling through to the raw server message or error code.
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>