mirror of
https://github.com/ninjamuffin99/Funkin.git
synced 2025-05-20 22:22:28 +00:00
weird polish bullshit
This commit is contained in:
parent
3df90b6777
commit
0ed4f87bdb
|
@ -96,8 +96,11 @@ class MainMenuState extends MusicBeatState
|
||||||
// addMenuItem('options', function () startExitState(new OptionMenu()));
|
// addMenuItem('options', function () startExitState(new OptionMenu()));
|
||||||
#if CAN_OPEN_LINKS
|
#if CAN_OPEN_LINKS
|
||||||
var hasPopupBlocker = #if web true #else false #end;
|
var hasPopupBlocker = #if web true #else false #end;
|
||||||
menuItems.createItem('kickstarter', selectDonate, hasPopupBlocker);
|
|
||||||
// menuItems.createItem('donate', selectDonate, hasPopupBlocker);
|
if (VideoState.seenVideo)
|
||||||
|
menuItems.createItem('kickstarter', selectDonate, hasPopupBlocker);
|
||||||
|
else
|
||||||
|
menuItems.createItem('donate', selectDonate, hasPopupBlocker);
|
||||||
#end
|
#end
|
||||||
menuItems.createItem('options', function() startExitState(new OptionsState()));
|
menuItems.createItem('options', function() startExitState(new OptionsState()));
|
||||||
// #if newgrounds
|
// #if newgrounds
|
||||||
|
|
|
@ -915,8 +915,8 @@ class PlayState extends MusicBeatState
|
||||||
switch (curSong.toLowerCase())
|
switch (curSong.toLowerCase())
|
||||||
{
|
{
|
||||||
// REMOVE THIS LATER
|
// REMOVE THIS LATER
|
||||||
case 'stress':
|
// case 'stress':
|
||||||
stressIntro();
|
// stressIntro();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
startCountdown();
|
startCountdown();
|
||||||
|
@ -1110,13 +1110,12 @@ class PlayState extends MusicBeatState
|
||||||
add(bfCatchGf);
|
add(bfCatchGf);
|
||||||
bfCatchGf.visible = false;
|
bfCatchGf.visible = false;
|
||||||
|
|
||||||
var cutsceneSound:FlxSound = new FlxSound();
|
|
||||||
|
|
||||||
if (PreferencesMenu.getPref('censor-naughty'))
|
if (PreferencesMenu.getPref('censor-naughty'))
|
||||||
cutsceneSound.loadEmbedded(Paths.sound('stressCutscene'));
|
tankCutscene.startSyncAudio = FlxG.sound.play(Paths.sound('stressCutscene'));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
cutsceneSound.loadEmbedded(Paths.sound('song3censor'));
|
tankCutscene.startSyncAudio = FlxG.sound.play(Paths.sound('song3censor'));
|
||||||
|
// cutsceneSound.loadEmbedded(Paths.sound('song3censor'));
|
||||||
|
|
||||||
var censor:FlxSprite = new FlxSprite();
|
var censor:FlxSprite = new FlxSprite();
|
||||||
censor.frames = Paths.getSparrowAtlas('cutsceneStuff/censor');
|
censor.frames = Paths.getSparrowAtlas('cutsceneStuff/censor');
|
||||||
|
@ -1173,7 +1172,7 @@ class PlayState extends MusicBeatState
|
||||||
|
|
||||||
// new FlxTimer().start(0.01, function(tmr) cutsceneSound.play()); // cutsceneSound.play();
|
// new FlxTimer().start(0.01, function(tmr) cutsceneSound.play()); // cutsceneSound.play();
|
||||||
// cutsceneSound.play();
|
// cutsceneSound.play();
|
||||||
tankCutscene.startSyncAudio = cutsceneSound;
|
// tankCutscene.startSyncAudio = cutsceneSound;
|
||||||
// tankCutscene.animation.curAnim.curFrame
|
// tankCutscene.animation.curAnim.curFrame
|
||||||
|
|
||||||
FlxG.camera.zoom = defaultCamZoom * 1.15;
|
FlxG.camera.zoom = defaultCamZoom * 1.15;
|
||||||
|
@ -2229,7 +2228,13 @@ class PlayState extends MusicBeatState
|
||||||
transIn = FlxTransitionableState.defaultTransIn;
|
transIn = FlxTransitionableState.defaultTransIn;
|
||||||
transOut = FlxTransitionableState.defaultTransOut;
|
transOut = FlxTransitionableState.defaultTransOut;
|
||||||
|
|
||||||
FlxG.switchState(new StoryMenuState());
|
switch (PlayState.storyWeek)
|
||||||
|
{
|
||||||
|
case 7:
|
||||||
|
FlxG.switchState(new VideoState());
|
||||||
|
default:
|
||||||
|
FlxG.switchState(new StoryMenuState());
|
||||||
|
}
|
||||||
|
|
||||||
// if ()
|
// if ()
|
||||||
StoryMenuState.weekUnlocked[Std.int(Math.min(storyWeek + 1, StoryMenuState.weekUnlocked.length - 1))] = true;
|
StoryMenuState.weekUnlocked[Std.int(Math.min(storyWeek + 1, StoryMenuState.weekUnlocked.length - 1))] = true;
|
||||||
|
|
|
@ -109,29 +109,35 @@ class TitleState extends MusicBeatState
|
||||||
FlxG.switchState(new FreeplayState());
|
FlxG.switchState(new FreeplayState());
|
||||||
#elseif CHARTING
|
#elseif CHARTING
|
||||||
FlxG.switchState(new ChartingState());
|
FlxG.switchState(new ChartingState());
|
||||||
#elseif web
|
/*
|
||||||
if (!initialized)
|
#elseif web
|
||||||
{
|
|
||||||
video = new Video();
|
|
||||||
FlxG.stage.addChild(video);
|
|
||||||
|
|
||||||
var netConnection = new NetConnection();
|
|
||||||
netConnection.connect(null);
|
|
||||||
|
|
||||||
netStream = new NetStream(netConnection);
|
if (!initialized)
|
||||||
netStream.client = {onMetaData: client_onMetaData};
|
{
|
||||||
netStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, netStream_onAsyncError);
|
|
||||||
netConnection.addEventListener(NetStatusEvent.NET_STATUS, netConnection_onNetStatus);
|
|
||||||
// netStream.addEventListener(NetStatusEvent.NET_STATUS) // netStream.play(Paths.file('music/kickstarterTrailer.mp4'));
|
|
||||||
|
|
||||||
overlay = new Sprite();
|
video = new Video();
|
||||||
overlay.graphics.beginFill(0, 0.5);
|
FlxG.stage.addChild(video);
|
||||||
overlay.graphics.drawRect(0, 0, 1280, 720);
|
|
||||||
overlay.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
|
||||||
|
|
||||||
overlay.buttonMode = true;
|
var netConnection = new NetConnection();
|
||||||
FlxG.stage.addChild(overlay);
|
netConnection.connect(null);
|
||||||
}
|
|
||||||
|
netStream = new NetStream(netConnection);
|
||||||
|
netStream.client = {onMetaData: client_onMetaData};
|
||||||
|
netStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, netStream_onAsyncError);
|
||||||
|
netConnection.addEventListener(NetStatusEvent.NET_STATUS, netConnection_onNetStatus);
|
||||||
|
// netStream.addEventListener(NetStatusEvent.NET_STATUS) // netStream.play(Paths.file('music/kickstarterTrailer.mp4'));
|
||||||
|
|
||||||
|
overlay = new Sprite();
|
||||||
|
overlay.graphics.beginFill(0, 0.5);
|
||||||
|
overlay.graphics.drawRect(0, 0, 1280, 720);
|
||||||
|
overlay.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
||||||
|
|
||||||
|
overlay.buttonMode = true;
|
||||||
|
// FlxG.stage.addChild(overlay);
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// netConnection.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
// netConnection.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
||||||
#else
|
#else
|
||||||
|
@ -169,8 +175,8 @@ class TitleState extends MusicBeatState
|
||||||
{
|
{
|
||||||
if (event.info.code == 'NetStream.Play.Complete')
|
if (event.info.code == 'NetStream.Play.Complete')
|
||||||
{
|
{
|
||||||
netStream.dispose();
|
// netStream.dispose();
|
||||||
FlxG.stage.removeChild(video);
|
// FlxG.stage.removeChild(video);
|
||||||
|
|
||||||
startIntro();
|
startIntro();
|
||||||
}
|
}
|
||||||
|
@ -182,7 +188,7 @@ class TitleState extends MusicBeatState
|
||||||
{
|
{
|
||||||
netStream.soundTransform.volume = 0.2;
|
netStream.soundTransform.volume = 0.2;
|
||||||
netStream.soundTransform.pan = -1;
|
netStream.soundTransform.pan = -1;
|
||||||
netStream.play(Paths.file('music/kickstarterTrailer.mp4'));
|
// netStream.play(Paths.file('music/kickstarterTrailer.mp4'));
|
||||||
|
|
||||||
FlxG.stage.removeChild(overlay);
|
FlxG.stage.removeChild(overlay);
|
||||||
}
|
}
|
||||||
|
@ -310,6 +316,9 @@ class TitleState extends MusicBeatState
|
||||||
else
|
else
|
||||||
initialized = true;
|
initialized = true;
|
||||||
|
|
||||||
|
if (FlxG.sound.music != null)
|
||||||
|
FlxG.sound.music.onComplete = function() FlxG.switchState(new VideoState());
|
||||||
|
|
||||||
// credGroup.add(credTextShit);
|
// credGroup.add(credTextShit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -382,6 +391,9 @@ class TitleState extends MusicBeatState
|
||||||
|
|
||||||
if (pressedEnter && !transitioning && skippedIntro)
|
if (pressedEnter && !transitioning && skippedIntro)
|
||||||
{
|
{
|
||||||
|
if (FlxG.sound.music != null)
|
||||||
|
FlxG.sound.music.onComplete = null;
|
||||||
|
// netStream.play(Paths.file('music/kickstarterTrailer.mp4'));
|
||||||
NGio.unlockMedal(60960);
|
NGio.unlockMedal(60960);
|
||||||
|
|
||||||
// If it's Friday according to da clock
|
// If it's Friday according to da clock
|
||||||
|
@ -427,17 +439,18 @@ class TitleState extends MusicBeatState
|
||||||
{
|
{
|
||||||
skipIntro();
|
skipIntro();
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
#if web
|
||||||
|
if (!initialized && controls.ACCEPT)
|
||||||
|
{
|
||||||
|
// netStream.dispose();
|
||||||
|
// FlxG.stage.removeChild(video);
|
||||||
|
|
||||||
#if web
|
startIntro();
|
||||||
if (!initialized && controls.ACCEPT)
|
skipIntro();
|
||||||
{
|
}
|
||||||
netStream.dispose();
|
#end
|
||||||
FlxG.stage.removeChild(video);
|
*/
|
||||||
|
|
||||||
startIntro();
|
|
||||||
skipIntro();
|
|
||||||
}
|
|
||||||
#end
|
|
||||||
|
|
||||||
// if (FlxG.keys.justPressed.SPACE)
|
// if (FlxG.keys.justPressed.SPACE)
|
||||||
// swagShader.hasOutline = !swagShader.hasOutline;
|
// swagShader.hasOutline = !swagShader.hasOutline;
|
||||||
|
|
99
source/VideoState.hx
Normal file
99
source/VideoState.hx
Normal file
|
@ -0,0 +1,99 @@
|
||||||
|
package;
|
||||||
|
|
||||||
|
import flixel.FlxG;
|
||||||
|
import openfl.display.Sprite;
|
||||||
|
import openfl.events.AsyncErrorEvent;
|
||||||
|
import openfl.events.MouseEvent;
|
||||||
|
import openfl.events.NetStatusEvent;
|
||||||
|
import openfl.media.Video;
|
||||||
|
import openfl.net.NetConnection;
|
||||||
|
import openfl.net.NetStream;
|
||||||
|
|
||||||
|
class VideoState extends MusicBeatState
|
||||||
|
{
|
||||||
|
var video:Video;
|
||||||
|
var netStream:NetStream;
|
||||||
|
private var overlay:Sprite;
|
||||||
|
|
||||||
|
public static var seenVideo:Bool = false;
|
||||||
|
|
||||||
|
override function create()
|
||||||
|
{
|
||||||
|
super.create();
|
||||||
|
|
||||||
|
seenVideo = true;
|
||||||
|
|
||||||
|
if (FlxG.sound.music != null)
|
||||||
|
FlxG.sound.music.stop();
|
||||||
|
|
||||||
|
video = new Video();
|
||||||
|
FlxG.addChildBelowMouse(video);
|
||||||
|
|
||||||
|
var netConnection = new NetConnection();
|
||||||
|
netConnection.connect(null);
|
||||||
|
|
||||||
|
netStream = new NetStream(netConnection);
|
||||||
|
netStream.client = {onMetaData: client_onMetaData};
|
||||||
|
netStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, netStream_onAsyncError);
|
||||||
|
netConnection.addEventListener(NetStatusEvent.NET_STATUS, netConnection_onNetStatus);
|
||||||
|
// netStream.addEventListener(NetStatusEvent.NET_STATUS);
|
||||||
|
netStream.play(Paths.file('music/kickstarterTrailer.mp4'));
|
||||||
|
|
||||||
|
overlay = new Sprite();
|
||||||
|
overlay.graphics.beginFill(0, 0.5);
|
||||||
|
overlay.graphics.drawRect(0, 0, 1280, 720);
|
||||||
|
overlay.addEventListener(MouseEvent.MOUSE_DOWN, overlay_onMouseDown);
|
||||||
|
|
||||||
|
overlay.buttonMode = true;
|
||||||
|
// FlxG.stage.addChild(overlay);
|
||||||
|
}
|
||||||
|
|
||||||
|
override function update(elapsed:Float)
|
||||||
|
{
|
||||||
|
if (controls.ACCEPT)
|
||||||
|
finishVid();
|
||||||
|
|
||||||
|
super.update(elapsed);
|
||||||
|
}
|
||||||
|
|
||||||
|
function finishVid():Void
|
||||||
|
{
|
||||||
|
netStream.dispose();
|
||||||
|
FlxG.removeChild(video);
|
||||||
|
|
||||||
|
FlxG.switchState(new TitleState());
|
||||||
|
}
|
||||||
|
|
||||||
|
private function client_onMetaData(metaData:Dynamic)
|
||||||
|
{
|
||||||
|
video.attachNetStream(netStream);
|
||||||
|
|
||||||
|
video.width = video.videoWidth;
|
||||||
|
video.height = video.videoHeight;
|
||||||
|
// video.
|
||||||
|
}
|
||||||
|
|
||||||
|
private function netStream_onAsyncError(event:AsyncErrorEvent):Void
|
||||||
|
{
|
||||||
|
trace("Error loading video");
|
||||||
|
}
|
||||||
|
|
||||||
|
private function netConnection_onNetStatus(event:NetStatusEvent):Void
|
||||||
|
{
|
||||||
|
if (event.info.code == 'NetStream.Play.Complete')
|
||||||
|
{
|
||||||
|
finishVid();
|
||||||
|
}
|
||||||
|
|
||||||
|
trace(event.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
private function overlay_onMouseDown(event:MouseEvent):Void
|
||||||
|
{
|
||||||
|
netStream.soundTransform.volume = 0.2;
|
||||||
|
netStream.soundTransform.pan = -1;
|
||||||
|
// netStream.play(Paths.file('music/kickstarterTrailer.mp4'));
|
||||||
|
|
||||||
|
FlxG.stage.removeChild(overlay);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue