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:
dingo
2026-03-08 09:10:24 -04:00
co-authored by Claude Happy
parent 85ef0fb29c
commit c82682f77e
4 changed files with 70 additions and 40 deletions
+32 -20
View File
@@ -1149,26 +1149,38 @@ public static class GameEngine
{
var fc = c as FieldCard;
return new(
InstanceId : c.InstanceId,
CardDefinitionId : c.CardDefinitionId,
Name : c.Name,
CardType : c.CardType,
Affinity : c.Affinity,
Rarity : c.Rarity,
CurrentHealth : c.CurrentHealth,
MaxHealth : c.MaxHealth,
CurrentDefense : c.CurrentDefense,
MaxDefense : c.MaxDefense,
Damage : c.Damage,
IsExhausted : c.IsExhausted,
IsLeader : c.IsLeader,
Position : fc?.Position.HasValue == true
? new CoordDto(fc.Position.Value.X, fc.Position.Value.Y) : null,
CurrentMp : fc?.CurrentMp,
MaxMp : c.MaxMp,
MovementType : c.MovementType?.ToString(),
Tier : c.Tier,
TerramorphaMode : c.TerramorphaMode?.ToString());
InstanceId : c.InstanceId,
CardDefinitionId : c.CardDefinitionId,
Name : c.Name,
CardType : c.CardType,
Affinity : c.Affinity,
Rarity : c.Rarity,
CurrentHealth : c.CurrentHealth,
MaxHealth : c.MaxHealth,
CurrentDefense : c.CurrentDefense,
MaxDefense : c.MaxDefense,
Damage : c.Damage,
IsExhausted : c.IsExhausted,
IsLeader : c.IsLeader,
Position : fc?.Position.HasValue == true
? new CoordDto(fc.Position.Value.X, fc.Position.Value.Y) : null,
CurrentMp : fc?.CurrentMp,
MaxMp : c.MaxMp,
MovementType : c.MovementType?.ToString(),
Tier : c.Tier,
TerramorphaMode : c.TerramorphaMode?.ToString(),
SpCost : c.SpCost,
StCost : c.StCost,
Genus : c.Genus,
MinChannelRange : c.MinChannelRange,
MaxChannelRange : c.MaxChannelRange,
MinAttackRange : c.MinAttackRange,
MaxAttackRange : c.MaxAttackRange,
CanMove : c.CanMove,
CanAttack : c.CanAttack,
ExtraAttacksRemaining : c.ExtraAttacksRemaining,
CanBeAttacked : c.CanBeAttacked,
AbilitiesJson : c.AbilitiesJson);
}
private static BoardDto ToBoardDto(Board board)