From 529084765174190fd37886543a420a52297ee7c1 Mon Sep 17 00:00:00 2001 From: dingo Date: Tue, 14 Apr 2026 22:42:53 -0400 Subject: [PATCH] fix(hand): remove _restack_hand_cards to stop fan position shuffling move_child was changing child indices which _layout_hand_cards uses to compute fan positions, causing the whole hand to shuffle on every spin or selection. z_index alone handles draw order correctly. 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/game_screen.gd | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/Client/origin-client/scenes/game/game_screen.gd b/Client/origin-client/scenes/game/game_screen.gd index 98d39b4..c9b9a7a 100644 --- a/Client/origin-client/scenes/game/game_screen.gd +++ b/Client/origin-client/scenes/game/game_screen.gd @@ -4671,8 +4671,6 @@ func _layout_hand_cards() -> void: _apply_hand_card_transform(widget, pos, deg_to_rad(angle_deg * 0.35), scale_amt, z) - _restack_hand_cards() - func _apply_hand_card_transform(widget: Control, pos: Vector2, rot: float, scale_amt: float, z: int) -> void: widget.pivot_offset = _hand_card_size(widget) * 0.5 @@ -4689,23 +4687,6 @@ func _apply_hand_card_transform(widget: Control, pos: Vector2, rot: float, scale widget.set_meta("_hand_tween", tw) -func _restack_hand_cards() -> void: - var ordered : Array[Control] = [] - for child in _hand_cards.get_children(): - if child is Control: - ordered.append(child as Control) - - ordered.sort_custom(func(a: Control, b: Control) -> bool: - var za : int = int(a.get_meta("_hand_stack", 0)) - var zb : int = int(b.get_meta("_hand_stack", 0)) - if za == zb: - return int(a.get_index()) < int(b.get_index()) - return za < zb - ) - - for i in range(ordered.size()): - _hand_cards.move_child(ordered[i], i) - func _hand_card_size(widget: Control) -> Vector2: var size_v := widget.size