Merge branch 'deferred_loading' of https://github.com/Geokureli/Funkin into Geokureli-deferred_loading

This commit is contained in:
Cameron Taylor
2021-02-23 23:34:08 -05:00
465 changed files with 697 additions and 229 deletions

View File

@ -23,14 +23,12 @@ import flixel.util.FlxTimer;
import io.newgrounds.NG;
import lime.app.Application;
import openfl.Assets;
import polymod.Polymod;
using StringTools;
class TitleState extends MusicBeatState
{
static var initialized:Bool = false;
static public var soundExt:String = ".mp3";
var blackScreen:FlxSprite;
var credGroup:FlxGroup;
@ -44,12 +42,10 @@ class TitleState extends MusicBeatState
override public function create():Void
{
Polymod.init({modRoot: "mods", dirs: ['introMod']});
#if (!web)
TitleState.soundExt = '.ogg';
#if polymod
polymod.Polymod.init({modRoot: "mods", dirs: ['introMod']});
#end
PlayerSettings.init();
curWacky = FlxG.random.getObject(getIntroTextShit());
@ -121,10 +117,10 @@ class TitleState extends MusicBeatState
// https://github.com/HaxeFlixel/flixel-addons/pull/348
// var music:FlxSound = new FlxSound();
// music.loadStream('assets/music/freakyMenu' + TitleState.soundExt);
// music.loadStream(Paths.music('freakyMenu'));
// FlxG.sound.list.add(music);
// music.play();
FlxG.sound.playMusic('assets/music/freakyMenu' + TitleState.soundExt, 0);
FlxG.sound.playMusic(Paths.music('freakyMenu'), 0);
FlxG.sound.music.fadeIn(4, 0, 0.7);
}
@ -139,7 +135,7 @@ class TitleState extends MusicBeatState
add(bg);
logoBl = new FlxSprite(-150, -100);
logoBl.frames = FlxAtlasFrames.fromSparrow('assets/images/logoBumpin.png', 'assets/images/logoBumpin.xml');
logoBl.frames = Paths.getSparrowAtlas('logoBumpin');
logoBl.antialiasing = true;
logoBl.animation.addByPrefix('bump', 'logo bumpin', 24);
logoBl.animation.play('bump');
@ -148,7 +144,7 @@ class TitleState extends MusicBeatState
// logoBl.color = FlxColor.BLACK;
gfDance = new FlxSprite(FlxG.width * 0.4, FlxG.height * 0.07);
gfDance.frames = FlxAtlasFrames.fromSparrow('assets/images/gfDanceTitle.png', 'assets/images/gfDanceTitle.xml');
gfDance.frames = Paths.getSparrowAtlas('gfDanceTitle');
gfDance.animation.addByIndices('danceLeft', 'gfDance', [30, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], "", 24, false);
gfDance.animation.addByIndices('danceRight', 'gfDance', [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29], "", 24, false);
gfDance.antialiasing = true;
@ -156,7 +152,7 @@ class TitleState extends MusicBeatState
add(logoBl);
titleText = new FlxSprite(100, FlxG.height * 0.8);
titleText.frames = FlxAtlasFrames.fromSparrow('assets/images/titleEnter.png', 'assets/images/titleEnter.xml');
titleText.frames = Paths.getSparrowAtlas('titleEnter');
titleText.animation.addByPrefix('idle', "Press Enter to Begin", 24);
titleText.animation.addByPrefix('press', "ENTER PRESSED", 24);
titleText.antialiasing = true;
@ -165,7 +161,7 @@ class TitleState extends MusicBeatState
// titleText.screenCenter(X);
add(titleText);
var logo:FlxSprite = new FlxSprite().loadGraphic('assets/images/logo.png');
var logo:FlxSprite = new FlxSprite().loadGraphic(Paths.image('logo'));
logo.screenCenter();
logo.antialiasing = true;
// add(logo);
@ -187,7 +183,7 @@ class TitleState extends MusicBeatState
credTextShit.visible = false;
ngSpr = new FlxSprite(0, FlxG.height * 0.52).loadGraphic('assets/images/newgrounds_logo.png');
ngSpr = new FlxSprite(0, FlxG.height * 0.52).loadGraphic(Paths.image('newgrounds_logo'));
add(ngSpr);
ngSpr.visible = false;
ngSpr.setGraphicSize(Std.int(ngSpr.width * 0.8));
@ -209,7 +205,7 @@ class TitleState extends MusicBeatState
function getIntroTextShit():Array<Array<String>>
{
var fullText:String = Assets.getText('assets/data/introText.txt');
var fullText:String = Assets.getText(Paths.txt('introText'));
var firstArray:Array<String> = fullText.split('\n');
var swagGoodArray:Array<Array<String>> = [];
@ -273,7 +269,7 @@ class TitleState extends MusicBeatState
titleText.animation.play('press');
FlxG.camera.flash(FlxColor.WHITE, 1);
FlxG.sound.play('assets/sounds/confirmMenu' + TitleState.soundExt, 0.7);
FlxG.sound.play(Paths.sound('confirmMenu'), 0.7);
transitioning = true;
// FlxG.sound.music.stop();
@ -298,7 +294,7 @@ class TitleState extends MusicBeatState
FlxG.switchState(new MainMenuState());
}
});
// FlxG.sound.play('assets/music/titleShoot' + TitleState.soundExt, 0.7);
// FlxG.sound.play(Paths.music('titleShoot'), 0.7);
}
if (pressedEnter && !skippedIntro)