generated from ShadowMario/FNF-PsychEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
62 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package funkin.backend.handlers; | ||
|
||
// TODO: umm make video states easier :3 | ||
#if VIDEOS_ALLOWED | ||
#if (hxCodec >= "2.6.1") | ||
import hxcodec.VideoHandler as MP4Handler; | ||
#elseif (hxCodec == "2.6.0") | ||
import VideoHandler as MP4Handler; | ||
#else | ||
import vlc.MP4Handler; | ||
#end | ||
using StringTools; | ||
|
||
class VidHandler extends MusicBeatState{ | ||
static var video:MP4Handler; | ||
|
||
override function create() | ||
{ | ||
super.create(); | ||
} | ||
public static function startVideo(videoName:String) { | ||
if(FlxG.sound.music != null) | ||
FlxG.sound.music.fadeOut(1, 0, function(_) FlxG.sound.music.stop()); | ||
if (funkin.game.Main.fpsVar != null) | ||
funkin.game.Main.fpsVar.visible = false; | ||
FlxG.mouse.visible = false; | ||
video = new MP4Handler(); | ||
video.playVideo(Paths.video(videoName)); | ||
trace(videoName); | ||
video.finishCallback = function() | ||
{ | ||
if (funkin.game.Main.fpsVar != null) | ||
funkin.game.Main.fpsVar.visible = ClientPrefs.data.showFPS; | ||
FlxG.sound.playMusic(Paths.music('freakyMenu'), 0); | ||
FlxG.sound.music.fadeIn(4, 0, 0.7); | ||
FlxG.mouse.visible = true; | ||
MusicBeatState.switchState(new MainMenuState()); | ||
return; | ||
} | ||
} | ||
override function update(elapsed:Float) | ||
{ | ||
super.update(elapsed); | ||
if ((FlxG.keys.justPressed.ANY && !controls.ACCEPT) && video != null) | ||
{ | ||
video.finishVideo(); | ||
} | ||
} | ||
} | ||
#end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,13 @@ | ||
package funkin.game.videos; | ||
|
||
#if VIDEOS_ALLOWED | ||
class TemplateVideo extends MusicBeatState | ||
class TemplateVideo extends VidHandler | ||
{ | ||
var video:MP4Handler; | ||
|
||
override function create() | ||
{ | ||
super.create(); | ||
|
||
FlxG.sound.music.fadeOut(1, 0, function(_) FlxG.sound.music.stop()); | ||
if (funkin.game.Main.fpsVar != null) | ||
funkin.game.Main.fpsVar.visible = false; | ||
FlxG.mouse.visible = false; | ||
video = new MP4Handler(); | ||
video.playVideo(Paths.video('VIDEOPATHEHERE')); // ripped from the game | ||
video.finishCallback = function() | ||
{ | ||
if (funkin.game.Main.fpsVar != null) | ||
funkin.game.Main.fpsVar.visible = ClientPrefs.data.showFPS; | ||
FlxG.sound.playMusic(Paths.music('freakyMenu'), 0); | ||
FlxG.sound.music.fadeIn(4, 0, 0.7); | ||
FlxG.mouse.visible = true; | ||
MusicBeatState.switchState(new MainMenuState()); | ||
return; | ||
} | ||
} | ||
|
||
override function update(elapsed:Float) | ||
{ | ||
super.update(elapsed); | ||
if ((FlxG.keys.justPressed.ANY && !controls.ACCEPT) && video != null) | ||
{ | ||
video.finishVideo(); | ||
} | ||
VidHandler.startVideo('HEWWO'); | ||
} | ||
} | ||
#end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,7 @@ | ||
package funkin.game.videos; | ||
|
||
#if !macro | ||
import funkin.backend.handlers.VidHandler; | ||
|
||
#if VIDEOS_ALLOWED | ||
#if (hxCodec >= "2.6.1") | ||
import hxcodec.VideoHandler as MP4Handler; | ||
#elseif (hxCodec == "2.6.0") | ||
import VideoHandler as MP4Handler; | ||
#else | ||
import vlc.MP4Handler; | ||
#end | ||
#end | ||
|
||
using StringTools; | ||
using StringTools; | ||
#end |