diff --git a/Client/origin-client/scenes/game/game_screen.gd b/Client/origin-client/scenes/game/game_screen.gd index c1dff2c..5ee1d99 100644 --- a/Client/origin-client/scenes/game/game_screen.gd +++ b/Client/origin-client/scenes/game/game_screen.gd @@ -2280,26 +2280,24 @@ func _rebuild_hand(hand: Array) -> void: func _make_hand_card(card: Dictionary) -> Control: - var iid : String = card.get("instanceId", "") + var iid : String = card.get("instanceId", "") + var def_id : String = str(card.get("cardDefinitionId", "")) - # Instantiate the shared CardWidget scene used by the collection UI. - # Build a def dict from the live card data. CardWidget reads "movementPoints" - # but the CardInstanceDto field is "maxMp", so alias it here. var widget : PanelContainer = _CARD_WIDGET_SCENE.instantiate() widget.set_meta("card_instance_id", iid) - var def := card.duplicate() - def["movementPoints"] = card.get("maxMp", null) - widget.setup(card, def) - # Compact the card for the hand area: shrink art and hide the detailed - # stats grid (HP/ATK/DEF/MP/range). Name, SP/ST cost, genus, and type - # remain visible; long-press context popup shows full unit stats. - var art_area := widget.get_node_or_null("Margin/VBox/ArtArea") - if art_area is Control: - (art_area as Control).custom_minimum_size = Vector2(0, 80) - var stats_grid := widget.get_node_or_null("Margin/VBox/StatsGrid") - if stats_grid is CanvasItem: - (stats_grid as CanvasItem).visible = false + # Use the full CardDefinitionDto from ContentCache so CardWidget gets the + # assets array (Art2D cdnUrl) and can load card art. Fall back to the + # instance data if the definition hasn't been synced yet. + var def := ContentCache.get_definition(def_id) + if def.is_empty(): + def = card.duplicate() + + # CardWidget._load_stats reads "movementPoints"; the CardInstanceDto calls + # it "maxMp", so alias it into the def dict before passing. + def["movementPoints"] = card.get("maxMp", def.get("movementPoints", null)) + + widget.setup(card, def) # CardWidget emits card_pressed(definition_id); forward as hand-card click. widget.card_pressed.connect(func(_def_id: String) -> void: