fix: restart on video cutscenes.

This commit is contained in:
MAJigsaw77
2025-06-12 17:56:26 +03:00
parent 4541f91d84
commit 895eeed852
3 changed files with 17 additions and 5 deletions
+7 -3
View File
@@ -150,7 +150,11 @@ class VideoCutscene
{
vid.zIndex = 0;
vid.active = false;
vid.bitmap.onEncounteredError.add((_) -> finishVideo(0.5));
vid.bitmap.onEncounteredError.add(function(msg:String):Void {
trace('[VLC] Encountered an error: $msg');
finishVideo(0.5);
});
vid.bitmap.onEndReached.add(finishVideo.bind(0.5));
vid.cameras = [PlayState.instance.camCutscene];
@@ -192,8 +196,8 @@ class VideoCutscene
#if hxvlc
if (vid != null)
{
vid.stop();
vid.play();
vid.bitmap.time = 0;
vid.resume();
onVideoRestarted.dispatch();
}
#end
+5 -1
View File
@@ -90,7 +90,11 @@ class IntroSubState extends MusicBeatSubState
{
vid.zIndex = 0;
vid.active = false;
vid.bitmap.onEncounteredError.add((_) -> onLightsEnd());
vid.bitmap.onEncounteredError.add(function(msg:String):Void {
trace('[VLC] Encountered an error: $msg');
onLightsEnd();
});
vid.bitmap.onEndReached.add(onLightsEnd);
vid.bitmap.onFormatSetup.add(() -> {
vid.setGraphicSize(FlxG.initialWidth, FlxG.initialHeight);
+5 -1
View File
@@ -97,7 +97,11 @@ class AttractState extends MusicBeatState
{
vid.zIndex = 0;
vid.active = false;
vid.bitmap.onEncounteredError.add((_) -> onAttractEnd());
vid.bitmap.onEncounteredError.add(function(msg:String):Void {
trace('[VLC] Encountered an error: $msg');
onAttractEnd();
});
vid.bitmap.onEndReached.add(onAttractEnd);
vid.bitmap.onFormatSetup.add(() -> {
vid.setGraphicSize(FlxG.initialWidth, FlxG.initialHeight);