fix(hand): remove hover effect that was shifting card positions on mouse move
Hover lift/scale/z_index boosts and mouse_entered/exited callbacks were causing cards to jump around whenever the cursor passed over them. 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:
@@ -4489,13 +4489,6 @@ func _make_hand_card(card: Dictionary) -> Control:
|
|||||||
def["movementPoints"] = card.get("maxMp", def.get("movementPoints", null))
|
def["movementPoints"] = card.get("maxMp", def.get("movementPoints", null))
|
||||||
|
|
||||||
widget.setup(card, def)
|
widget.setup(card, def)
|
||||||
widget.mouse_entered.connect(func() -> void:
|
|
||||||
_hand_hover_iid = iid
|
|
||||||
_layout_hand_cards())
|
|
||||||
widget.mouse_exited.connect(func() -> void:
|
|
||||||
if _hand_hover_iid == iid:
|
|
||||||
_hand_hover_iid = ""
|
|
||||||
_layout_hand_cards())
|
|
||||||
|
|
||||||
# CardWidget emits card_pressed(definition_id); forward as hand-card click.
|
# CardWidget emits card_pressed(definition_id); forward as hand-card click.
|
||||||
# Note: _focus_hand_card is intentionally NOT called here — clicking a card
|
# Note: _focus_hand_card is intentionally NOT called here — clicking a card
|
||||||
@@ -4661,15 +4654,10 @@ func _layout_hand_cards() -> void:
|
|||||||
var lift : float = 0.0
|
var lift : float = 0.0
|
||||||
var scale_amt : float = fit_scale * lerpf(1.0, 0.84, edge_factor)
|
var scale_amt : float = fit_scale * lerpf(1.0, 0.84, edge_factor)
|
||||||
var is_selected := bool(widget.get_meta("_sel", false))
|
var is_selected := bool(widget.get_meta("_sel", false))
|
||||||
var card_iid := str(widget.get_meta("card_instance_id", ""))
|
|
||||||
var is_hovered := card_iid == _hand_hover_iid
|
|
||||||
|
|
||||||
if is_selected:
|
if is_selected:
|
||||||
scale_amt += 0.08
|
scale_amt += 0.08
|
||||||
lift += 16.0
|
lift += 16.0
|
||||||
if is_hovered:
|
|
||||||
scale_amt += 0.10
|
|
||||||
lift += 30.0
|
|
||||||
|
|
||||||
var pos := Vector2.ZERO
|
var pos := Vector2.ZERO
|
||||||
pos.x = viewport_size.x * 0.5 + t * fan_half_width - (card_size.x * scale_amt) * 0.5
|
pos.x = viewport_size.x * 0.5 + t * fan_half_width - (card_size.x * scale_amt) * 0.5
|
||||||
@@ -4679,8 +4667,6 @@ func _layout_hand_cards() -> void:
|
|||||||
var z := 20 + int((1.0 - edge_factor) * 100.0)
|
var z := 20 + int((1.0 - edge_factor) * 100.0)
|
||||||
if is_selected:
|
if is_selected:
|
||||||
z += 120
|
z += 120
|
||||||
if is_hovered:
|
|
||||||
z += 240
|
|
||||||
widget.set_meta("_hand_stack", z)
|
widget.set_meta("_hand_stack", z)
|
||||||
|
|
||||||
_apply_hand_card_transform(widget, pos, deg_to_rad(angle_deg * 0.35), scale_amt, z)
|
_apply_hand_card_transform(widget, pos, deg_to_rad(angle_deg * 0.35), scale_amt, z)
|
||||||
|
|||||||
Reference in New Issue
Block a user