fix #201: enhance controller feel when selecting thoughts

This commit is contained in:
betalars 2025-08-18 00:06:33 +02:00
parent 9e6c6d7972
commit f32a317994
1 changed files with 11 additions and 5 deletions

View File

@ -115,6 +115,7 @@ func fill_post_slots():
var picked_player: AnimationPlayer var picked_player: AnimationPlayer
var random_player: AnimationPlayer var random_player: AnimationPlayer
var on_cooldown: bool = false
var card_anim_skipped:bool = false var card_anim_skipped:bool = false
func _input(event): func _input(event):
#if event.is_action_pressed("ui_end"): #if event.is_action_pressed("ui_end"):
@ -122,11 +123,16 @@ func _input(event):
# selection_state = CARDS # selection_state = CARDS
if has_stage: if has_stage:
if !_input_locked: if not _input_locked:
if event.is_action_pressed("ui_up") or event.is_action_pressed("ui_left") or event.is_action_pressed("ui_focus_next"): if not on_cooldown:
curr_selection_id -= 1 if event.is_action_pressed("ui_up") or event.is_action_pressed("ui_left") or event.is_action_pressed("ui_focus_next"):
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
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"): if event.is_action_pressed("ui_accept"):
pick(curr_selection_id) pick(curr_selection_id)
elif event.is_action_pressed("skip"): elif event.is_action_pressed("skip"):