File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -3534,6 +3534,8 @@ class PlayState extends MusicBeatSubState
35343534
35353535 forEachPausedSound ((s ) -> s .destroy ());
35363536
3537+ if (VideoCutscene .isPlaying ()) VideoCutscene .destroyVideo ();
3538+
35373539 FlxTween .globalManager .clear ();
35383540 FlxTimer .globalManager .clear ();
35393541
Original file line number Diff line number Diff line change @@ -347,6 +347,38 @@ class VideoCutscene
347347 // throw "Not implemented!";
348348 }
349349 }
350+
351+ /**
352+ * Destroy the active cutscene, if any. Separate from finishVideo() so that it doesn't trigger onCutsceneFinish().
353+ */
354+ public static function destroyVideo ()
355+ {
356+ #if html5
357+ if (vid != null ) PlayState .instance .remove (vid );
358+ #end
359+
360+ #if hxvlc
361+ if (vid != null )
362+ {
363+ vid .stop ();
364+ PlayState .instance .remove (vid );
365+ }
366+ #end
367+
368+ #if (html5 || hxvlc)
369+ if (vid != null )
370+ {
371+ vid ?. destroy ();
372+ vid = null ;
373+ }
374+ #end
375+
376+ if (blackScreen != null )
377+ {
378+ PlayState .instance .remove (blackScreen );
379+ blackScreen = null ;
380+ }
381+ }
350382}
351383
352384enum CutsceneType
You can’t perform that action at this time.
0 commit comments