fix: restart on video cutscenes.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user