Merge branch 'master' of https://github.com/KadeDev/Kade-Engine
This commit is contained in:
@ -238,7 +238,7 @@ class AlphaCharacter extends FlxSprite
|
||||
|
||||
public static var numbers:String = "1234567890";
|
||||
|
||||
public static var symbols:String = "|~#$%()*+-:;<=>@[]^_.,'!?";
|
||||
public static var symbols:String = "|~#$%()*+-:;<=>@[]^_.,'!? ";
|
||||
|
||||
public var row:Int = 0;
|
||||
|
||||
@ -302,6 +302,48 @@ class AlphaCharacter extends FlxSprite
|
||||
case "!":
|
||||
animation.addByPrefix(letter, 'exclamation point', 24);
|
||||
animation.play(letter);
|
||||
case '_':
|
||||
animation.addByPrefix(letter, '_', 24);
|
||||
animation.play(letter);
|
||||
y += 50;
|
||||
case "#":
|
||||
animation.addByPrefix(letter, '#', 24);
|
||||
animation.play(letter);
|
||||
case "$":
|
||||
animation.addByPrefix(letter, '$', 24);
|
||||
animation.play(letter);
|
||||
case "%":
|
||||
animation.addByPrefix(letter, '%', 24);
|
||||
animation.play(letter);
|
||||
case "&":
|
||||
animation.addByPrefix(letter, '&', 24);
|
||||
animation.play(letter);
|
||||
case "(":
|
||||
animation.addByPrefix(letter, '(', 24);
|
||||
animation.play(letter);
|
||||
case ")":
|
||||
animation.addByPrefix(letter, ')', 24);
|
||||
animation.play(letter);
|
||||
case "+":
|
||||
animation.addByPrefix(letter, '+', 24);
|
||||
animation.play(letter);
|
||||
case "-":
|
||||
animation.addByPrefix(letter, '-', 24);
|
||||
animation.play(letter);
|
||||
case '"':
|
||||
animation.addByPrefix(letter, '"', 24);
|
||||
animation.play(letter);
|
||||
y -= 0;
|
||||
case '@':
|
||||
animation.addByPrefix(letter, '@', 24);
|
||||
animation.play(letter);
|
||||
case "^":
|
||||
animation.addByPrefix(letter, '^', 24);
|
||||
animation.play(letter);
|
||||
y -= 0;
|
||||
case ' ':
|
||||
animation.addByPrefix(letter, 'space', 24);
|
||||
animation.play(letter);
|
||||
}
|
||||
|
||||
updateHitbox();
|
||||
|
@ -55,7 +55,7 @@ class ChartingState extends MusicBeatState
|
||||
var bpmTxt:FlxText;
|
||||
|
||||
var strumLine:FlxSprite;
|
||||
var curSong:String = 'Dadbattle';
|
||||
var curSong:String = 'Dad Battle';
|
||||
var amountSteps:Int = 0;
|
||||
var bullshitUI:FlxGroup;
|
||||
var writingNotesText:FlxText;
|
||||
@ -515,7 +515,7 @@ class ChartingState extends MusicBeatState
|
||||
case 'Change BPM':
|
||||
_song.notes[curSection].changeBPM = check.checked;
|
||||
FlxG.log.add('changed bpm shit');
|
||||
case "Alt Animation":
|
||||
case "Alternate Animation":
|
||||
_song.notes[curSection].altAnim = check.checked;
|
||||
}
|
||||
}
|
||||
@ -670,8 +670,8 @@ class ChartingState extends MusicBeatState
|
||||
else FlxG.sound.play(Paths.sound('SNAP'));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/*curRenderedNotes.forEach(function(note:Note) {
|
||||
if (strumLine.overlaps(note) && strumLine.y == note.y) // yandere dev type shit
|
||||
@ -1390,4 +1390,4 @@ class ChartingState extends MusicBeatState
|
||||
_file = null;
|
||||
FlxG.log.error("Problem saving Level data");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,7 @@ class FreeplayState extends MusicBeatState
|
||||
public function addWeek(songs:Array<String>, weekNum:Int, ?songCharacters:Array<String>)
|
||||
{
|
||||
if (songCharacters == null)
|
||||
songCharacters = ['bf'];
|
||||
songCharacters = ['dad'];
|
||||
|
||||
var num:Int = 0;
|
||||
for (song in songs)
|
||||
|
@ -1,239 +1,254 @@
|
||||
package;
|
||||
|
||||
import Controls.KeyboardScheme;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxObject;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.effects.FlxFlicker;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.tweens.FlxEase;
|
||||
import flixel.tweens.FlxTween;
|
||||
import flixel.util.FlxColor;
|
||||
import io.newgrounds.NG;
|
||||
import lime.app.Application;
|
||||
|
||||
#if windows
|
||||
import Discord.DiscordClient;
|
||||
#end
|
||||
|
||||
using StringTools;
|
||||
|
||||
class MainMenuState extends MusicBeatState
|
||||
{
|
||||
var curSelected:Int = 0;
|
||||
|
||||
var menuItems:FlxTypedGroup<FlxSprite>;
|
||||
|
||||
#if !switch
|
||||
var optionShit:Array<String> = ['story mode', 'freeplay', 'donate', 'options'];
|
||||
#else
|
||||
var optionShit:Array<String> = ['story mode', 'freeplay'];
|
||||
#end
|
||||
|
||||
var newGaming:FlxText;
|
||||
var newGaming2:FlxText;
|
||||
var newInput:Bool = true;
|
||||
|
||||
public static var nightly:String = "";
|
||||
|
||||
public static var kadeEngineVer:String = "1.4.2" + nightly;
|
||||
public static var gameVer:String = "0.2.7.1";
|
||||
|
||||
var magenta:FlxSprite;
|
||||
var camFollow:FlxObject;
|
||||
|
||||
override function create()
|
||||
{
|
||||
#if windows
|
||||
// Updating Discord Rich Presence
|
||||
DiscordClient.changePresence("In the Menus", null);
|
||||
#end
|
||||
|
||||
if (!FlxG.sound.music.playing)
|
||||
{
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||
}
|
||||
|
||||
persistentUpdate = persistentDraw = true;
|
||||
|
||||
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG'));
|
||||
bg.scrollFactor.x = 0;
|
||||
bg.scrollFactor.y = 0.15;
|
||||
bg.setGraphicSize(Std.int(bg.width * 1.1));
|
||||
bg.updateHitbox();
|
||||
bg.screenCenter();
|
||||
bg.antialiasing = true;
|
||||
add(bg);
|
||||
|
||||
camFollow = new FlxObject(0, 0, 1, 1);
|
||||
add(camFollow);
|
||||
|
||||
magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
|
||||
magenta.scrollFactor.x = 0;
|
||||
magenta.scrollFactor.y = 0.18;
|
||||
magenta.setGraphicSize(Std.int(magenta.width * 1.1));
|
||||
magenta.updateHitbox();
|
||||
magenta.screenCenter();
|
||||
magenta.visible = false;
|
||||
magenta.antialiasing = true;
|
||||
magenta.color = 0xFFfd719b;
|
||||
add(magenta);
|
||||
// magenta.scrollFactor.set();
|
||||
|
||||
menuItems = new FlxTypedGroup<FlxSprite>();
|
||||
add(menuItems);
|
||||
|
||||
var tex = Paths.getSparrowAtlas('FNF_main_menu_assets');
|
||||
|
||||
for (i in 0...optionShit.length)
|
||||
{
|
||||
var menuItem:FlxSprite = new FlxSprite(0, 60 + (i * 160));
|
||||
menuItem.frames = tex;
|
||||
menuItem.animation.addByPrefix('idle', optionShit[i] + " basic", 24);
|
||||
menuItem.animation.addByPrefix('selected', optionShit[i] + " white", 24);
|
||||
menuItem.animation.play('idle');
|
||||
menuItem.ID = i;
|
||||
menuItem.screenCenter(X);
|
||||
menuItems.add(menuItem);
|
||||
menuItem.scrollFactor.set();
|
||||
menuItem.antialiasing = true;
|
||||
}
|
||||
|
||||
FlxG.camera.follow(camFollow, null, 0.60 * (60 / FlxG.save.data.fpsCap));
|
||||
|
||||
var versionShit:FlxText = new FlxText(5, FlxG.height - 18, 0, gameVer + (Main.watermarks ? " FNF - " + kadeEngineVer + " Kade Engine" : ""), 12);
|
||||
versionShit.scrollFactor.set();
|
||||
versionShit.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
|
||||
add(versionShit);
|
||||
|
||||
// NG.core.calls.event.logEvent('swag').send();
|
||||
|
||||
|
||||
if (FlxG.save.data.dfjk)
|
||||
controls.setKeyboardScheme(KeyboardScheme.Solo, true);
|
||||
else
|
||||
controls.setKeyboardScheme(KeyboardScheme.Duo(true), true);
|
||||
|
||||
changeItem();
|
||||
|
||||
super.create();
|
||||
}
|
||||
|
||||
var selectedSomethin:Bool = false;
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
if (FlxG.sound.music.volume < 0.8)
|
||||
{
|
||||
FlxG.sound.music.volume += 0.5 * FlxG.elapsed;
|
||||
}
|
||||
|
||||
if (!selectedSomethin)
|
||||
{
|
||||
if (controls.UP_P)
|
||||
{
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||
changeItem(-1);
|
||||
}
|
||||
|
||||
if (controls.DOWN_P)
|
||||
{
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||
changeItem(1);
|
||||
}
|
||||
|
||||
if (controls.BACK)
|
||||
{
|
||||
FlxG.switchState(new TitleState());
|
||||
}
|
||||
|
||||
if (controls.ACCEPT)
|
||||
{
|
||||
if (optionShit[curSelected] == 'donate')
|
||||
{
|
||||
#if linux
|
||||
Sys.command('/usr/bin/xdg-open', ["https://ninja-muffin24.itch.io/funkin", "&"]);
|
||||
#else
|
||||
FlxG.openURL('https://ninja-muffin24.itch.io/funkin');
|
||||
#end
|
||||
}
|
||||
else
|
||||
{
|
||||
selectedSomethin = true;
|
||||
FlxG.sound.play(Paths.sound('confirmMenu'));
|
||||
|
||||
if(FlxG.save.data.flashing){
|
||||
FlxFlicker.flicker(magenta, 1.1, 0.15, false);
|
||||
}
|
||||
|
||||
menuItems.forEach(function(spr:FlxSprite)
|
||||
{
|
||||
if (curSelected != spr.ID)
|
||||
{
|
||||
FlxTween.tween(spr, {alpha: 0}, 1.3, {
|
||||
ease: FlxEase.quadOut,
|
||||
onComplete: function(twn:FlxTween)
|
||||
{
|
||||
spr.kill();
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
FlxFlicker.flicker(spr, 1, 0.06, false, false, function(flick:FlxFlicker)
|
||||
{
|
||||
var daChoice:String = optionShit[curSelected];
|
||||
|
||||
switch (daChoice)
|
||||
{
|
||||
case 'story mode':
|
||||
FlxG.switchState(new StoryMenuState());
|
||||
trace("Story Menu Selected");
|
||||
case 'freeplay':
|
||||
FlxG.switchState(new FreeplayState());
|
||||
|
||||
trace("Freeplay Menu Selected");
|
||||
|
||||
case 'options':
|
||||
FlxG.switchState(new OptionsMenu());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.update(elapsed);
|
||||
|
||||
menuItems.forEach(function(spr:FlxSprite)
|
||||
{
|
||||
spr.screenCenter(X);
|
||||
});
|
||||
}
|
||||
|
||||
function changeItem(huh:Int = 0)
|
||||
{
|
||||
curSelected += huh;
|
||||
|
||||
if (curSelected >= menuItems.length)
|
||||
curSelected = 0;
|
||||
if (curSelected < 0)
|
||||
curSelected = menuItems.length - 1;
|
||||
|
||||
menuItems.forEach(function(spr:FlxSprite)
|
||||
{
|
||||
spr.animation.play('idle');
|
||||
|
||||
if (spr.ID == curSelected)
|
||||
{
|
||||
spr.animation.play('selected');
|
||||
camFollow.setPosition(spr.getGraphicMidpoint().x, spr.getGraphicMidpoint().y);
|
||||
}
|
||||
|
||||
spr.updateHitbox();
|
||||
});
|
||||
}
|
||||
}
|
||||
package;
|
||||
|
||||
import Controls.KeyboardScheme;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxObject;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.effects.FlxFlicker;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.tweens.FlxEase;
|
||||
import flixel.tweens.FlxTween;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.util.FlxTimer;
|
||||
import io.newgrounds.NG;
|
||||
import lime.app.Application;
|
||||
|
||||
#if windows
|
||||
import Discord.DiscordClient;
|
||||
#end
|
||||
|
||||
using StringTools;
|
||||
|
||||
class MainMenuState extends MusicBeatState
|
||||
{
|
||||
var curSelected:Int = 0;
|
||||
|
||||
var menuItems:FlxTypedGroup<FlxSprite>;
|
||||
|
||||
#if !switch
|
||||
var optionShit:Array<String> = ['story mode', 'freeplay', 'donate', 'options'];
|
||||
#else
|
||||
var optionShit:Array<String> = ['story mode', 'freeplay'];
|
||||
#end
|
||||
|
||||
var newGaming:FlxText;
|
||||
var newGaming2:FlxText;
|
||||
var newInput:Bool = true;
|
||||
|
||||
public static var nightly:String = "";
|
||||
|
||||
public static var kadeEngineVer:String = "1.4.2" + nightly;
|
||||
public static var gameVer:String = "0.2.7.1";
|
||||
|
||||
var magenta:FlxSprite;
|
||||
var camFollow:FlxObject;
|
||||
|
||||
override function create()
|
||||
{
|
||||
#if windows
|
||||
// Updating Discord Rich Presence
|
||||
DiscordClient.changePresence("In the Menus", null);
|
||||
#end
|
||||
|
||||
if (!FlxG.sound.music.playing)
|
||||
{
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'));
|
||||
}
|
||||
|
||||
persistentUpdate = persistentDraw = true;
|
||||
|
||||
var bg:FlxSprite = new FlxSprite(-80).loadGraphic(Paths.image('menuBG'));
|
||||
bg.scrollFactor.x = 0;
|
||||
bg.scrollFactor.y = 0.15;
|
||||
bg.setGraphicSize(Std.int(bg.width * 1.1));
|
||||
bg.updateHitbox();
|
||||
bg.screenCenter();
|
||||
bg.antialiasing = true;
|
||||
add(bg);
|
||||
|
||||
camFollow = new FlxObject(0, 0, 1, 1);
|
||||
add(camFollow);
|
||||
|
||||
magenta = new FlxSprite(-80).loadGraphic(Paths.image('menuDesat'));
|
||||
magenta.scrollFactor.x = 0;
|
||||
magenta.scrollFactor.y = 0.18;
|
||||
magenta.setGraphicSize(Std.int(magenta.width * 1.1));
|
||||
magenta.updateHitbox();
|
||||
magenta.screenCenter();
|
||||
magenta.visible = false;
|
||||
magenta.antialiasing = true;
|
||||
magenta.color = 0xFFfd719b;
|
||||
add(magenta);
|
||||
// magenta.scrollFactor.set();
|
||||
|
||||
menuItems = new FlxTypedGroup<FlxSprite>();
|
||||
add(menuItems);
|
||||
|
||||
var tex = Paths.getSparrowAtlas('FNF_main_menu_assets');
|
||||
|
||||
for (i in 0...optionShit.length)
|
||||
{
|
||||
var menuItem:FlxSprite = new FlxSprite(0, 60 + (i * 160));
|
||||
menuItem.frames = tex;
|
||||
menuItem.animation.addByPrefix('idle', optionShit[i] + " basic", 24);
|
||||
menuItem.animation.addByPrefix('selected', optionShit[i] + " white", 24);
|
||||
menuItem.animation.play('idle');
|
||||
menuItem.ID = i;
|
||||
menuItem.screenCenter(X);
|
||||
menuItems.add(menuItem);
|
||||
menuItem.scrollFactor.set();
|
||||
menuItem.antialiasing = true;
|
||||
}
|
||||
|
||||
FlxG.camera.follow(camFollow, null, 0.60 * (60 / FlxG.save.data.fpsCap));
|
||||
|
||||
var versionShit:FlxText = new FlxText(5, FlxG.height - 18, 0, gameVer + (Main.watermarks ? " FNF - " + kadeEngineVer + " Kade Engine" : ""), 12);
|
||||
versionShit.scrollFactor.set();
|
||||
versionShit.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
|
||||
add(versionShit);
|
||||
|
||||
// NG.core.calls.event.logEvent('swag').send();
|
||||
|
||||
|
||||
if (FlxG.save.data.dfjk)
|
||||
controls.setKeyboardScheme(KeyboardScheme.Solo, true);
|
||||
else
|
||||
controls.setKeyboardScheme(KeyboardScheme.Duo(true), true);
|
||||
|
||||
changeItem();
|
||||
|
||||
super.create();
|
||||
}
|
||||
|
||||
var selectedSomethin:Bool = false;
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
if (FlxG.sound.music.volume < 0.8)
|
||||
{
|
||||
FlxG.sound.music.volume += 0.5 * FlxG.elapsed;
|
||||
}
|
||||
|
||||
if (!selectedSomethin)
|
||||
{
|
||||
if (controls.UP_P)
|
||||
{
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||
changeItem(-1);
|
||||
}
|
||||
|
||||
if (controls.DOWN_P)
|
||||
{
|
||||
FlxG.sound.play(Paths.sound('scrollMenu'));
|
||||
changeItem(1);
|
||||
}
|
||||
|
||||
if (controls.BACK)
|
||||
{
|
||||
FlxG.switchState(new TitleState());
|
||||
}
|
||||
|
||||
if (controls.ACCEPT)
|
||||
{
|
||||
if (optionShit[curSelected] == 'donate')
|
||||
{
|
||||
#if linux
|
||||
Sys.command('/usr/bin/xdg-open', ["https://www.kickstarter.com/projects/funkin/friday-night-funkin-the-full-ass-game", "&"]);
|
||||
#else
|
||||
FlxG.openURL('https://www.kickstarter.com/projects/funkin/friday-night-funkin-the-full-ass-game');
|
||||
#end
|
||||
}
|
||||
else
|
||||
{
|
||||
selectedSomethin = true;
|
||||
FlxG.sound.play(Paths.sound('confirmMenu'));
|
||||
|
||||
if (FlxG.save.data.flashing)
|
||||
FlxFlicker.flicker(magenta, 1.1, 0.15, false);
|
||||
|
||||
menuItems.forEach(function(spr:FlxSprite)
|
||||
{
|
||||
if (curSelected != spr.ID)
|
||||
{
|
||||
FlxTween.tween(spr, {alpha: 0}, 1.3, {
|
||||
ease: FlxEase.quadOut,
|
||||
onComplete: function(twn:FlxTween)
|
||||
{
|
||||
spr.kill();
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FlxG.save.data.flashing)
|
||||
{
|
||||
FlxFlicker.flicker(spr, 1, 0.06, false, false, function(flick:FlxFlicker)
|
||||
{
|
||||
goToState();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
new FlxTimer().start(1, function(tmr:FlxTimer)
|
||||
{
|
||||
goToState();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.update(elapsed);
|
||||
|
||||
menuItems.forEach(function(spr:FlxSprite)
|
||||
{
|
||||
spr.screenCenter(X);
|
||||
});
|
||||
}
|
||||
|
||||
function goToState()
|
||||
{
|
||||
var daChoice:String = optionShit[curSelected];
|
||||
|
||||
switch (daChoice)
|
||||
{
|
||||
case 'story mode':
|
||||
FlxG.switchState(new StoryMenuState());
|
||||
trace("Story Menu Selected");
|
||||
case 'freeplay':
|
||||
FlxG.switchState(new FreeplayState());
|
||||
|
||||
trace("Freeplay Menu Selected");
|
||||
|
||||
case 'options':
|
||||
FlxG.switchState(new OptionsMenu());
|
||||
}
|
||||
}
|
||||
|
||||
function changeItem(huh:Int = 0)
|
||||
{
|
||||
curSelected += huh;
|
||||
|
||||
if (curSelected >= menuItems.length)
|
||||
curSelected = 0;
|
||||
if (curSelected < 0)
|
||||
curSelected = menuItems.length - 1;
|
||||
|
||||
menuItems.forEach(function(spr:FlxSprite)
|
||||
{
|
||||
spr.animation.play('idle');
|
||||
|
||||
if (spr.ID == curSelected)
|
||||
{
|
||||
spr.animation.play('selected');
|
||||
camFollow.setPosition(spr.getGraphicMidpoint().x, spr.getGraphicMidpoint().y);
|
||||
}
|
||||
|
||||
spr.updateHitbox();
|
||||
});
|
||||
}
|
||||
}
|
@ -37,14 +37,13 @@ class MenuItem extends FlxSpriteGroup
|
||||
{
|
||||
super.update(elapsed);
|
||||
y = FlxMath.lerp(y, (targetY * 120) + 480, 0.17 * (60 / FlxG.save.data.fpsCap));
|
||||
if(FlxG.save.data.flashing){
|
||||
if (isFlashing)
|
||||
flashingInt += 1;
|
||||
|
||||
if (isFlashing)
|
||||
flashingInt += 1;
|
||||
|
||||
if (flashingInt % fakeFramerate >= Math.floor(fakeFramerate / 2))
|
||||
week.color = 0xFF33ffff;
|
||||
else
|
||||
week.color = FlxColor.WHITE;
|
||||
}
|
||||
if (flashingInt % fakeFramerate >= Math.floor(fakeFramerate / 2))
|
||||
week.color = 0xFF33ffff;
|
||||
else if (FlxG.save.data.flashing)
|
||||
week.color = FlxColor.WHITE;
|
||||
}
|
||||
}
|
||||
|
@ -1,45 +1,98 @@
|
||||
package;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxSubState;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.util.FlxColor;
|
||||
import lime.app.Application;
|
||||
|
||||
class OutdatedSubState extends MusicBeatState
|
||||
{
|
||||
public static var leftState:Bool = false;
|
||||
|
||||
public static var needVer:String = "IDFK LOL";
|
||||
|
||||
override function create()
|
||||
{
|
||||
super.create();
|
||||
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
||||
add(bg);
|
||||
var txt:FlxText = new FlxText(0, 0, FlxG.width,
|
||||
"Kade Engine is Outdated!\n"
|
||||
+ MainMenuState.kadeEngineVer
|
||||
+ " is your current version\nwhile the most recent version is " + needVer
|
||||
+ "!\nPress Space to go to the github or ESCAPE to ignore this!!",
|
||||
32);
|
||||
txt.setFormat("VCR OSD Mono", 32, FlxColor.WHITE, CENTER);
|
||||
txt.screenCenter();
|
||||
add(txt);
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
if (controls.ACCEPT)
|
||||
{
|
||||
FlxG.openURL("https://github.com/KadeDev/Kade-Engine/releases/latest");
|
||||
}
|
||||
if (controls.BACK)
|
||||
{
|
||||
leftState = true;
|
||||
FlxG.switchState(new MainMenuState());
|
||||
}
|
||||
super.update(elapsed);
|
||||
}
|
||||
}
|
||||
package;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxSubState;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.tweens.FlxEase;
|
||||
import flixel.tweens.FlxTween;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.util.FlxTimer;
|
||||
import lime.app.Application;
|
||||
|
||||
class OutdatedSubState extends MusicBeatState
|
||||
{
|
||||
public static var leftState:Bool = false;
|
||||
|
||||
public static var needVer:String = "IDFK LOL";
|
||||
public static var currChanges:String = "dk";
|
||||
|
||||
private var bgColors:Array<String> = [
|
||||
'#314d7f',
|
||||
'#4e7093',
|
||||
'#70526e',
|
||||
'#594465'
|
||||
];
|
||||
private var colorRotation:Int = 1;
|
||||
|
||||
override function create()
|
||||
{
|
||||
super.create();
|
||||
var bg:FlxSprite = new FlxSprite().loadGraphic(Paths.image('week54prototype', 'shared'));
|
||||
bg.scale.x *= 1.55;
|
||||
bg.scale.y *= 1.55;
|
||||
bg.screenCenter();
|
||||
add(bg);
|
||||
|
||||
var kadeLogo:FlxSprite = new FlxSprite(FlxG.width, 0).loadGraphic(Paths.image('KadeEngineLogo'));
|
||||
kadeLogo.scale.y = 0.3;
|
||||
kadeLogo.scale.x = 0.3;
|
||||
kadeLogo.x -= kadeLogo.frameHeight;
|
||||
kadeLogo.y -= 180;
|
||||
kadeLogo.alpha = 0.8;
|
||||
add(kadeLogo);
|
||||
|
||||
var txt:FlxText = new FlxText(0, 0, FlxG.width,
|
||||
"Your Kade Engine is outdated!\nYou are on "
|
||||
+ MainMenuState.kadeEngineVer
|
||||
+ "\nwhile the most recent version is " + needVer + "."
|
||||
+ "\n\nWhat's new:\n\n"
|
||||
+ currChanges
|
||||
+ "\n& more changes and bugfixes in the full changelog"
|
||||
+ "\n\nPress Space to view the full changelog and update\nor ESCAPE to ignore this",
|
||||
32);
|
||||
|
||||
txt.setFormat("VCR OSD Mono", 32, FlxColor.fromRGB(200, 200, 200), CENTER);
|
||||
txt.borderColor = FlxColor.BLACK;
|
||||
txt.borderSize = 3;
|
||||
txt.borderStyle = FlxTextBorderStyle.OUTLINE;
|
||||
txt.screenCenter();
|
||||
add(txt);
|
||||
|
||||
FlxTween.color(bg, 2, bg.color, FlxColor.fromString(bgColors[colorRotation]));
|
||||
FlxTween.angle(kadeLogo, kadeLogo.angle, -10, 2, {ease: FlxEase.quartInOut});
|
||||
|
||||
new FlxTimer().start(2, function(tmr:FlxTimer)
|
||||
{
|
||||
FlxTween.color(bg, 2, bg.color, FlxColor.fromString(bgColors[colorRotation]));
|
||||
if(colorRotation < (bgColors.length - 1)) colorRotation++;
|
||||
else colorRotation = 0;
|
||||
}, 0);
|
||||
|
||||
new FlxTimer().start(2, function(tmr:FlxTimer)
|
||||
{
|
||||
if(kadeLogo.angle == -10) FlxTween.angle(kadeLogo, kadeLogo.angle, 10, 2, {ease: FlxEase.quartInOut});
|
||||
else FlxTween.angle(kadeLogo, kadeLogo.angle, -10, 2, {ease: FlxEase.quartInOut});
|
||||
}, 0);
|
||||
|
||||
new FlxTimer().start(0.8, function(tmr:FlxTimer)
|
||||
{
|
||||
if(kadeLogo.alpha == 0.8) FlxTween.tween(kadeLogo, {alpha: 1}, 0.8, {ease: FlxEase.quartInOut});
|
||||
else FlxTween.tween(kadeLogo, {alpha: 0.8}, 0.8, {ease: FlxEase.quartInOut});
|
||||
}, 0);
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
if (controls.ACCEPT)
|
||||
{
|
||||
FlxG.openURL("https://kadedev.github.io/Kade-Engine/changelogs/changelog-" + needVer);
|
||||
}
|
||||
if (controls.BACK)
|
||||
{
|
||||
leftState = true;
|
||||
FlxG.switchState(new MainMenuState());
|
||||
}
|
||||
super.update(elapsed);
|
||||
}
|
||||
}
|
||||
|
@ -1,239 +1,246 @@
|
||||
package;
|
||||
|
||||
import openfl.Lib;
|
||||
#if windows
|
||||
import llua.Lua;
|
||||
#end
|
||||
import Controls.Control;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxSubState;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.input.keyboard.FlxKey;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.tweens.FlxEase;
|
||||
import flixel.tweens.FlxTween;
|
||||
import flixel.util.FlxColor;
|
||||
|
||||
class PauseSubState extends MusicBeatSubstate
|
||||
{
|
||||
var grpMenuShit:FlxTypedGroup<Alphabet>;
|
||||
|
||||
var menuItems:Array<String> = ['Resume', 'Restart Song', 'Exit to menu'];
|
||||
var curSelected:Int = 0;
|
||||
|
||||
var pauseMusic:FlxSound;
|
||||
var perSongOffset:FlxText;
|
||||
|
||||
var offsetChanged:Bool = false;
|
||||
|
||||
public function new(x:Float, y:Float)
|
||||
{
|
||||
super();
|
||||
|
||||
pauseMusic = new FlxSound().loadEmbedded(Paths.music('breakfast'), true, true);
|
||||
pauseMusic.volume = 0;
|
||||
pauseMusic.play(false, FlxG.random.int(0, Std.int(pauseMusic.length / 2)));
|
||||
|
||||
FlxG.sound.list.add(pauseMusic);
|
||||
|
||||
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
||||
bg.alpha = 0;
|
||||
bg.scrollFactor.set();
|
||||
add(bg);
|
||||
|
||||
var levelInfo:FlxText = new FlxText(20, 15, 0, "", 32);
|
||||
levelInfo.text += PlayState.SONG.song;
|
||||
levelInfo.scrollFactor.set();
|
||||
levelInfo.setFormat(Paths.font("vcr.ttf"), 32);
|
||||
levelInfo.updateHitbox();
|
||||
add(levelInfo);
|
||||
|
||||
var levelDifficulty:FlxText = new FlxText(20, 15 + 32, 0, "", 32);
|
||||
levelDifficulty.text += CoolUtil.difficultyString();
|
||||
levelDifficulty.scrollFactor.set();
|
||||
levelDifficulty.setFormat(Paths.font('vcr.ttf'), 32);
|
||||
levelDifficulty.updateHitbox();
|
||||
add(levelDifficulty);
|
||||
|
||||
levelDifficulty.alpha = 0;
|
||||
levelInfo.alpha = 0;
|
||||
|
||||
levelInfo.x = FlxG.width - (levelInfo.width + 20);
|
||||
levelDifficulty.x = FlxG.width - (levelDifficulty.width + 20);
|
||||
|
||||
FlxTween.tween(bg, {alpha: 0.6}, 0.4, {ease: FlxEase.quartInOut});
|
||||
FlxTween.tween(levelInfo, {alpha: 1, y: 20}, 0.4, {ease: FlxEase.quartInOut, startDelay: 0.3});
|
||||
FlxTween.tween(levelDifficulty, {alpha: 1, y: levelDifficulty.y + 5}, 0.4, {ease: FlxEase.quartInOut, startDelay: 0.5});
|
||||
|
||||
grpMenuShit = new FlxTypedGroup<Alphabet>();
|
||||
add(grpMenuShit);
|
||||
perSongOffset = new FlxText(5, FlxG.height - 18, 0, "Additive Offset (Left, Right): " + PlayState.songOffset + " - Description - " + 'Adds value to global offset, per song.', 12);
|
||||
perSongOffset.scrollFactor.set();
|
||||
perSongOffset.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
|
||||
|
||||
#if cpp
|
||||
add(perSongOffset);
|
||||
#end
|
||||
|
||||
for (i in 0...menuItems.length)
|
||||
{
|
||||
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, menuItems[i], true, false);
|
||||
songText.isMenuItem = true;
|
||||
songText.targetY = i;
|
||||
grpMenuShit.add(songText);
|
||||
}
|
||||
|
||||
changeSelection();
|
||||
|
||||
cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
if (pauseMusic.volume < 0.5)
|
||||
pauseMusic.volume += 0.01 * elapsed;
|
||||
|
||||
super.update(elapsed);
|
||||
|
||||
var upP = controls.UP_P;
|
||||
var downP = controls.DOWN_P;
|
||||
var leftP = controls.LEFT_P;
|
||||
var rightP = controls.RIGHT_P;
|
||||
var accepted = controls.ACCEPT;
|
||||
var oldOffset:Float = 0;
|
||||
var songPath = 'assets/data/' + PlayState.SONG.song.toLowerCase() + '/';
|
||||
|
||||
if (upP)
|
||||
{
|
||||
changeSelection(-1);
|
||||
|
||||
}else if (downP)
|
||||
{
|
||||
changeSelection(1);
|
||||
}
|
||||
|
||||
#if cpp
|
||||
else if (leftP)
|
||||
{
|
||||
oldOffset = PlayState.songOffset;
|
||||
PlayState.songOffset -= 1;
|
||||
sys.FileSystem.rename(songPath + oldOffset + '.offset', songPath + PlayState.songOffset + '.offset');
|
||||
perSongOffset.text = "Additive Offset (Left, Right): " + PlayState.songOffset + " - Description - " + 'Adds value to global offset, per song.';
|
||||
|
||||
// Prevent loop from happening every single time the offset changes
|
||||
if(!offsetChanged)
|
||||
{
|
||||
grpMenuShit.clear();
|
||||
|
||||
menuItems = ['Restart Song', 'Exit to menu'];
|
||||
|
||||
for (i in 0...menuItems.length)
|
||||
{
|
||||
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, menuItems[i], true, false);
|
||||
songText.isMenuItem = true;
|
||||
songText.targetY = i;
|
||||
grpMenuShit.add(songText);
|
||||
}
|
||||
|
||||
changeSelection();
|
||||
|
||||
cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
|
||||
offsetChanged = true;
|
||||
}
|
||||
}else if (rightP)
|
||||
{
|
||||
oldOffset = PlayState.songOffset;
|
||||
PlayState.songOffset += 1;
|
||||
sys.FileSystem.rename(songPath + oldOffset + '.offset', songPath + PlayState.songOffset + '.offset');
|
||||
perSongOffset.text = "Additive Offset (Left, Right): " + PlayState.songOffset + " - Description - " + 'Adds value to global offset, per song.';
|
||||
if(!offsetChanged)
|
||||
{
|
||||
grpMenuShit.clear();
|
||||
|
||||
menuItems = ['Restart Song', 'Exit to menu'];
|
||||
|
||||
for (i in 0...menuItems.length)
|
||||
{
|
||||
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, menuItems[i], true, false);
|
||||
songText.isMenuItem = true;
|
||||
songText.targetY = i;
|
||||
grpMenuShit.add(songText);
|
||||
}
|
||||
|
||||
changeSelection();
|
||||
|
||||
cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
|
||||
offsetChanged = true;
|
||||
}
|
||||
}
|
||||
#end
|
||||
|
||||
if (accepted)
|
||||
{
|
||||
var daSelected:String = menuItems[curSelected];
|
||||
|
||||
switch (daSelected)
|
||||
{
|
||||
case "Resume":
|
||||
close();
|
||||
case "Restart Song":
|
||||
FlxG.resetState();
|
||||
case "Exit to menu":
|
||||
PlayState.loadRep = false;
|
||||
#if windows
|
||||
if (PlayState.luaModchart != null)
|
||||
{
|
||||
PlayState.luaModchart.die();
|
||||
PlayState.luaModchart = null;
|
||||
}
|
||||
#end
|
||||
if (FlxG.save.data.fpsCap > 290)
|
||||
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(290);
|
||||
FlxG.switchState(new MainMenuState());
|
||||
}
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.J)
|
||||
{
|
||||
// for reference later!
|
||||
// PlayerSettings.player1.controls.replaceBinding(Control.LEFT, Keys, FlxKey.J, null);
|
||||
}
|
||||
}
|
||||
|
||||
override function destroy()
|
||||
{
|
||||
pauseMusic.destroy();
|
||||
|
||||
super.destroy();
|
||||
}
|
||||
|
||||
function changeSelection(change:Int = 0):Void
|
||||
{
|
||||
curSelected += change;
|
||||
|
||||
if (curSelected < 0)
|
||||
curSelected = menuItems.length - 1;
|
||||
if (curSelected >= menuItems.length)
|
||||
curSelected = 0;
|
||||
|
||||
var bullShit:Int = 0;
|
||||
|
||||
for (item in grpMenuShit.members)
|
||||
{
|
||||
item.targetY = bullShit - curSelected;
|
||||
bullShit++;
|
||||
|
||||
item.alpha = 0.6;
|
||||
// item.setGraphicSize(Std.int(item.width * 0.8));
|
||||
|
||||
if (item.targetY == 0)
|
||||
{
|
||||
item.alpha = 1;
|
||||
// item.setGraphicSize(Std.int(item.width));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
package;
|
||||
|
||||
import openfl.Lib;
|
||||
#if windows
|
||||
import llua.Lua;
|
||||
#end
|
||||
import Controls.Control;
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxSubState;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.group.FlxGroup.FlxTypedGroup;
|
||||
import flixel.input.keyboard.FlxKey;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.tweens.FlxEase;
|
||||
import flixel.tweens.FlxTween;
|
||||
import flixel.util.FlxColor;
|
||||
|
||||
class PauseSubState extends MusicBeatSubstate
|
||||
{
|
||||
var grpMenuShit:FlxTypedGroup<Alphabet>;
|
||||
|
||||
var menuItems:Array<String> = ['Resume', 'Restart Song', 'Exit to menu'];
|
||||
var curSelected:Int = 0;
|
||||
|
||||
var pauseMusic:FlxSound;
|
||||
var perSongOffset:FlxText;
|
||||
|
||||
var offsetChanged:Bool = false;
|
||||
|
||||
public function new(x:Float, y:Float)
|
||||
{
|
||||
super();
|
||||
|
||||
pauseMusic = new FlxSound().loadEmbedded(Paths.music('breakfast'), true, true);
|
||||
pauseMusic.volume = 0;
|
||||
pauseMusic.play(false, FlxG.random.int(0, Std.int(pauseMusic.length / 2)));
|
||||
|
||||
FlxG.sound.list.add(pauseMusic);
|
||||
|
||||
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
||||
bg.alpha = 0;
|
||||
bg.scrollFactor.set();
|
||||
add(bg);
|
||||
|
||||
var levelInfo:FlxText = new FlxText(20, 15, 0, "", 32);
|
||||
levelInfo.text += PlayState.SONG.song;
|
||||
levelInfo.scrollFactor.set();
|
||||
levelInfo.setFormat(Paths.font("vcr.ttf"), 32);
|
||||
levelInfo.updateHitbox();
|
||||
add(levelInfo);
|
||||
|
||||
var levelDifficulty:FlxText = new FlxText(20, 15 + 32, 0, "", 32);
|
||||
levelDifficulty.text += CoolUtil.difficultyString();
|
||||
levelDifficulty.scrollFactor.set();
|
||||
levelDifficulty.setFormat(Paths.font('vcr.ttf'), 32);
|
||||
levelDifficulty.updateHitbox();
|
||||
add(levelDifficulty);
|
||||
|
||||
levelDifficulty.alpha = 0;
|
||||
levelInfo.alpha = 0;
|
||||
|
||||
levelInfo.x = FlxG.width - (levelInfo.width + 20);
|
||||
levelDifficulty.x = FlxG.width - (levelDifficulty.width + 20);
|
||||
|
||||
FlxTween.tween(bg, {alpha: 0.6}, 0.4, {ease: FlxEase.quartInOut});
|
||||
FlxTween.tween(levelInfo, {alpha: 1, y: 20}, 0.4, {ease: FlxEase.quartInOut, startDelay: 0.3});
|
||||
FlxTween.tween(levelDifficulty, {alpha: 1, y: levelDifficulty.y + 5}, 0.4, {ease: FlxEase.quartInOut, startDelay: 0.5});
|
||||
|
||||
grpMenuShit = new FlxTypedGroup<Alphabet>();
|
||||
add(grpMenuShit);
|
||||
perSongOffset = new FlxText(5, FlxG.height - 18, 0, "Additive Offset (Left, Right): " + PlayState.songOffset + " - Description - " + 'Adds value to global offset, per song.', 12);
|
||||
perSongOffset.scrollFactor.set();
|
||||
perSongOffset.setFormat("VCR OSD Mono", 16, FlxColor.WHITE, LEFT, FlxTextBorderStyle.OUTLINE, FlxColor.BLACK);
|
||||
|
||||
#if cpp
|
||||
add(perSongOffset);
|
||||
#end
|
||||
|
||||
for (i in 0...menuItems.length)
|
||||
{
|
||||
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, menuItems[i], true, false);
|
||||
songText.isMenuItem = true;
|
||||
songText.targetY = i;
|
||||
grpMenuShit.add(songText);
|
||||
}
|
||||
|
||||
changeSelection();
|
||||
|
||||
cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
|
||||
}
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
if (pauseMusic.volume < 0.5)
|
||||
pauseMusic.volume += 0.01 * elapsed;
|
||||
|
||||
super.update(elapsed);
|
||||
|
||||
var upP = controls.UP_P;
|
||||
var downP = controls.DOWN_P;
|
||||
var leftP = controls.LEFT_P;
|
||||
var rightP = controls.RIGHT_P;
|
||||
var accepted = controls.ACCEPT;
|
||||
var oldOffset:Float = 0;
|
||||
var songPath = 'assets/data/' + PlayState.SONG.song.toLowerCase() + '/';
|
||||
|
||||
if (upP)
|
||||
{
|
||||
changeSelection(-1);
|
||||
|
||||
}else if (downP)
|
||||
{
|
||||
changeSelection(1);
|
||||
}
|
||||
|
||||
#if cpp
|
||||
else if (leftP)
|
||||
{
|
||||
oldOffset = PlayState.songOffset;
|
||||
PlayState.songOffset -= 1;
|
||||
sys.FileSystem.rename(songPath + oldOffset + '.offset', songPath + PlayState.songOffset + '.offset');
|
||||
perSongOffset.text = "Additive Offset (Left, Right): " + PlayState.songOffset + " - Description - " + 'Adds value to global offset, per song.';
|
||||
|
||||
// Prevent loop from happening every single time the offset changes
|
||||
if(!offsetChanged)
|
||||
{
|
||||
grpMenuShit.clear();
|
||||
|
||||
menuItems = ['Restart Song', 'Exit to menu'];
|
||||
|
||||
for (i in 0...menuItems.length)
|
||||
{
|
||||
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, menuItems[i], true, false);
|
||||
songText.isMenuItem = true;
|
||||
songText.targetY = i;
|
||||
grpMenuShit.add(songText);
|
||||
}
|
||||
|
||||
changeSelection();
|
||||
|
||||
cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
|
||||
offsetChanged = true;
|
||||
}
|
||||
}else if (rightP)
|
||||
{
|
||||
oldOffset = PlayState.songOffset;
|
||||
PlayState.songOffset += 1;
|
||||
sys.FileSystem.rename(songPath + oldOffset + '.offset', songPath + PlayState.songOffset + '.offset');
|
||||
perSongOffset.text = "Additive Offset (Left, Right): " + PlayState.songOffset + " - Description - " + 'Adds value to global offset, per song.';
|
||||
if(!offsetChanged)
|
||||
{
|
||||
grpMenuShit.clear();
|
||||
|
||||
menuItems = ['Restart Song', 'Exit to menu'];
|
||||
|
||||
for (i in 0...menuItems.length)
|
||||
{
|
||||
var songText:Alphabet = new Alphabet(0, (70 * i) + 30, menuItems[i], true, false);
|
||||
songText.isMenuItem = true;
|
||||
songText.targetY = i;
|
||||
grpMenuShit.add(songText);
|
||||
}
|
||||
|
||||
changeSelection();
|
||||
|
||||
cameras = [FlxG.cameras.list[FlxG.cameras.list.length - 1]];
|
||||
offsetChanged = true;
|
||||
}
|
||||
}
|
||||
#end
|
||||
|
||||
if (accepted)
|
||||
{
|
||||
var daSelected:String = menuItems[curSelected];
|
||||
|
||||
switch (daSelected)
|
||||
{
|
||||
case "Resume":
|
||||
close();
|
||||
case "Restart Song":
|
||||
FlxG.resetState();
|
||||
case "Exit to menu":
|
||||
if(PlayState.loadRep)
|
||||
{
|
||||
FlxG.save.data.botplay = false;
|
||||
FlxG.save.data.scrollSpeed = 1;
|
||||
FlxG.save.data.downscroll = false;
|
||||
}
|
||||
PlayState.loadRep = false;
|
||||
#if windows
|
||||
if (PlayState.luaModchart != null)
|
||||
{
|
||||
PlayState.luaModchart.die();
|
||||
PlayState.luaModchart = null;
|
||||
}
|
||||
#end
|
||||
if (FlxG.save.data.fpsCap > 290)
|
||||
(cast (Lib.current.getChildAt(0), Main)).setFPSCap(290);
|
||||
|
||||
FlxG.switchState(new MainMenuState());
|
||||
}
|
||||
}
|
||||
|
||||
if (FlxG.keys.justPressed.J)
|
||||
{
|
||||
// for reference later!
|
||||
// PlayerSettings.player1.controls.replaceBinding(Control.LEFT, Keys, FlxKey.J, null);
|
||||
}
|
||||
}
|
||||
|
||||
override function destroy()
|
||||
{
|
||||
pauseMusic.destroy();
|
||||
|
||||
super.destroy();
|
||||
}
|
||||
|
||||
function changeSelection(change:Int = 0):Void
|
||||
{
|
||||
curSelected += change;
|
||||
|
||||
if (curSelected < 0)
|
||||
curSelected = menuItems.length - 1;
|
||||
if (curSelected >= menuItems.length)
|
||||
curSelected = 0;
|
||||
|
||||
var bullShit:Int = 0;
|
||||
|
||||
for (item in grpMenuShit.members)
|
||||
{
|
||||
item.targetY = bullShit - curSelected;
|
||||
bullShit++;
|
||||
|
||||
item.alpha = 0.6;
|
||||
// item.setGraphicSize(Std.int(item.width * 0.8));
|
||||
|
||||
if (item.targetY == 0)
|
||||
{
|
||||
item.alpha = 1;
|
||||
// item.setGraphicSize(Std.int(item.width));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
6814
source/PlayState.hx
6814
source/PlayState.hx
File diff suppressed because it is too large
Load Diff
@ -129,10 +129,10 @@ class Ratings
|
||||
return "sick";
|
||||
}
|
||||
|
||||
public static function CalculateRanking(score:Int,scoreDef:Int,nps:Int,accuracy:Float):String
|
||||
public static function CalculateRanking(score:Int,scoreDef:Int,nps:Int,maxNPS:Int,accuracy:Float):String
|
||||
{
|
||||
return
|
||||
(FlxG.save.data.npsDisplay ? "NPS: " + nps + (!FlxG.save.data.botplay ? " | " : "") : "") + (!FlxG.save.data.botplay ? // NPS Toggle
|
||||
(FlxG.save.data.npsDisplay ? "NPS: " + nps + " (Max " + maxNPS + ")" + (!FlxG.save.data.botplay ? " | " : "") : "") + (!FlxG.save.data.botplay ? // NPS Toggle
|
||||
"Score:" + (Conductor.safeFrames != 10 ? score + " (" + scoreDef + ")" : "" + score) + // Score
|
||||
" | Combo Breaks:" + PlayState.misses + // Misses/Combo Breaks
|
||||
" | Accuracy:" + (FlxG.save.data.botplay ? "N/A" : HelperFunctions.truncateFloat(accuracy, 2) + " %") + // Accuracy
|
||||
|
192
source/Replay.hx
192
source/Replay.hx
@ -1,101 +1,91 @@
|
||||
#if sys
|
||||
import sys.io.File;
|
||||
#end
|
||||
import Controls.Control;
|
||||
import flixel.FlxG;
|
||||
import openfl.events.IOErrorEvent;
|
||||
import openfl.events.Event;
|
||||
import openfl.net.FileReference;
|
||||
import lime.utils.Assets;
|
||||
import haxe.Json;
|
||||
import flixel.input.keyboard.FlxKey;
|
||||
import openfl.utils.Dictionary;
|
||||
|
||||
typedef KeyPress =
|
||||
{
|
||||
public var time:Float;
|
||||
public var key:String;
|
||||
}
|
||||
|
||||
typedef KeyRelease =
|
||||
{
|
||||
public var time:Float;
|
||||
public var key:String;
|
||||
}
|
||||
|
||||
typedef ReplayJSON =
|
||||
{
|
||||
public var replayGameVer:String;
|
||||
public var timestamp:Date;
|
||||
public var songName:String;
|
||||
public var songDiff:Int;
|
||||
public var keyPresses:Array<KeyPress>;
|
||||
public var keyReleases:Array<KeyRelease>;
|
||||
}
|
||||
|
||||
class Replay
|
||||
{
|
||||
public static var version:String = "1.0"; // replay file version
|
||||
|
||||
public var path:String = "";
|
||||
public var replay:ReplayJSON;
|
||||
public function new(path:String)
|
||||
{
|
||||
this.path = path;
|
||||
replay = {
|
||||
songName: "Tutorial",
|
||||
songDiff: 1,
|
||||
keyPresses: [],
|
||||
keyReleases: [],
|
||||
replayGameVer: version,
|
||||
timestamp: Date.now()
|
||||
};
|
||||
}
|
||||
|
||||
public static function LoadReplay(path:String):Replay
|
||||
{
|
||||
var rep:Replay = new Replay(path);
|
||||
|
||||
rep.LoadFromJSON();
|
||||
|
||||
trace('basic replay data:\nSong Name: ' + rep.replay.songName + '\nSong Diff: ' + rep.replay.songDiff + '\nKeys Length: ' + rep.replay.keyPresses.length);
|
||||
|
||||
return rep;
|
||||
}
|
||||
|
||||
public function SaveReplay()
|
||||
{
|
||||
var json = {
|
||||
"songName": PlayState.SONG.song.toLowerCase(),
|
||||
"songDiff": PlayState.storyDifficulty,
|
||||
"keyPresses": replay.keyPresses,
|
||||
"keyReleases": replay.keyReleases,
|
||||
"timestamp": Date.now(),
|
||||
"replayGameVer": version
|
||||
};
|
||||
|
||||
var data:String = Json.stringify(json);
|
||||
|
||||
#if sys
|
||||
File.saveContent("assets/replays/replay-" + PlayState.SONG.song + "-time" + Date.now().getTime() + ".kadeReplay", data);
|
||||
#end
|
||||
}
|
||||
|
||||
|
||||
public function LoadFromJSON()
|
||||
{
|
||||
#if sys
|
||||
trace('loading ' + Sys.getCwd() + 'assets/replays/' + path + ' replay...');
|
||||
try
|
||||
{
|
||||
var repl:ReplayJSON = cast Json.parse(File.getContent(Sys.getCwd() + "assets/replays/" + path));
|
||||
replay = repl;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
trace('failed!\n' + e.message);
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
||||
}
|
||||
#if sys
|
||||
import sys.io.File;
|
||||
#end
|
||||
import Controls.Control;
|
||||
import flixel.FlxG;
|
||||
import openfl.events.IOErrorEvent;
|
||||
import openfl.events.Event;
|
||||
import openfl.net.FileReference;
|
||||
import lime.utils.Assets;
|
||||
import haxe.Json;
|
||||
import flixel.input.keyboard.FlxKey;
|
||||
import openfl.utils.Dictionary;
|
||||
|
||||
typedef ReplayJSON =
|
||||
{
|
||||
public var replayGameVer:String;
|
||||
public var timestamp:Date;
|
||||
public var songName:String;
|
||||
public var songDiff:Int;
|
||||
public var songNotes:Array<Float>;
|
||||
public var noteSpeed:Float;
|
||||
public var isDownscroll:Bool;
|
||||
}
|
||||
|
||||
class Replay
|
||||
{
|
||||
public static var version:String = "1.0"; // replay file version
|
||||
|
||||
public var path:String = "";
|
||||
public var replay:ReplayJSON;
|
||||
public function new(path:String)
|
||||
{
|
||||
this.path = path;
|
||||
replay = {
|
||||
songName: "Tutorial",
|
||||
songDiff: 1,
|
||||
noteSpeed: 1.5,
|
||||
isDownscroll: false,
|
||||
songNotes: [],
|
||||
replayGameVer: version,
|
||||
timestamp: Date.now()
|
||||
};
|
||||
}
|
||||
|
||||
public static function LoadReplay(path:String):Replay
|
||||
{
|
||||
var rep:Replay = new Replay(path);
|
||||
|
||||
rep.LoadFromJSON();
|
||||
|
||||
trace('basic replay data:\nSong Name: ' + rep.replay.songName + '\nSong Diff: ' + rep.replay.songDiff + '\nNotes Length: ' + rep.replay.songNotes.length);
|
||||
|
||||
return rep;
|
||||
}
|
||||
|
||||
public function SaveReplay(notearray:Array<Float>)
|
||||
{
|
||||
var json = {
|
||||
"songName": PlayState.SONG.song.toLowerCase(),
|
||||
"songDiff": PlayState.storyDifficulty,
|
||||
"noteSpeed": (FlxG.save.data.scrollSpeed > 1 ? FlxG.save.data.scrollSpeed : PlayState.SONG.speed),
|
||||
"isDownscroll": FlxG.save.data.downscroll,
|
||||
"songNotes": notearray,
|
||||
"timestamp": Date.now(),
|
||||
"replayGameVer": version
|
||||
};
|
||||
|
||||
var data:String = Json.stringify(json);
|
||||
|
||||
#if sys
|
||||
File.saveContent("assets/replays/replay-" + PlayState.SONG.song + "-time" + Date.now().getTime() + ".kadeReplay", data);
|
||||
#end
|
||||
}
|
||||
|
||||
public function LoadFromJSON()
|
||||
{
|
||||
#if sys
|
||||
trace('loading ' + Sys.getCwd() + 'assets/replays/' + path + ' replay...');
|
||||
try
|
||||
{
|
||||
var repl:ReplayJSON = cast Json.parse(File.getContent(Sys.getCwd() + "assets/replays/" + path));
|
||||
replay = repl;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
trace('failed!\n' + e.message);
|
||||
}
|
||||
#end
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,11 +25,11 @@ class StoryMenuState extends MusicBeatState
|
||||
|
||||
var weekData:Array<Dynamic> = [
|
||||
['Tutorial'],
|
||||
['Bopeebo', 'Fresh', 'Dadbattle'],
|
||||
['Bopeebo', 'Fresh', 'Dad Battle'],
|
||||
['Spookeez', 'South', "Monster"],
|
||||
['Pico', 'Philly', "Blammed"],
|
||||
['Satin-Panties', "High", "Milf"],
|
||||
['Cocoa', 'Eggnog', 'Winter-Horrorland'],
|
||||
['Pico', 'Philly Nice', "Blammed"],
|
||||
['Satin Panties', "High", "Milf"],
|
||||
['Cocoa', 'Eggnog', 'Winter Horrorland'],
|
||||
['Senpai', 'Roses', 'Thorns']
|
||||
];
|
||||
var curDifficulty:Int = 1;
|
||||
@ -47,7 +47,7 @@ class StoryMenuState extends MusicBeatState
|
||||
];
|
||||
|
||||
var weekNames:Array<String> = [
|
||||
"How to Funk",
|
||||
"",
|
||||
"Daddy Dearest",
|
||||
"Spooky Month",
|
||||
"PICO",
|
||||
|
@ -1,463 +1,467 @@
|
||||
package;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxState;
|
||||
import flixel.addons.display.FlxGridOverlay;
|
||||
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.addons.transition.TransitionData;
|
||||
import flixel.graphics.FlxGraphic;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
import flixel.group.FlxGroup;
|
||||
import flixel.input.gamepad.FlxGamepad;
|
||||
import flixel.math.FlxPoint;
|
||||
import flixel.math.FlxRect;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.system.ui.FlxSoundTray;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.tweens.FlxEase;
|
||||
import flixel.tweens.FlxTween;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.util.FlxTimer;
|
||||
import io.newgrounds.NG;
|
||||
import lime.app.Application;
|
||||
import openfl.Assets;
|
||||
|
||||
#if windows
|
||||
import Discord.DiscordClient;
|
||||
#end
|
||||
|
||||
#if cpp
|
||||
import sys.thread.Thread;
|
||||
#end
|
||||
|
||||
using StringTools;
|
||||
|
||||
class TitleState extends MusicBeatState
|
||||
{
|
||||
static var initialized:Bool = false;
|
||||
|
||||
var blackScreen:FlxSprite;
|
||||
var credGroup:FlxGroup;
|
||||
var credTextShit:Alphabet;
|
||||
var textGroup:FlxGroup;
|
||||
var ngSpr:FlxSprite;
|
||||
|
||||
var curWacky:Array<String> = [];
|
||||
|
||||
var wackyImage:FlxSprite;
|
||||
|
||||
override public function create():Void
|
||||
{
|
||||
#if polymod
|
||||
polymod.Polymod.init({modRoot: "mods", dirs: ['introMod']});
|
||||
#end
|
||||
|
||||
#if sys
|
||||
if (!sys.FileSystem.exists(Sys.getCwd() + "/assets/replays"))
|
||||
sys.FileSystem.createDirectory(Sys.getCwd() + "/assets/replays");
|
||||
#end
|
||||
|
||||
@:privateAccess
|
||||
{
|
||||
trace("Loaded " + openfl.Assets.getLibrary("default").assetsLoaded + " assets (DEFAULT)");
|
||||
}
|
||||
|
||||
PlayerSettings.init();
|
||||
|
||||
#if windows
|
||||
DiscordClient.initialize();
|
||||
|
||||
Application.current.onExit.add (function (exitCode) {
|
||||
DiscordClient.shutdown();
|
||||
});
|
||||
|
||||
#end
|
||||
|
||||
curWacky = FlxG.random.getObject(getIntroTextShit());
|
||||
|
||||
// DEBUG BULLSHIT
|
||||
|
||||
super.create();
|
||||
|
||||
// NGio.noLogin(APIStuff.API);
|
||||
|
||||
#if ng
|
||||
var ng:NGio = new NGio(APIStuff.API, APIStuff.EncKey);
|
||||
trace('NEWGROUNDS LOL');
|
||||
#end
|
||||
|
||||
FlxG.save.bind('funkin', 'ninjamuffin99');
|
||||
|
||||
KadeEngineData.initSave();
|
||||
|
||||
Highscore.load();
|
||||
|
||||
if (FlxG.save.data.weekUnlocked != null)
|
||||
{
|
||||
// FIX LATER!!!
|
||||
// WEEK UNLOCK PROGRESSION!!
|
||||
// StoryMenuState.weekUnlocked = FlxG.save.data.weekUnlocked;
|
||||
|
||||
if (StoryMenuState.weekUnlocked.length < 4)
|
||||
StoryMenuState.weekUnlocked.insert(0, true);
|
||||
|
||||
// QUICK PATCH OOPS!
|
||||
if (!StoryMenuState.weekUnlocked[0])
|
||||
StoryMenuState.weekUnlocked[0] = true;
|
||||
}
|
||||
|
||||
#if FREEPLAY
|
||||
FlxG.switchState(new FreeplayState());
|
||||
#elseif CHARTING
|
||||
FlxG.switchState(new ChartingState());
|
||||
#else
|
||||
new FlxTimer().start(1, function(tmr:FlxTimer)
|
||||
{
|
||||
startIntro();
|
||||
});
|
||||
#end
|
||||
}
|
||||
|
||||
var logoBl:FlxSprite;
|
||||
var gfDance:FlxSprite;
|
||||
var danceLeft:Bool = false;
|
||||
var titleText:FlxSprite;
|
||||
|
||||
function startIntro()
|
||||
{
|
||||
if (!initialized)
|
||||
{
|
||||
var diamond:FlxGraphic = FlxGraphic.fromClass(GraphicTransTileDiamond);
|
||||
diamond.persist = true;
|
||||
diamond.destroyOnNoUse = false;
|
||||
|
||||
FlxTransitionableState.defaultTransIn = new TransitionData(FADE, FlxColor.BLACK, 1, new FlxPoint(0, -1), {asset: diamond, width: 32, height: 32},
|
||||
new FlxRect(-200, -200, FlxG.width * 1.4, FlxG.height * 1.4));
|
||||
FlxTransitionableState.defaultTransOut = new TransitionData(FADE, FlxColor.BLACK, 0.7, new FlxPoint(0, 1),
|
||||
{asset: diamond, width: 32, height: 32}, new FlxRect(-200, -200, FlxG.width * 1.4, FlxG.height * 1.4));
|
||||
|
||||
transIn = FlxTransitionableState.defaultTransIn;
|
||||
transOut = FlxTransitionableState.defaultTransOut;
|
||||
|
||||
// HAD TO MODIFY SOME BACKEND SHIT
|
||||
// IF THIS PR IS HERE IF ITS ACCEPTED UR GOOD TO GO
|
||||
// https://github.com/HaxeFlixel/flixel-addons/pull/348
|
||||
|
||||
// var music:FlxSound = new FlxSound();
|
||||
// music.loadStream(Paths.music('freakyMenu'));
|
||||
// FlxG.sound.list.add(music);
|
||||
// music.play();
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'), 0);
|
||||
|
||||
FlxG.sound.music.fadeIn(4, 0, 0.7);
|
||||
}
|
||||
|
||||
Conductor.changeBPM(102);
|
||||
persistentUpdate = true;
|
||||
|
||||
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
||||
// bg.antialiasing = true;
|
||||
// bg.setGraphicSize(Std.int(bg.width * 0.6));
|
||||
// bg.updateHitbox();
|
||||
add(bg);
|
||||
|
||||
logoBl = new FlxSprite(-150, -100);
|
||||
logoBl.frames = Paths.getSparrowAtlas('logoBumpin');
|
||||
logoBl.antialiasing = true;
|
||||
logoBl.animation.addByPrefix('bump', 'logo bumpin', 24);
|
||||
logoBl.animation.play('bump');
|
||||
logoBl.updateHitbox();
|
||||
// logoBl.screenCenter();
|
||||
// logoBl.color = FlxColor.BLACK;
|
||||
|
||||
gfDance = new FlxSprite(FlxG.width * 0.4, FlxG.height * 0.07);
|
||||
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;
|
||||
add(gfDance);
|
||||
add(logoBl);
|
||||
|
||||
titleText = new FlxSprite(100, FlxG.height * 0.8);
|
||||
titleText.frames = Paths.getSparrowAtlas('titleEnter');
|
||||
titleText.animation.addByPrefix('idle', "Press Enter to Begin", 24);
|
||||
titleText.animation.addByPrefix('press', "ENTER PRESSED", 24);
|
||||
titleText.antialiasing = true;
|
||||
titleText.animation.play('idle');
|
||||
titleText.updateHitbox();
|
||||
// titleText.screenCenter(X);
|
||||
add(titleText);
|
||||
|
||||
var logo:FlxSprite = new FlxSprite().loadGraphic(Paths.image('logo'));
|
||||
logo.screenCenter();
|
||||
logo.antialiasing = true;
|
||||
// add(logo);
|
||||
|
||||
// FlxTween.tween(logoBl, {y: logoBl.y + 50}, 0.6, {ease: FlxEase.quadInOut, type: PINGPONG});
|
||||
// FlxTween.tween(logo, {y: logoBl.y + 50}, 0.6, {ease: FlxEase.quadInOut, type: PINGPONG, startDelay: 0.1});
|
||||
|
||||
credGroup = new FlxGroup();
|
||||
add(credGroup);
|
||||
textGroup = new FlxGroup();
|
||||
|
||||
blackScreen = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
||||
credGroup.add(blackScreen);
|
||||
|
||||
credTextShit = new Alphabet(0, 0, "ninjamuffin99\nPhantomArcade\nkawaisprite\nevilsk8er", true);
|
||||
credTextShit.screenCenter();
|
||||
|
||||
// credTextShit.alignment = CENTER;
|
||||
|
||||
credTextShit.visible = false;
|
||||
|
||||
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));
|
||||
ngSpr.updateHitbox();
|
||||
ngSpr.screenCenter(X);
|
||||
ngSpr.antialiasing = true;
|
||||
|
||||
FlxTween.tween(credTextShit, {y: credTextShit.y + 20}, 2.9, {ease: FlxEase.quadInOut, type: PINGPONG});
|
||||
|
||||
FlxG.mouse.visible = false;
|
||||
|
||||
if (initialized)
|
||||
skipIntro();
|
||||
else
|
||||
initialized = true;
|
||||
|
||||
// credGroup.add(credTextShit);
|
||||
}
|
||||
|
||||
function getIntroTextShit():Array<Array<String>>
|
||||
{
|
||||
var fullText:String = Assets.getText(Paths.txt('introText'));
|
||||
|
||||
var firstArray:Array<String> = fullText.split('\n');
|
||||
var swagGoodArray:Array<Array<String>> = [];
|
||||
|
||||
for (i in firstArray)
|
||||
{
|
||||
swagGoodArray.push(i.split('--'));
|
||||
}
|
||||
|
||||
return swagGoodArray;
|
||||
}
|
||||
|
||||
var transitioning:Bool = false;
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
if (FlxG.sound.music != null)
|
||||
Conductor.songPosition = FlxG.sound.music.time;
|
||||
// FlxG.watch.addQuick('amp', FlxG.sound.music.amplitude);
|
||||
|
||||
if (FlxG.keys.justPressed.F)
|
||||
{
|
||||
FlxG.fullscreen = !FlxG.fullscreen;
|
||||
}
|
||||
|
||||
var pressedEnter:Bool = FlxG.keys.justPressed.ENTER;
|
||||
|
||||
#if mobile
|
||||
for (touch in FlxG.touches.list)
|
||||
{
|
||||
if (touch.justPressed)
|
||||
{
|
||||
pressedEnter = true;
|
||||
}
|
||||
}
|
||||
#end
|
||||
|
||||
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
|
||||
|
||||
if (gamepad != null)
|
||||
{
|
||||
if (gamepad.justPressed.START)
|
||||
pressedEnter = true;
|
||||
|
||||
#if switch
|
||||
if (gamepad.justPressed.B)
|
||||
pressedEnter = true;
|
||||
#end
|
||||
}
|
||||
|
||||
if (pressedEnter && !transitioning && skippedIntro)
|
||||
{
|
||||
#if !switch
|
||||
NGio.unlockMedal(60960);
|
||||
|
||||
// If it's Friday according to da clock
|
||||
if (Date.now().getDay() == 5)
|
||||
NGio.unlockMedal(61034);
|
||||
#end
|
||||
|
||||
titleText.animation.play('press');
|
||||
|
||||
FlxG.camera.flash(FlxColor.WHITE, 1);
|
||||
FlxG.sound.play(Paths.sound('confirmMenu'), 0.7);
|
||||
|
||||
transitioning = true;
|
||||
// FlxG.sound.music.stop();
|
||||
|
||||
new FlxTimer().start(2, function(tmr:FlxTimer)
|
||||
{
|
||||
|
||||
// Get current version of Kade Engine
|
||||
|
||||
var http = new haxe.Http("https://raw.githubusercontent.com/KadeDev/Kade-Engine/master/version.downloadMe");
|
||||
|
||||
http.onData = function (data:String) {
|
||||
|
||||
if (!MainMenuState.kadeEngineVer.contains(data.trim()) && !OutdatedSubState.leftState && MainMenuState.nightly == "")
|
||||
{
|
||||
trace('outdated lmao! ' + data.trim() + ' != ' + MainMenuState.kadeEngineVer);
|
||||
OutdatedSubState.needVer = data;
|
||||
FlxG.switchState(new OutdatedSubState());
|
||||
}
|
||||
else
|
||||
{
|
||||
FlxG.switchState(new MainMenuState());
|
||||
}
|
||||
}
|
||||
|
||||
http.onError = function (error) {
|
||||
trace('error: $error');
|
||||
FlxG.switchState(new MainMenuState()); // fail but we go anyway
|
||||
}
|
||||
|
||||
http.request();
|
||||
|
||||
});
|
||||
// FlxG.sound.play(Paths.music('titleShoot'), 0.7);
|
||||
}
|
||||
|
||||
if (pressedEnter && !skippedIntro && initialized)
|
||||
{
|
||||
skipIntro();
|
||||
}
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
|
||||
function createCoolText(textArray:Array<String>)
|
||||
{
|
||||
for (i in 0...textArray.length)
|
||||
{
|
||||
var money:Alphabet = new Alphabet(0, 0, textArray[i], true, false);
|
||||
money.screenCenter(X);
|
||||
money.y += (i * 60) + 200;
|
||||
credGroup.add(money);
|
||||
textGroup.add(money);
|
||||
}
|
||||
}
|
||||
|
||||
function addMoreText(text:String)
|
||||
{
|
||||
var coolText:Alphabet = new Alphabet(0, 0, text, true, false);
|
||||
coolText.screenCenter(X);
|
||||
coolText.y += (textGroup.length * 60) + 200;
|
||||
credGroup.add(coolText);
|
||||
textGroup.add(coolText);
|
||||
}
|
||||
|
||||
function deleteCoolText()
|
||||
{
|
||||
while (textGroup.members.length > 0)
|
||||
{
|
||||
credGroup.remove(textGroup.members[0], true);
|
||||
textGroup.remove(textGroup.members[0], true);
|
||||
}
|
||||
}
|
||||
|
||||
override function beatHit()
|
||||
{
|
||||
super.beatHit();
|
||||
|
||||
logoBl.animation.play('bump');
|
||||
danceLeft = !danceLeft;
|
||||
|
||||
if (danceLeft)
|
||||
gfDance.animation.play('danceRight');
|
||||
else
|
||||
gfDance.animation.play('danceLeft');
|
||||
|
||||
FlxG.log.add(curBeat);
|
||||
|
||||
switch (curBeat)
|
||||
{
|
||||
case 1:
|
||||
createCoolText(['ninjamuffin99', 'phantomArcade', 'kawaisprite', 'evilsk8er']);
|
||||
// credTextShit.visible = true;
|
||||
case 3:
|
||||
addMoreText('present');
|
||||
// credTextShit.text += '\npresent...';
|
||||
// credTextShit.addText();
|
||||
case 4:
|
||||
deleteCoolText();
|
||||
// credTextShit.visible = false;
|
||||
// credTextShit.text = 'In association \nwith';
|
||||
// credTextShit.screenCenter();
|
||||
case 5:
|
||||
if (Main.watermarks)
|
||||
createCoolText(['Kade Engine', 'by']);
|
||||
else
|
||||
createCoolText(['In Partnership', 'with']);
|
||||
case 7:
|
||||
if (Main.watermarks)
|
||||
addMoreText('KadeDeveloper');
|
||||
else
|
||||
{
|
||||
addMoreText('Newgrounds');
|
||||
ngSpr.visible = true;
|
||||
}
|
||||
// credTextShit.text += '\nNewgrounds';
|
||||
case 8:
|
||||
deleteCoolText();
|
||||
ngSpr.visible = false;
|
||||
// credTextShit.visible = false;
|
||||
|
||||
// credTextShit.text = 'Shoutouts Tom Fulp';
|
||||
// credTextShit.screenCenter();
|
||||
case 9:
|
||||
createCoolText([curWacky[0]]);
|
||||
// credTextShit.visible = true;
|
||||
case 11:
|
||||
addMoreText(curWacky[1]);
|
||||
// credTextShit.text += '\nlmao';
|
||||
case 12:
|
||||
deleteCoolText();
|
||||
// credTextShit.visible = false;
|
||||
// credTextShit.text = "Friday";
|
||||
// credTextShit.screenCenter();
|
||||
case 13:
|
||||
addMoreText('Friday');
|
||||
// credTextShit.visible = true;
|
||||
case 14:
|
||||
addMoreText('Night');
|
||||
// credTextShit.text += '\nNight';
|
||||
case 15:
|
||||
addMoreText('Funkin'); // credTextShit.text += '\nFunkin';
|
||||
|
||||
case 16:
|
||||
skipIntro();
|
||||
}
|
||||
}
|
||||
|
||||
var skippedIntro:Bool = false;
|
||||
|
||||
function skipIntro():Void
|
||||
{
|
||||
if (!skippedIntro)
|
||||
{
|
||||
remove(ngSpr);
|
||||
|
||||
FlxG.camera.flash(FlxColor.WHITE, 4);
|
||||
remove(credGroup);
|
||||
skippedIntro = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
package;
|
||||
|
||||
import flixel.FlxG;
|
||||
import flixel.FlxSprite;
|
||||
import flixel.FlxState;
|
||||
import flixel.addons.display.FlxGridOverlay;
|
||||
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.addons.transition.TransitionData;
|
||||
import flixel.graphics.FlxGraphic;
|
||||
import flixel.graphics.frames.FlxAtlasFrames;
|
||||
import flixel.group.FlxGroup;
|
||||
import flixel.input.gamepad.FlxGamepad;
|
||||
import flixel.math.FlxPoint;
|
||||
import flixel.math.FlxRect;
|
||||
import flixel.system.FlxSound;
|
||||
import flixel.system.ui.FlxSoundTray;
|
||||
import flixel.text.FlxText;
|
||||
import flixel.tweens.FlxEase;
|
||||
import flixel.tweens.FlxTween;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.util.FlxTimer;
|
||||
import io.newgrounds.NG;
|
||||
import lime.app.Application;
|
||||
import openfl.Assets;
|
||||
|
||||
#if windows
|
||||
import Discord.DiscordClient;
|
||||
#end
|
||||
|
||||
#if cpp
|
||||
import sys.thread.Thread;
|
||||
#end
|
||||
|
||||
using StringTools;
|
||||
|
||||
class TitleState extends MusicBeatState
|
||||
{
|
||||
static var initialized:Bool = false;
|
||||
|
||||
var blackScreen:FlxSprite;
|
||||
var credGroup:FlxGroup;
|
||||
var credTextShit:Alphabet;
|
||||
var textGroup:FlxGroup;
|
||||
var ngSpr:FlxSprite;
|
||||
|
||||
var curWacky:Array<String> = [];
|
||||
|
||||
var wackyImage:FlxSprite;
|
||||
|
||||
override public function create():Void
|
||||
{
|
||||
#if polymod
|
||||
polymod.Polymod.init({modRoot: "mods", dirs: ['introMod']});
|
||||
#end
|
||||
|
||||
#if sys
|
||||
if (!sys.FileSystem.exists(Sys.getCwd() + "/assets/replays"))
|
||||
sys.FileSystem.createDirectory(Sys.getCwd() + "/assets/replays");
|
||||
#end
|
||||
|
||||
@:privateAccess
|
||||
{
|
||||
trace("Loaded " + openfl.Assets.getLibrary("default").assetsLoaded + " assets (DEFAULT)");
|
||||
}
|
||||
|
||||
PlayerSettings.init();
|
||||
|
||||
#if windows
|
||||
DiscordClient.initialize();
|
||||
|
||||
Application.current.onExit.add (function (exitCode) {
|
||||
DiscordClient.shutdown();
|
||||
});
|
||||
|
||||
#end
|
||||
|
||||
curWacky = FlxG.random.getObject(getIntroTextShit());
|
||||
|
||||
// DEBUG BULLSHIT
|
||||
|
||||
super.create();
|
||||
|
||||
// NGio.noLogin(APIStuff.API);
|
||||
|
||||
#if ng
|
||||
var ng:NGio = new NGio(APIStuff.API, APIStuff.EncKey);
|
||||
trace('NEWGROUNDS LOL');
|
||||
#end
|
||||
|
||||
FlxG.save.bind('funkin', 'ninjamuffin99');
|
||||
|
||||
KadeEngineData.initSave();
|
||||
|
||||
Highscore.load();
|
||||
|
||||
if (FlxG.save.data.weekUnlocked != null)
|
||||
{
|
||||
// FIX LATER!!!
|
||||
// WEEK UNLOCK PROGRESSION!!
|
||||
// StoryMenuState.weekUnlocked = FlxG.save.data.weekUnlocked;
|
||||
|
||||
if (StoryMenuState.weekUnlocked.length < 4)
|
||||
StoryMenuState.weekUnlocked.insert(0, true);
|
||||
|
||||
// QUICK PATCH OOPS!
|
||||
if (!StoryMenuState.weekUnlocked[0])
|
||||
StoryMenuState.weekUnlocked[0] = true;
|
||||
}
|
||||
|
||||
#if FREEPLAY
|
||||
FlxG.switchState(new FreeplayState());
|
||||
#elseif CHARTING
|
||||
FlxG.switchState(new ChartingState());
|
||||
#else
|
||||
new FlxTimer().start(1, function(tmr:FlxTimer)
|
||||
{
|
||||
startIntro();
|
||||
});
|
||||
#end
|
||||
}
|
||||
|
||||
var logoBl:FlxSprite;
|
||||
var gfDance:FlxSprite;
|
||||
var danceLeft:Bool = false;
|
||||
var titleText:FlxSprite;
|
||||
|
||||
function startIntro()
|
||||
{
|
||||
if (!initialized)
|
||||
{
|
||||
var diamond:FlxGraphic = FlxGraphic.fromClass(GraphicTransTileDiamond);
|
||||
diamond.persist = true;
|
||||
diamond.destroyOnNoUse = false;
|
||||
|
||||
FlxTransitionableState.defaultTransIn = new TransitionData(FADE, FlxColor.BLACK, 1, new FlxPoint(0, -1), {asset: diamond, width: 32, height: 32},
|
||||
new FlxRect(-200, -200, FlxG.width * 1.4, FlxG.height * 1.4));
|
||||
FlxTransitionableState.defaultTransOut = new TransitionData(FADE, FlxColor.BLACK, 0.7, new FlxPoint(0, 1),
|
||||
{asset: diamond, width: 32, height: 32}, new FlxRect(-200, -200, FlxG.width * 1.4, FlxG.height * 1.4));
|
||||
|
||||
transIn = FlxTransitionableState.defaultTransIn;
|
||||
transOut = FlxTransitionableState.defaultTransOut;
|
||||
|
||||
// HAD TO MODIFY SOME BACKEND SHIT
|
||||
// IF THIS PR IS HERE IF ITS ACCEPTED UR GOOD TO GO
|
||||
// https://github.com/HaxeFlixel/flixel-addons/pull/348
|
||||
|
||||
// var music:FlxSound = new FlxSound();
|
||||
// music.loadStream(Paths.music('freakyMenu'));
|
||||
// FlxG.sound.list.add(music);
|
||||
// music.play();
|
||||
FlxG.sound.playMusic(Paths.music('freakyMenu'), 0);
|
||||
|
||||
FlxG.sound.music.fadeIn(4, 0, 0.7);
|
||||
}
|
||||
|
||||
Conductor.changeBPM(102);
|
||||
persistentUpdate = true;
|
||||
|
||||
var bg:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
||||
// bg.antialiasing = true;
|
||||
// bg.setGraphicSize(Std.int(bg.width * 0.6));
|
||||
// bg.updateHitbox();
|
||||
add(bg);
|
||||
|
||||
logoBl = new FlxSprite(-150, -100);
|
||||
logoBl.frames = Paths.getSparrowAtlas('logoBumpin');
|
||||
logoBl.antialiasing = true;
|
||||
logoBl.animation.addByPrefix('bump', 'logo bumpin', 24);
|
||||
logoBl.animation.play('bump');
|
||||
logoBl.updateHitbox();
|
||||
// logoBl.screenCenter();
|
||||
// logoBl.color = FlxColor.BLACK;
|
||||
|
||||
gfDance = new FlxSprite(FlxG.width * 0.4, FlxG.height * 0.07);
|
||||
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;
|
||||
add(gfDance);
|
||||
add(logoBl);
|
||||
|
||||
titleText = new FlxSprite(100, FlxG.height * 0.8);
|
||||
titleText.frames = Paths.getSparrowAtlas('titleEnter');
|
||||
titleText.animation.addByPrefix('idle', "Press Enter to Begin", 24);
|
||||
titleText.animation.addByPrefix('press', "ENTER PRESSED", 24);
|
||||
titleText.antialiasing = true;
|
||||
titleText.animation.play('idle');
|
||||
titleText.updateHitbox();
|
||||
// titleText.screenCenter(X);
|
||||
add(titleText);
|
||||
|
||||
var logo:FlxSprite = new FlxSprite().loadGraphic(Paths.image('logo'));
|
||||
logo.screenCenter();
|
||||
logo.antialiasing = true;
|
||||
// add(logo);
|
||||
|
||||
// FlxTween.tween(logoBl, {y: logoBl.y + 50}, 0.6, {ease: FlxEase.quadInOut, type: PINGPONG});
|
||||
// FlxTween.tween(logo, {y: logoBl.y + 50}, 0.6, {ease: FlxEase.quadInOut, type: PINGPONG, startDelay: 0.1});
|
||||
|
||||
credGroup = new FlxGroup();
|
||||
add(credGroup);
|
||||
textGroup = new FlxGroup();
|
||||
|
||||
blackScreen = new FlxSprite().makeGraphic(FlxG.width, FlxG.height, FlxColor.BLACK);
|
||||
credGroup.add(blackScreen);
|
||||
|
||||
credTextShit = new Alphabet(0, 0, "ninjamuffin99\nPhantomArcade\nkawaisprite\nevilsk8er", true);
|
||||
credTextShit.screenCenter();
|
||||
|
||||
// credTextShit.alignment = CENTER;
|
||||
|
||||
credTextShit.visible = false;
|
||||
|
||||
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));
|
||||
ngSpr.updateHitbox();
|
||||
ngSpr.screenCenter(X);
|
||||
ngSpr.antialiasing = true;
|
||||
|
||||
FlxTween.tween(credTextShit, {y: credTextShit.y + 20}, 2.9, {ease: FlxEase.quadInOut, type: PINGPONG});
|
||||
|
||||
FlxG.mouse.visible = false;
|
||||
|
||||
if (initialized)
|
||||
skipIntro();
|
||||
else
|
||||
initialized = true;
|
||||
|
||||
// credGroup.add(credTextShit);
|
||||
}
|
||||
|
||||
function getIntroTextShit():Array<Array<String>>
|
||||
{
|
||||
var fullText:String = Assets.getText(Paths.txt('introText'));
|
||||
|
||||
var firstArray:Array<String> = fullText.split('\n');
|
||||
var swagGoodArray:Array<Array<String>> = [];
|
||||
|
||||
for (i in firstArray)
|
||||
{
|
||||
swagGoodArray.push(i.split('--'));
|
||||
}
|
||||
|
||||
return swagGoodArray;
|
||||
}
|
||||
|
||||
var transitioning:Bool = false;
|
||||
|
||||
override function update(elapsed:Float)
|
||||
{
|
||||
if (FlxG.sound.music != null)
|
||||
Conductor.songPosition = FlxG.sound.music.time;
|
||||
// FlxG.watch.addQuick('amp', FlxG.sound.music.amplitude);
|
||||
|
||||
if (FlxG.keys.justPressed.F)
|
||||
{
|
||||
FlxG.fullscreen = !FlxG.fullscreen;
|
||||
}
|
||||
|
||||
var pressedEnter:Bool = FlxG.keys.justPressed.ENTER;
|
||||
|
||||
#if mobile
|
||||
for (touch in FlxG.touches.list)
|
||||
{
|
||||
if (touch.justPressed)
|
||||
{
|
||||
pressedEnter = true;
|
||||
}
|
||||
}
|
||||
#end
|
||||
|
||||
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
|
||||
|
||||
if (gamepad != null)
|
||||
{
|
||||
if (gamepad.justPressed.START)
|
||||
pressedEnter = true;
|
||||
|
||||
#if switch
|
||||
if (gamepad.justPressed.B)
|
||||
pressedEnter = true;
|
||||
#end
|
||||
}
|
||||
|
||||
if (pressedEnter && !transitioning && skippedIntro)
|
||||
{
|
||||
#if !switch
|
||||
NGio.unlockMedal(60960);
|
||||
|
||||
// If it's Friday according to da clock
|
||||
if (Date.now().getDay() == 5)
|
||||
NGio.unlockMedal(61034);
|
||||
#end
|
||||
|
||||
if (FlxG.save.data.flashing)
|
||||
titleText.animation.play('press');
|
||||
|
||||
FlxG.camera.flash(FlxColor.WHITE, 1);
|
||||
FlxG.sound.play(Paths.sound('confirmMenu'), 0.7);
|
||||
|
||||
transitioning = true;
|
||||
// FlxG.sound.music.stop();
|
||||
|
||||
new FlxTimer().start(2, function(tmr:FlxTimer)
|
||||
{
|
||||
// Get current version of Kade Engine
|
||||
|
||||
//var http = new haxe.Http("https://raw.githubusercontent.com/KadeDev/Kade-Engine/master/version.downloadMe");
|
||||
var http = new haxe.Http("https://raw.githubusercontent.com/KadeDev/Kade-Engine/patchnotes/version.downloadMe");
|
||||
var returnedData:Array<String> = [];
|
||||
|
||||
http.onData = function (data:String)
|
||||
{
|
||||
returnedData[0] = data.substring(0, data.indexOf(';'));
|
||||
returnedData[1] = data.substring(data.indexOf('-'), data.length);
|
||||
if (!MainMenuState.kadeEngineVer.contains(returnedData[0].trim()) && !OutdatedSubState.leftState && MainMenuState.nightly == "")
|
||||
{
|
||||
trace('outdated lmao! ' + returnedData[0] + ' != ' + MainMenuState.kadeEngineVer);
|
||||
OutdatedSubState.needVer = returnedData[0];
|
||||
OutdatedSubState.currChanges = returnedData[1];
|
||||
FlxG.switchState(new OutdatedSubState());
|
||||
}
|
||||
else
|
||||
{
|
||||
FlxG.switchState(new MainMenuState());
|
||||
}
|
||||
}
|
||||
|
||||
http.onError = function (error) {
|
||||
trace('error: $error');
|
||||
FlxG.switchState(new MainMenuState()); // fail but we go anyway
|
||||
}
|
||||
|
||||
http.request();
|
||||
});
|
||||
// FlxG.sound.play(Paths.music('titleShoot'), 0.7);
|
||||
}
|
||||
|
||||
if (pressedEnter && !skippedIntro && initialized)
|
||||
{
|
||||
skipIntro();
|
||||
}
|
||||
|
||||
super.update(elapsed);
|
||||
}
|
||||
|
||||
function createCoolText(textArray:Array<String>)
|
||||
{
|
||||
for (i in 0...textArray.length)
|
||||
{
|
||||
var money:Alphabet = new Alphabet(0, 0, textArray[i], true, false);
|
||||
money.screenCenter(X);
|
||||
money.y += (i * 60) + 200;
|
||||
credGroup.add(money);
|
||||
textGroup.add(money);
|
||||
}
|
||||
}
|
||||
|
||||
function addMoreText(text:String)
|
||||
{
|
||||
var coolText:Alphabet = new Alphabet(0, 0, text, true, false);
|
||||
coolText.screenCenter(X);
|
||||
coolText.y += (textGroup.length * 60) + 200;
|
||||
credGroup.add(coolText);
|
||||
textGroup.add(coolText);
|
||||
}
|
||||
|
||||
function deleteCoolText()
|
||||
{
|
||||
while (textGroup.members.length > 0)
|
||||
{
|
||||
credGroup.remove(textGroup.members[0], true);
|
||||
textGroup.remove(textGroup.members[0], true);
|
||||
}
|
||||
}
|
||||
|
||||
override function beatHit()
|
||||
{
|
||||
super.beatHit();
|
||||
|
||||
logoBl.animation.play('bump');
|
||||
danceLeft = !danceLeft;
|
||||
|
||||
if (danceLeft)
|
||||
gfDance.animation.play('danceRight');
|
||||
else
|
||||
gfDance.animation.play('danceLeft');
|
||||
|
||||
FlxG.log.add(curBeat);
|
||||
|
||||
switch (curBeat)
|
||||
{
|
||||
case 1:
|
||||
createCoolText(['ninjamuffin99', 'phantomArcade', 'kawaisprite', 'evilsk8er']);
|
||||
// credTextShit.visible = true;
|
||||
case 3:
|
||||
addMoreText('present');
|
||||
// credTextShit.text += '\npresent...';
|
||||
// credTextShit.addText();
|
||||
case 4:
|
||||
deleteCoolText();
|
||||
// credTextShit.visible = false;
|
||||
// credTextShit.text = 'In association \nwith';
|
||||
// credTextShit.screenCenter();
|
||||
case 5:
|
||||
if (Main.watermarks)
|
||||
createCoolText(['Kade Engine', 'by']);
|
||||
else
|
||||
createCoolText(['In Partnership', 'with']);
|
||||
case 7:
|
||||
if (Main.watermarks)
|
||||
addMoreText('KadeDeveloper');
|
||||
else
|
||||
{
|
||||
addMoreText('Newgrounds');
|
||||
ngSpr.visible = true;
|
||||
}
|
||||
// credTextShit.text += '\nNewgrounds';
|
||||
case 8:
|
||||
deleteCoolText();
|
||||
ngSpr.visible = false;
|
||||
// credTextShit.visible = false;
|
||||
|
||||
// credTextShit.text = 'Shoutouts Tom Fulp';
|
||||
// credTextShit.screenCenter();
|
||||
case 9:
|
||||
createCoolText([curWacky[0]]);
|
||||
// credTextShit.visible = true;
|
||||
case 11:
|
||||
addMoreText(curWacky[1]);
|
||||
// credTextShit.text += '\nlmao';
|
||||
case 12:
|
||||
deleteCoolText();
|
||||
// credTextShit.visible = false;
|
||||
// credTextShit.text = "Friday";
|
||||
// credTextShit.screenCenter();
|
||||
case 13:
|
||||
addMoreText('Friday');
|
||||
// credTextShit.visible = true;
|
||||
case 14:
|
||||
addMoreText('Night');
|
||||
// credTextShit.text += '\nNight';
|
||||
case 15:
|
||||
addMoreText('Funkin'); // credTextShit.text += '\nFunkin';
|
||||
|
||||
case 16:
|
||||
skipIntro();
|
||||
}
|
||||
}
|
||||
|
||||
var skippedIntro:Bool = false;
|
||||
|
||||
function skipIntro():Void
|
||||
{
|
||||
if (!skippedIntro)
|
||||
{
|
||||
remove(ngSpr);
|
||||
|
||||
FlxG.camera.flash(FlxColor.WHITE, 4);
|
||||
remove(credGroup);
|
||||
skippedIntro = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user