From 2bd4a91e7e5bc66ab0db9f5bf62bf4cc7c2b5491 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Fri, 10 Sep 2021 10:07:55 -0400 Subject: [PATCH] odds and ends --- source/FreeplayState.hx | 13 ++++++++++++- source/InitState.hx | 17 ++++++++++------- source/PlayState.hx | 5 ++++- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 3e0138f37..8bb266e29 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -98,7 +98,7 @@ class FreeplayState extends MusicBeatState if (StoryMenuState.weekUnlocked[7] || isDebug) addWeek(['Ugh', 'Guns', 'Stress'], 7, ['tankman']); - // addWeek(["Darnell"], 8, ['darnell']); + addWeek(["Darnell"], 8, ['darnell']); // LOAD MUSIC @@ -362,7 +362,18 @@ class FreeplayState extends MusicBeatState if (accepted) { + // if (Assets.exists()) + var poop:String = Highscore.formatSong(songs[curSelected].songName.toLowerCase(), curDifficulty); + + if (!Assets.exists(Paths.json(songs[curSelected].songName + '/' + poop))) + { + // defaults to normal if HARD / EASY doesn't exist + // does not account if NORMAL doesn't exist! + FlxG.log.warn("CURRENT DIFFICULTY IS NOT CHARTED, DEFAULTING TO NORMAL!"); + poop = Highscore.formatSong(songs[curSelected].songName.toLowerCase(), 1); + curDifficulty = 1; + } PlayState.SONG = Song.loadFromJson(poop, songs[curSelected].songName.toLowerCase()); PlayState.isStoryMode = false; PlayState.storyDifficulty = curDifficulty; diff --git a/source/InitState.hx b/source/InitState.hx index d84954325..949b17930 100644 --- a/source/InitState.hx +++ b/source/InitState.hx @@ -11,6 +11,8 @@ import openfl.display.BitmapData; import ui.PreferencesMenu; import ui.stageBuildShit.StageBuilderState; +using StringTools; + #if colyseus import io.colyseus.Client; import io.colyseus.Room; @@ -24,8 +26,6 @@ import sys.io.File; import sys.thread.Thread; #end -using StringTools; - class InitState extends FlxTransitionableState { override public function create():Void @@ -39,15 +39,18 @@ class InitState extends FlxTransitionableState #if discord_rpc DiscordClient.initialize(); - Application.current.onExit.add(function(exitCode){ + Application.current.onExit.add(function(exitCode) + { DiscordClient.shutdown(); }); #end - // ==== flixel shit ==== // - FlxG.debugger.addButton(LEFT, new BitmapData(200, 200), function(){ + // This big obnoxious white button is for MOBILE, so that you can press it + // easily with your finger when debug bullshit pops up during testing lol! + FlxG.debugger.addButton(LEFT, new BitmapData(200, 200), function() + { FlxG.debugger.visible = false; }); @@ -63,8 +66,8 @@ class InitState extends FlxTransitionableState 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)); + 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)); // ===== save shit ===== // diff --git a/source/PlayState.hx b/source/PlayState.hx index d8e25034d..188f3c993 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -506,7 +506,7 @@ class PlayState extends MusicBeatState var fgTank3:BGSprite = new BGSprite('tank3', 1300, 1200, 3.5, 2.5, ['fg']); foregroundSprites.add(fgTank3); - case "week8Lol": + case "darnell": loadStage('phillyStreets'); default: @@ -1922,6 +1922,9 @@ class PlayState extends MusicBeatState #end } + if (FlxG.keys.justPressed.EIGHT) + FlxG.switchState(new ui.animDebugShit.DebugBoundingState()); + if (FlxG.keys.justPressed.NINE) iconP1.swapOldIcon();