fix #201: enhance controller feel when selecting thoughts
This commit is contained in:
parent
9e6c6d7972
commit
f32a317994
|
|
@ -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"):
|
||||
|
|
|
|||
Loading…
Reference in New Issue