REVERT ME horrible hotfixes

This commit is contained in:
betalars 2025-06-03 23:12:22 +02:00
parent 9eafc316c5
commit c149917322
1 changed files with 9 additions and 4 deletions

View File

@ -27,6 +27,7 @@ var has_stage = false:
var _input_locked = true
var selection_state = INI:
set(state):
print("Setting picker state to %s" % ["INI","CARDS","CARDS_SELECTED","TRANSITION","POSTS","POSTS_SELECTED","DONE"][state])
selection_state = state
_input_locked = !(state == CARDS or state == POSTS)
@ -129,6 +130,8 @@ func _input(event):
if event.is_action_pressed("ui_accept"):
pick(curr_selection_id)
elif event.is_action_pressed("skip"):
#FIXME resolve weird issues when animations are being skipped
return
$Meaning.stop()
if selection_state == CARDS_SELECTED:
picked_player.play("skip_pick", .1)
@ -183,7 +186,8 @@ func pick(id: int):
print("Randomly selected card %s" % options[1].text)
if not current_scene_id == Scenes.id.YOUTH_JUI_JUTSU:
randomize()
winning_id = randi() % options.size()
# investigate if this fixes error on line 197
winning_id = randi() % options.size()-1
else:
winning_id = 1 if id == 0 else 0
Steam.setAchievement("FIGHT_BACK")
@ -197,7 +201,7 @@ func pick(id: int):
for anim in anim_players:
anim.play("unshuffle")
await yield_to
await get_tree().create_timer(3).timeout
if not card_anim_skipped: transition()
func transition():
@ -225,9 +229,10 @@ func transition():
Scenes.end_current_sequence()
func show_posts():
selection_state = POSTS
for player:AnimationPlayer in anim_players:
player.play("RESET")
await get_tree().create_timer(1).timeout
selection_state = POSTS
func handle_hover(new_highlight):
@ -236,7 +241,7 @@ func handle_hover(new_highlight):
func handle_mouse_button(button_event: InputEventMouseButton, new_selection: Node):
if not _input_locked:
if button_event.button_index == MOUSE_BUTTON_LEFT and button_event.pressed:
if button_event.button_index == MOUSE_BUTTON_LEFT and button_event.pressed and not button_event.is_echo():
pick(options.find(new_selection))