Fix: card play input bug, populate CardInstanceDto fields, genus/SP/ST/MP display
- 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>
This commit is contained in:
@@ -236,7 +236,20 @@ public sealed record CardInstanceDto(
|
||||
int? MaxMp,
|
||||
string? MovementType, // enum as string, null for non-unit cards
|
||||
int? Tier, // ArchSpirit only; 1 = base form
|
||||
string? TerramorphaMode); // Terramorpha only: "Mono" | "Di" | "Tri"
|
||||
string? TerramorphaMode, // Terramorpha only: "Mono" | "Di" | "Tri"
|
||||
// --- fields needed for client-side display and valid-tile computation ---
|
||||
int SpCost,
|
||||
int StCost,
|
||||
IEnumerable<string>? Genus,
|
||||
int? MinChannelRange,
|
||||
int? MaxChannelRange,
|
||||
int? MinAttackRange,
|
||||
int? MaxAttackRange,
|
||||
bool CanMove,
|
||||
bool CanAttack,
|
||||
int ExtraAttacksRemaining,
|
||||
bool CanBeAttacked,
|
||||
string? AbilitiesJson);
|
||||
|
||||
public sealed record BoardDto(
|
||||
int Width,
|
||||
|
||||
Reference in New Issue
Block a user