diff --git a/assets/preload/data/freeplaySonglist.txt b/assets/preload/data/freeplaySonglist.txt index 1b5bac2..123e8a3 100644 --- a/assets/preload/data/freeplaySonglist.txt +++ b/assets/preload/data/freeplaySonglist.txt @@ -1 +1,19 @@ -Tutorial \ No newline at end of file +Tutorial:gf:1 +Bopeebo:dad:1 +Fresh:dad:1 +Dadbattle:dad:1 +Spookeez:spooky:2 +South:spooky:2 +Monster:monster:2 +Pico:pico:3 +Philly:pico:3 +Blammed:pico:3 +Satin-Panties:mom:4 +High:mom:4 +Milf:mom:4 +Cocoa:parents-christmas:5 +Eggnog:parents-christmas:5 +Winter-Horrorland:monster-christmas:5 +Senpai:senpai:6 +Roses:senpai:6 +Thorns:spirit:6 \ No newline at end of file diff --git a/source/Discord.hx b/source/Discord.hx index 9d5b103..5dc9c64 100644 --- a/source/Discord.hx +++ b/source/Discord.hx @@ -28,6 +28,11 @@ class DiscordClient DiscordRpc.shutdown(); } + public static function shutdown() + { + DiscordRpc.shutdown(); + } + static function onReady() { DiscordRpc.presence({ diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index f622cb7..145f2fc 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -41,7 +41,8 @@ class FreeplayState extends MusicBeatState for (i in 0...initSonglist.length) { - songs.push(new SongMetadata(initSonglist[i], 1, 'gf')); + var data:Array = initSonglist[i].split(':'); + songs.push(new SongMetadata(data[0], Std.parseInt(data[2]), data[1])); } /* @@ -63,15 +64,6 @@ class FreeplayState extends MusicBeatState isDebug = true; #end - addWeek(['Bopeebo', 'Fresh', 'Dadbattle'], 1, ['dad']); - addWeek(['Spookeez', 'South', 'Monster'], 2, ['spooky', 'spooky', 'monster']); - addWeek(['Pico', 'Philly', 'Blammed'], 3, ['pico']); - - addWeek(['Satin-Panties', 'High', 'Milf'], 4, ['mom']); - addWeek(['Cocoa', 'Eggnog', 'Winter-Horrorland'], 5, ['parents-christmas', 'parents-christmas', 'monster-christmas']); - - addWeek(['Senpai', 'Roses', 'Thorns'], 6, ['senpai', 'senpai', 'spirit']); - // LOAD MUSIC // LOAD CHARACTERS @@ -271,7 +263,6 @@ class FreeplayState extends MusicBeatState #end #if PRELOAD_ALL - Conductor.changeBPM(Song.loadFromJson(Highscore.formatSong(songs[curSelected].songName,0),songs[curSelected].songName.toLowerCase()).bpm); FlxG.sound.playMusic(Paths.inst(songs[curSelected].songName), 0); #end diff --git a/source/MainMenuState.hx b/source/MainMenuState.hx index cfb1236..fb24034 100644 --- a/source/MainMenuState.hx +++ b/source/MainMenuState.hx @@ -36,9 +36,9 @@ class MainMenuState extends MusicBeatState var newGaming2:FlxText; var newInput:Bool = true; - public static var nightly:String = "-Nightly.3"; + public static var nightly:String = ""; - public static var kadeEngineVer:String = "1.3.1" + nightly; + public static var kadeEngineVer:String = "1.4" + nightly; public static var gameVer:String = "0.2.7.1"; var magenta:FlxSprite; diff --git a/source/MusicBeatState.hx b/source/MusicBeatState.hx index afe4f3f..3900654 100644 --- a/source/MusicBeatState.hx +++ b/source/MusicBeatState.hx @@ -1,5 +1,6 @@ package; +import Discord.DiscordClient; import flixel.tweens.FlxTween; import flixel.util.FlxColor; import openfl.Lib; @@ -32,6 +33,7 @@ class MusicBeatState extends FlxUIState super.create(); } + var array:Array = [ FlxColor.fromRGB(148, 0, 211), FlxColor.fromRGB(75, 0, 130), @@ -66,6 +68,9 @@ class MusicBeatState extends FlxUIState else skippedFrames++; + if ((cast (Lib.current.getChildAt(0), Main)).getFPSCap != FlxG.save.data.fpsCap) + (cast (Lib.current.getChildAt(0), Main)).setFPSCap(FlxG.save.data.fpsCap); + super.update(elapsed); } diff --git a/source/Note.hx b/source/Note.hx index c5de613..fa88315 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -48,7 +48,10 @@ class Note extends FlxSprite x += 50; // MAKE SURE ITS DEFINITELY OFF SCREEN? y -= 2000; - this.strumTime = strumTime; + this.strumTime = strumTime + FlxG.save.data.offset; + + if (this.strumTime < 0 ) + this.strumTime = 0; this.noteData = noteData; diff --git a/source/Options.hx b/source/Options.hx index db8d4b1..f4e6e20 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -329,12 +329,13 @@ class OffsetMenu extends Option public override function press():Bool { trace("switch"); - var poop:String = Highscore.formatSong("offsetTest", 1); + var poop:String = Highscore.formatSong("Tutorial", 1); - PlayState.SONG = Song.loadFromJson(poop, "offsetTest"); + PlayState.SONG = Song.loadFromJson(poop, "Tutorial"); PlayState.isStoryMode = false; PlayState.storyDifficulty = 0; PlayState.storyWeek = 0; + PlayState.offsetTesting = true; trace('CUR WEEK' + PlayState.storyWeek); LoadingState.loadAndSwitchState(new PlayState()); return false; diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 5b4ca64..35af037 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -84,6 +84,13 @@ class OptionsMenu extends MusicBeatState var isCat:Bool = false; + function truncateFloat( number : Float, precision : Int): Float { + var num = number; + num = num * Math.pow(10, precision); + num = Math.round( num ) / Math.pow(10, precision); + return num; + } + override function update(elapsed:Float) { super.update(elapsed); @@ -133,39 +140,40 @@ class OptionsMenu extends MusicBeatState case 'Scroll Speed': if (FlxG.keys.justPressed.RIGHT) - FlxG.save.data.scrollSpeed+=0.1; + FlxG.save.data.scrollSpeed += 0.1; if (FlxG.keys.justPressed.LEFT) - FlxG.save.data.scrollSpeed-=0.1; + FlxG.save.data.scrollSpeed -= 0.1; // caps - if (FlxG.save.data.scrollSpeed < 0) - FlxG.save.data.scrollSpeed = 0.1; + if (FlxG.save.data.scrollSpeed < 1) + FlxG.save.data.scrollSpeed = 1; if (FlxG.save.data.scrollSpeed > 10) FlxG.save.data.scrollSpeed = 10; - versionShit.text = "Current Scroll Speed: " + FlxG.save.data.scrollSpeed + " - Description - " + currentDescription; + + versionShit.text = "Current Scroll Speed: " + truncateFloat(FlxG.save.data.scrollSpeed,1) + " - Description - " + currentDescription; default: if (FlxG.keys.pressed.RIGHT) - FlxG.save.data.offset += 0.1; + FlxG.save.data.offset += 0.01; if (FlxG.keys.pressed.LEFT) - FlxG.save.data.offset -= 0.1; + FlxG.save.data.offset -= 0.01; - versionShit.text = "Offset (Left, Right): " + FlxG.save.data.offset + " - Description - " + currentDescription; + versionShit.text = "Offset (Left, Right): " + truncateFloat(FlxG.save.data.offset,2) + " - Description - " + currentDescription; } } else { if (FlxG.keys.pressed.RIGHT) - FlxG.save.data.offset++; + FlxG.save.data.offset+= 0.01; if (FlxG.keys.pressed.LEFT) - FlxG.save.data.offset--; + FlxG.save.data.offset-= 0.01; - versionShit.text = "Offset (Left, Right): " + FlxG.save.data.offset + " - Description - " + currentDescription; + versionShit.text = "Offset (Left, Right): " + truncateFloat(FlxG.save.data.offset,2) + " - Description - " + currentDescription; } diff --git a/source/PauseSubState.hx b/source/PauseSubState.hx index 11df85a..fa7dbf3 100644 --- a/source/PauseSubState.hx +++ b/source/PauseSubState.hx @@ -109,7 +109,13 @@ class PauseSubState extends MusicBeatSubstate FlxG.resetState(); case "Exit to menu": PlayState.loadRep = false; - FlxG.switchState(new MainMenuState()); + if (PlayState.offsetTesting) + { + PlayState.offsetTesting = false; + FlxG.switchState(new OptionsMenu()); + } + else + FlxG.switchState(new MainMenuState()); } } diff --git a/source/PlayState.hx b/source/PlayState.hx index 6079db3..762695d 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -124,6 +124,8 @@ class PlayState extends MusicBeatState private var camHUD:FlxCamera; private var camGame:FlxCamera; + public static var offsetTesting:Bool = false; + var notesHitArray:Array = []; var currentFrames:Int = 0; @@ -827,7 +829,7 @@ class PlayState extends MusicBeatState scoreTxt.x = healthBarBG.x + healthBarBG.width / 2; scoreTxt.setFormat(Paths.font("vcr.ttf"), 16, FlxColor.WHITE, CENTER, FlxTextBorderStyle.OUTLINE,FlxColor.BLACK); scoreTxt.scrollFactor.set(); - if (SONG.song.contains('offsetTest')) + if (offsetTesting) scoreTxt.x += 300; add(scoreTxt); @@ -1609,7 +1611,7 @@ class PlayState extends MusicBeatState super.update(elapsed); - if (!SONG.song.contains('offsetTest')) + if (!offsetTesting) { if (FlxG.save.data.accuracyDisplay) { @@ -1967,9 +1969,10 @@ class PlayState extends MusicBeatState #end } - if (SONG.song.contains('offsetTest')) + if (offsetTesting) { FlxG.sound.playMusic(Paths.music('freakyMenu')); + offsetTesting = false; LoadingState.loadAndSwitchState(new OptionsMenu()); FlxG.save.data.offset = offsetTest; } @@ -2169,7 +2172,7 @@ class PlayState extends MusicBeatState currentTimingShown.text = msTiming + "ms"; currentTimingShown.size = 20; - if (msTiming >= 0.03 && SONG.song.contains('offsetTest')) + if (msTiming >= 0.03 && offsetTesting) { //Remove Outliers hits.shift(); diff --git a/source/TitleState.hx b/source/TitleState.hx index a8515b5..ec98454 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -61,6 +61,11 @@ class TitleState extends MusicBeatState #if desktop DiscordClient.initialize(); + + Application.current.onExit.add (function (exitCode) { + DiscordClient.shutdown(); + }); + #end curWacky = FlxG.random.getObject(getIntroTextShit()); diff --git a/version.downloadMe b/version.downloadMe index 6261a05..840ca8c 100644 --- a/version.downloadMe +++ b/version.downloadMe @@ -1 +1 @@ -1.3.1 \ No newline at end of file +1.4 \ No newline at end of file