From 40d74c0102473aa39ccc9c8d5e1da53a24911104 Mon Sep 17 00:00:00 2001 From: betalars Date: Mon, 18 Aug 2025 00:06:33 +0200 Subject: [PATCH] fix #201: enhance controller feel when selecting thoughts --- src/logic-scenes/card_picker/card_picker.gd | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/logic-scenes/card_picker/card_picker.gd b/src/logic-scenes/card_picker/card_picker.gd index f700dd48..7b06f5a1 100644 --- a/src/logic-scenes/card_picker/card_picker.gd +++ b/src/logic-scenes/card_picker/card_picker.gd @@ -115,6 +115,7 @@ func fill_post_slots(): var picked_player: AnimationPlayer var random_player: AnimationPlayer +var on_cooldown: bool = false var card_anim_skipped:bool = false func _input(event): #if event.is_action_pressed("ui_end"): @@ -122,11 +123,16 @@ func _input(event): # selection_state = CARDS if has_stage: - if !_input_locked: - if event.is_action_pressed("ui_up") or event.is_action_pressed("ui_left") or event.is_action_pressed("ui_focus_next"): - curr_selection_id -= 1 - elif event.is_action_pressed("ui_down") or event.is_action_pressed("ui_right") or event.is_action_pressed("ui_focus_prev"): - curr_selection_id += 1 + if not _input_locked: + if not on_cooldown: + if event.is_action_pressed("ui_up") or event.is_action_pressed("ui_left") or event.is_action_pressed("ui_focus_next"): + curr_selection_id -= 1 + elif event.is_action_pressed("ui_down") or event.is_action_pressed("ui_right") or event.is_action_pressed("ui_focus_prev"): + curr_selection_id += 1 + on_cooldown = true + await get_tree().create_timer(0.1).timeout + on_cooldown = false + if event.is_action_pressed("ui_accept"): pick(curr_selection_id) elif event.is_action_pressed("skip"):