From 85ef0fb29c8228bedcec335190b098dd22c43c47 Mon Sep 17 00:00:00 2001 From: dingo Date: Sat, 7 Mar 2026 21:46:02 -0500 Subject: [PATCH] Fix: restore board interaction after CardWidget + camera changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Co-Authored-By: Happy --- .../origin-client/scenes/game/GameScreen.tscn | 4 +-- .../origin-client/scenes/game/game_screen.gd | 26 ++++++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/Client/origin-client/scenes/game/GameScreen.tscn b/Client/origin-client/scenes/game/GameScreen.tscn index 3557409..3c95fc6 100644 --- a/Client/origin-client/scenes/game/GameScreen.tscn +++ b/Client/origin-client/scenes/game/GameScreen.tscn @@ -96,7 +96,7 @@ anchor_left = 0.0 anchor_top = 1.0 anchor_right = 0.75 anchor_bottom = 1.0 -offset_top = -260.0 +offset_top = -190.0 offset_right = 0.0 [node name="HandScroll" type="ScrollContainer" parent="HUD/HandArea"] @@ -119,7 +119,7 @@ anchor_left = 0.75 anchor_top = 1.0 anchor_right = 1.0 anchor_bottom = 1.0 -offset_top = -260.0 +offset_top = -190.0 [node name="RightMargin" type="MarginContainer" parent="HUD/RightPanel"] layout_mode = 2 diff --git a/Client/origin-client/scenes/game/game_screen.gd b/Client/origin-client/scenes/game/game_screen.gd index c39a54a..aa7d544 100644 --- a/Client/origin-client/scenes/game/game_screen.gd +++ b/Client/origin-client/scenes/game/game_screen.gd @@ -1064,6 +1064,17 @@ func _make_hand_card(card: Dictionary) -> Control: widget.set_meta("card_instance_id", iid) widget.setup(card, card) + # Compact the card for the hand area: hide genus/type row and stats grid + # (full info is available via long-press context popup during gameplay). + # Also shrink the art area so the card fits in the ~190px hand panel. + 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) + for hidden_node in ["Margin/VBox/MetaRow", "Margin/VBox/StatsGrid"]: + var n := widget.get_node_or_null(hidden_node) + if n is CanvasItem: + (n as CanvasItem).visible = false + # Hover: scale up and rise. widget.mouse_entered.connect(func() -> void: widget.pivot_offset = widget.size * 0.5 @@ -1237,10 +1248,19 @@ func _on_state_updated(state: Dictionary) -> void: var p1_id : String = str(state.get("playerOneAccountId", "")) if not p1_id.is_empty(): _camera_oriented = true - # P1 places at row y=0 (world -Z). Camera must look FROM -Z toward +Z → yaw=180°. - # P2 places at row y=bh-1 (world +Z). Camera looks FROM +Z → yaw=0° (default). + var bh := float(Game.board_height()) + # Shift cam_pivot toward the opponent's side (30 % of board half-length) + # so the player's own row appears in the lower-middle of the screen, + # above the hand panel — not hidden behind it. + var pivot_offset := (bh - 1.0) * 0.3 if Auth.user_id.to_lower() == p1_id.to_lower(): - _cam_yaw = 180.0 + # P1 row is at world -Z. Camera looks from -Z toward +Z → yaw=180°. + # Shift pivot toward world -Z so P1's row is NOT at the very bottom. + _cam_yaw = 180.0 + _cam_pivot = Vector3(0.0, 0.0, -pivot_offset) + else: + # P2 row is at world +Z (default yaw=0°). + _cam_pivot = Vector3(0.0, 0.0, pivot_offset) _apply_camera() var board : Dictionary = state.get("board", {})