diff --git a/src/logic-scenes/card_picker/card_picker.gd b/src/logic-scenes/card_picker/card_picker.gd index f700dd4..7b06f5a 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"):