Files
sor/Client/origin-client/scenes/game/GameScreen.tscn
T
c82682f77e 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>
2026-03-08 09:10:24 -04:00

324 lines
9.4 KiB
Plaintext

[gd_scene load_steps=2 format=3 uid="uid://game_screen"]
[ext_resource type="Script" path="res://scenes/game/game_screen.gd" id="1_gscr"]
[node name="GameScreen" type="Node3D"]
script = ExtResource("1_gscr")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(0.707107, -0.5, 0.5, 0, 0.707107, 0.707107, -0.707107, -0.5, 0.5, 0, 8, 0)
light_energy = 1.2
shadow_enabled = true
[node name="CameraRig" type="Node3D" parent="."]
[node name="Camera3D" type="Camera3D" parent="CameraRig"]
transform = Transform3D(1, 0, 0, 0, 0.766044, 0.642788, 0, -0.642788, 0.766044, 0, 10, 9)
[node name="BoardRoot" type="Node3D" parent="."]
[node name="TilesRoot" type="Node3D" parent="BoardRoot"]
[node name="UnitsRoot" type="Node3D" parent="BoardRoot"]
[node name="HighlightsRoot" type="Node3D" parent="BoardRoot"]
[node name="HUD" type="CanvasLayer" parent="."]
layer = 10
[node name="TopBar" type="HBoxContainer" parent="HUD"]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 0.0
offset_bottom = 48.0
theme_override_constants/separation = 0
[node name="PhaseLabel" type="Label" parent="HUD/TopBar"]
unique_name_in_owner = true
layout_mode = 2
custom_minimum_size = Vector2(140, 48)
theme_override_font_sizes/font_size = 13
text = "Phase: —"
vertical_alignment = 1
[node name="TurnLabel" type="Label" parent="HUD/TopBar"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme_override_font_sizes/font_size = 13
text = "Turn 1 — Your turn"
horizontal_alignment = 1
vertical_alignment = 1
[node name="OpponentPanel" type="HBoxContainer" parent="HUD/TopBar"]
unique_name_in_owner = true
layout_mode = 2
custom_minimum_size = Vector2(240, 48)
theme_override_constants/separation = 8
[node name="OppNameLabel" type="Label" parent="HUD/TopBar/OpponentPanel"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 12
text = "Opponent"
vertical_alignment = 1
modulate = Color(1, 0.5, 0.5, 1)
[node name="OppHandLabel" type="Label" parent="HUD/TopBar/OpponentPanel"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 12
text = "Hand: 0"
vertical_alignment = 1
[node name="OppDeckLabel" type="Label" parent="HUD/TopBar/OpponentPanel"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 12
text = "Deck: 0"
vertical_alignment = 1
[node name="OppDiscardBtn" type="Button" parent="HUD/TopBar/OpponentPanel"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 11
text = "Discard"
[node name="HandArea" type="PanelContainer" parent="HUD"]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.0
anchor_top = 1.0
anchor_right = 0.75
anchor_bottom = 1.0
offset_top = -220.0
offset_right = 0.0
[node name="HandScroll" type="ScrollContainer" parent="HUD/HandArea"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
vertical_scroll_mode = 0
[node name="HandCards" type="HBoxContainer" parent="HUD/HandArea/HandScroll"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 4
theme_override_constants/separation = 6
[node name="RightPanel" type="PanelContainer" parent="HUD"]
layout_mode = 1
anchors_preset = -1
anchor_left = 0.75
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -220.0
[node name="RightMargin" type="MarginContainer" parent="HUD/RightPanel"]
layout_mode = 2
theme_override_constants/margin_left = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_top = 8
theme_override_constants/margin_bottom = 8
[node name="RightVBox" type="VBoxContainer" parent="HUD/RightPanel/RightMargin"]
layout_mode = 2
theme_override_constants/separation = 6
[node name="SpLabel" type="Label" parent="HUD/RightPanel/RightMargin/RightVBox"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 14
text = "SP: 0"
[node name="StLabel" type="Label" parent="HUD/RightPanel/RightMargin/RightVBox"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 14
text = "ST: 0"
[node name="DeckLabel" type="Label" parent="HUD/RightPanel/RightMargin/RightVBox"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 12
text = "Deck: 0"
[node name="DiscardBtn" type="Button" parent="HUD/RightPanel/RightMargin/RightVBox"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 12
text = "View Discard"
[node name="Spacer" type="Control" parent="HUD/RightPanel/RightMargin/RightVBox"]
layout_mode = 2
size_flags_vertical = 3
[node name="DrawBtn" type="Button" parent="HUD/RightPanel/RightMargin/RightVBox"]
unique_name_in_owner = true
layout_mode = 2
custom_minimum_size = Vector2(0, 36)
theme_override_font_sizes/font_size = 13
text = "Draw Card"
[node name="EndTurnBtn" type="Button" parent="HUD/RightPanel/RightMargin/RightVBox"]
unique_name_in_owner = true
layout_mode = 2
custom_minimum_size = Vector2(0, 36)
theme_override_font_sizes/font_size = 13
text = "End Turn"
[node name="ConcedeBtn" type="Button" parent="HUD/RightPanel/RightMargin/RightVBox"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 12
text = "Concede"
[node name="ContextPopup" type="PanelContainer" parent="HUD"]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = -1
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -160.0
offset_top = -120.0
offset_right = 160.0
offset_bottom = 120.0
visible = false
[node name="ContextMargin" type="MarginContainer" parent="HUD/ContextPopup"]
layout_mode = 2
theme_override_constants/margin_left = 12
theme_override_constants/margin_right = 12
theme_override_constants/margin_top = 8
theme_override_constants/margin_bottom = 8
[node name="ContextVBox" type="VBoxContainer" parent="HUD/ContextPopup/ContextMargin"]
layout_mode = 2
theme_override_constants/separation = 6
[node name="ContextTileLabel" type="Label" parent="HUD/ContextPopup/ContextMargin/ContextVBox"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 13
text = "Tile (0,0) — Void"
[node name="ContextUnitLabel" type="Label" parent="HUD/ContextPopup/ContextMargin/ContextVBox"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 12
text = ""
autowrap_mode = 3
[node name="ContextAbilitiesLabel" type="Label" parent="HUD/ContextPopup/ContextMargin/ContextVBox"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 11
text = ""
autowrap_mode = 3
modulate = Color(0.7, 0.7, 0.85, 1)
[node name="ContextClose" type="Button" parent="HUD/ContextPopup/ContextMargin/ContextVBox"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 12
text = "Close"
[node name="DiscardViewer" type="PanelContainer" parent="HUD"]
unique_name_in_owner = true
layout_mode = 1
anchor_left = 0.1
anchor_top = 0.05
anchor_right = 0.9
anchor_bottom = 0.95
visible = false
[node name="DVMargin" type="MarginContainer" parent="HUD/DiscardViewer"]
layout_mode = 2
theme_override_constants/margin_left = 16
theme_override_constants/margin_right = 16
theme_override_constants/margin_top = 12
theme_override_constants/margin_bottom = 12
[node name="DVVBox" type="VBoxContainer" parent="HUD/DiscardViewer/DVMargin"]
layout_mode = 2
theme_override_constants/separation = 8
[node name="DVTitle" type="Label" parent="HUD/DiscardViewer/DVMargin/DVVBox"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 16
text = "Discard Pile"
[node name="DVScroll" type="ScrollContainer" parent="HUD/DiscardViewer/DVMargin/DVVBox"]
layout_mode = 2
size_flags_vertical = 3
horizontal_scroll_mode = 0
[node name="DVList" type="VBoxContainer" parent="HUD/DiscardViewer/DVMargin/DVVBox/DVScroll"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 4
[node name="DVCloseBtn" type="Button" parent="HUD/DiscardViewer/DVMargin/DVVBox"]
unique_name_in_owner = true
layout_mode = 2
custom_minimum_size = Vector2(0, 36)
theme_override_font_sizes/font_size = 13
text = "Close"
[node name="GameOverOverlay" type="PanelContainer" parent="HUD"]
unique_name_in_owner = true
layout_mode = 1
anchor_left = 0.25
anchor_top = 0.25
anchor_right = 0.75
anchor_bottom = 0.75
visible = false
[node name="GOMargin" type="MarginContainer" parent="HUD/GameOverOverlay"]
layout_mode = 2
theme_override_constants/margin_left = 24
theme_override_constants/margin_right = 24
theme_override_constants/margin_top = 24
theme_override_constants/margin_bottom = 24
[node name="GOVBox" type="VBoxContainer" parent="HUD/GameOverOverlay/GOMargin"]
layout_mode = 2
theme_override_constants/separation = 16
[node name="GOResultLabel" type="Label" parent="HUD/GameOverOverlay/GOMargin/GOVBox"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 28
text = "Game Over"
horizontal_alignment = 1
[node name="GORankLabel" type="Label" parent="HUD/GameOverOverlay/GOMargin/GOVBox"]
unique_name_in_owner = true
layout_mode = 2
theme_override_font_sizes/font_size = 15
text = ""
horizontal_alignment = 1
[node name="GOMainMenuBtn" type="Button" parent="HUD/GameOverOverlay/GOMargin/GOVBox"]
unique_name_in_owner = true
layout_mode = 2
custom_minimum_size = Vector2(0, 44)
theme_override_font_sizes/font_size = 15
text = "Return to Main Menu"
[node name="HoldTimer" type="Timer" parent="."]
unique_name_in_owner = true
wait_time = 0.5
one_shot = true