forked from team-sg/hero-mark-2
pause cutscenes when unfocused
This commit is contained in:
parent
2da5935c3b
commit
0fadeb7998
2 changed files with 20 additions and 0 deletions
|
@ -15,3 +15,12 @@ func skip_cutscene() -> void:
|
|||
yield(Fade, "fade_finished")
|
||||
animation_player.seek(cutscene_skip)
|
||||
Fade.fade_in(Options.transition_speed_secs)
|
||||
|
||||
func _notification(what: int) -> void:
|
||||
match what:
|
||||
NOTIFICATION_WM_FOCUS_OUT:
|
||||
animation_player.playback_active = false
|
||||
$FamiVoice.stream_paused = true
|
||||
NOTIFICATION_WM_FOCUS_IN:
|
||||
animation_player.playback_active = true
|
||||
$FamiVoice.stream_paused = false
|
||||
|
|
|
@ -11,6 +11,17 @@ func _input(event):
|
|||
yield(Fade, "fade_finished")
|
||||
SceneManager.current_scene = load("res://menus/level_select_scholar.tscn").instance()
|
||||
|
||||
func _notification(what: int) -> void:
|
||||
match what:
|
||||
NOTIFICATION_WM_FOCUS_OUT:
|
||||
$AnimationPlayer.playback_active = false
|
||||
$VoiceOver.stream_paused = true
|
||||
Audio.ac_music.stream_paused = true
|
||||
NOTIFICATION_WM_FOCUS_IN:
|
||||
$AnimationPlayer.playback_active = true
|
||||
$VoiceOver.stream_paused = false
|
||||
Audio.ac_music.stream_paused = false
|
||||
|
||||
func _on_AnimationPlayer_animation_finished(anim_name):
|
||||
Fade.fade_out(Options.transition_speed_secs)
|
||||
yield(Fade, "fade_finished")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue