From 33e236fd4578d115097947130e2e213fb4114ff2 Mon Sep 17 00:00:00 2001 From: KadeDev Date: Fri, 2 Apr 2021 14:44:15 -0700 Subject: [PATCH 1/5] the funny commit --- source/Discord.hx | 5 +++++ source/MusicBeatState.hx | 5 +++++ source/OptionsMenu.hx | 19 +++++++++++++------ source/TitleState.hx | 5 +++++ 4 files changed, 28 insertions(+), 6 deletions(-) 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/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/OptionsMenu.hx b/source/OptionsMenu.hx index 5b4ca64..400c271 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); @@ -149,23 +156,23 @@ class OptionsMenu extends MusicBeatState versionShit.text = "Current Scroll Speed: " + FlxG.save.data.scrollSpeed + " - 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/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()); From aa054a828c061f7b24b04584dff09d6e2bb6cc51 Mon Sep 17 00:00:00 2001 From: KadeDev Date: Fri, 2 Apr 2021 16:49:02 -0700 Subject: [PATCH 2/5] I have embraced modding --- assets/preload/data/freeplaySonglist.txt | 20 +++++++++++++++++++- source/FreeplayState.hx | 13 ++----------- source/Options.hx | 4 ++-- source/PlayState.hx | 10 ++++++---- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/assets/preload/data/freeplaySonglist.txt b/assets/preload/data/freeplaySonglist.txt index 1b5bac2..16938e3 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 +Bopeebo:dad +Fresh:dad +Dadbattle:dad +Spookeez:spooky +South:spooky +Monster:monster +Pico:pico +Philly:pico +Blammed:pico +Satin-Panties:mom +High:mom +Milf:mom +Cocoa:parents-christmas +Eggnog:parents-christmas +Winter-Horrorland:monster-christmas +Senpai:senpai +Roses:senpai +Thorns:spirit \ No newline at end of file diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index f622cb7..c051894 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], 1, 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/Options.hx b/source/Options.hx index db8d4b1..c8f5a2e 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -329,9 +329,9 @@ 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; diff --git a/source/PlayState.hx b/source/PlayState.hx index 6079db3..702cf49 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,7 +1969,7 @@ class PlayState extends MusicBeatState #end } - if (SONG.song.contains('offsetTest')) + if (offsetTesting) { FlxG.sound.playMusic(Paths.music('freakyMenu')); LoadingState.loadAndSwitchState(new OptionsMenu()); @@ -2169,7 +2171,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(); From 8a95be0b5f3aa4b25e047ec44c4e79690f68b59c Mon Sep 17 00:00:00 2001 From: KadeDev Date: Fri, 2 Apr 2021 16:51:32 -0700 Subject: [PATCH 3/5] oops --- assets/preload/data/freeplaySonglist.txt | 38 ++++++++++++------------ source/FreeplayState.hx | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/assets/preload/data/freeplaySonglist.txt b/assets/preload/data/freeplaySonglist.txt index 16938e3..123e8a3 100644 --- a/assets/preload/data/freeplaySonglist.txt +++ b/assets/preload/data/freeplaySonglist.txt @@ -1,19 +1,19 @@ -Tutorial:gf -Bopeebo:dad -Fresh:dad -Dadbattle:dad -Spookeez:spooky -South:spooky -Monster:monster -Pico:pico -Philly:pico -Blammed:pico -Satin-Panties:mom -High:mom -Milf:mom -Cocoa:parents-christmas -Eggnog:parents-christmas -Winter-Horrorland:monster-christmas -Senpai:senpai -Roses:senpai -Thorns:spirit \ 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/FreeplayState.hx b/source/FreeplayState.hx index c051894..22be5c9 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -42,7 +42,7 @@ class FreeplayState extends MusicBeatState for (i in 0...initSonglist.length) { var data:Array = initSonglist[i].split(':'); - songs.push(new SongMetadata(data[0], 1, data[1])); + songs.push(new SongMetadata(data[0], data[2], data[1])); } /* From 59287835205463cc3cf455857e01f83993e2f3f2 Mon Sep 17 00:00:00 2001 From: KadeDev Date: Fri, 2 Apr 2021 17:21:19 -0700 Subject: [PATCH 4/5] version update and fixes --- source/FreeplayState.hx | 2 +- source/MainMenuState.hx | 4 ++-- source/Options.hx | 1 + source/OptionsMenu.hx | 11 ++++++----- source/PauseSubState.hx | 8 +++++++- source/PlayState.hx | 1 + version.downloadMe | 2 +- 7 files changed, 19 insertions(+), 10 deletions(-) diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 22be5c9..145f2fc 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -42,7 +42,7 @@ class FreeplayState extends MusicBeatState for (i in 0...initSonglist.length) { var data:Array = initSonglist[i].split(':'); - songs.push(new SongMetadata(data[0], data[2], data[1])); + songs.push(new SongMetadata(data[0], Std.parseInt(data[2]), data[1])); } /* 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/Options.hx b/source/Options.hx index c8f5a2e..f4e6e20 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -335,6 +335,7 @@ class OffsetMenu extends Option 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 400c271..35af037 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -140,20 +140,21 @@ 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.01; 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 702cf49..762695d 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -1972,6 +1972,7 @@ class PlayState extends MusicBeatState if (offsetTesting) { FlxG.sound.playMusic(Paths.music('freakyMenu')); + offsetTesting = false; LoadingState.loadAndSwitchState(new OptionsMenu()); FlxG.save.data.offset = offsetTest; } 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 From cef2cbde05c946397635b66bffa99c80544d68b4 Mon Sep 17 00:00:00 2001 From: KadeDev Date: Fri, 2 Apr 2021 17:48:21 -0700 Subject: [PATCH 5/5] offset fix (boutta killa a contributer) --- source/Note.hx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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;