polish high score/score submit stuff

This commit is contained in:
Haze Weathers 2024-12-09 01:14:32 -05:00
parent ba836830d2
commit 93656bdcfa
2 changed files with 123 additions and 99 deletions

View file

@ -65,24 +65,32 @@ func show_final_score():
func _on_AnimationPlayer_animation_finished(anim_name):
if anim_name != "results":
return
if Game.marathon_mode:
Game.current_level += 1
if Game.current_level > LevelData.marathon_end:
Fade.fade_out(Options.transition_speed_secs)
yield(Fade, "fade_finished")
SceneManager.change_scene(load("res://menus/marathon_results.tscn").instance())
else:
Game.change_map(LevelData.levels[Game.current_level].scene)
return
if Game.final_score > Game.old_high_score and not Debug.is_cheating and not ScoreBoard.server_host.empty():
animation_player.play("submit_score_popup")
else:
Fade.fade_out(Options.transition_speed_secs)
yield(Fade, "fade_finished")
SceneManager.change_scene(LevelSelect.instance())
match anim_name:
"results":
if Game.marathon_mode:
Game.current_level += 1
if Game.current_level > LevelData.marathon_end:
yield(get_tree().create_timer(6.0), "timeout")
Fade.fade_out(Options.transition_speed_secs)
yield(Fade, "fade_finished")
SceneManager.change_scene(load("res://menus/marathon_results.tscn").instance())
else:
Game.change_map(LevelData.levels[Game.current_level].scene)
elif Game.final_score > Game.old_high_score:
animation_player.play("high_score")
else:
yield(get_tree().create_timer(6.0), "timeout")
Fade.fade_out(Options.transition_speed_secs)
yield(Fade, "fade_finished")
SceneManager.change_scene(LevelSelect.instance())
"high_score":
if not Debug.is_cheating and not ScoreBoard.server_host.empty():
animation_player.play("submit_score_popup")
else:
yield(get_tree().create_timer(5.0), "timeout")
Fade.fade_out(Options.transition_speed_secs)
yield(Fade, "fade_finished")
SceneManager.change_scene(LevelSelect.instance())
func _on_YesSubmit_button_down() -> void: