From b6953ec111523d0f3399bbbd98860ec83012d1f5 Mon Sep 17 00:00:00 2001 From: Lucky56 <55949451+Lucky-56@users.noreply.github.com> Date: Thu, 17 Jun 2021 18:02:20 +0200 Subject: [PATCH 01/22] brought back the week locking --- source/KadeEngineData.hx | 5 ++++- source/Options.hx | 22 ++++++++++++++++++++++ source/OptionsMenu.hx | 5 +++++ source/PlayState.hx | 11 +++++++---- source/StoryMenuState.hx | 16 +++++++++++++++- source/TitleState.hx | 14 -------------- 6 files changed, 53 insertions(+), 20 deletions(-) diff --git a/source/KadeEngineData.hx b/source/KadeEngineData.hx index 39275f3..e412609 100644 --- a/source/KadeEngineData.hx +++ b/source/KadeEngineData.hx @@ -5,7 +5,10 @@ class KadeEngineData { public static function initSave() { - if (FlxG.save.data.newInput == null) + if (FlxG.save.data.weekUnlocked == null) + FlxG.save.data.weekUnlocked = 6; + + if (FlxG.save.data.newInput == null) FlxG.save.data.newInput = true; if (FlxG.save.data.downscroll == null) diff --git a/source/Options.hx b/source/Options.hx index 770568e..a3210c6 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -634,3 +634,25 @@ class CamZoomOption extends Option return "Camera Zoom " + (!FlxG.save.data.camzoom ? "off" : "on"); } } + +class LockWeeksOption extends Option +{ + public function new(desc:String) + { + super(); + description = desc; + } + public override function press():Bool + { + FlxG.save.data.weekUnlocked = 0; + StoryMenuState.weekUnlocked = [true]; + trace('Weeks Locked'); + display = updateDisplay(); + return true; + } + + private override function updateDisplay():String + { + return "Lock Weeks"; + } +} diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 03cf31c..3a46c25 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -58,6 +58,11 @@ class OptionsMenu extends MusicBeatState new FlashingLightsOption("Toggle flashing lights that can cause epileptic seizures and strain."), new WatermarkOption("Enable and disable all watermarks from the engine."), new BotPlay("Showcase your charts and mods with autoplay.") + ]), + + new OptionCategory("Saved Data", [ + new LockWeeksOption("Lock all weeks. (exept Tutorial of course)") + // TODO reset score ]) ]; diff --git a/source/PlayState.hx b/source/PlayState.hx index 2562965..d32c87e 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2576,16 +2576,19 @@ class PlayState extends MusicBeatState } #end - // if () - StoryMenuState.weekUnlocked[Std.int(Math.min(storyWeek + 1, StoryMenuState.weekUnlocked.length - 1))] = true; - if (SONG.validScore) { NGio.unlockMedal(60961); Highscore.saveWeekScore(storyWeek, campaignScore, storyDifficulty); } - FlxG.save.data.weekUnlocked = StoryMenuState.weekUnlocked; + if(storyWeek < StoryMenuState.getWeeks().length - 1 && FlxG.save.data.weekUnlocked == storyWeek) + { + StoryMenuState.weekUnlocked.push(true); + trace('Week ' + storyWeek + ' beat (Week ' + (storyWeek + 1) + ' unlocked)'); + } + + FlxG.save.data.weekUnlocked = StoryMenuState.weekUnlocked.length - 1; FlxG.save.flush(); } else diff --git a/source/StoryMenuState.hx b/source/StoryMenuState.hx index bf80753..74afeea 100644 --- a/source/StoryMenuState.hx +++ b/source/StoryMenuState.hx @@ -34,7 +34,7 @@ class StoryMenuState extends MusicBeatState ]; var curDifficulty:Int = 1; - public static var weekUnlocked:Array = [true, true, true, true, true, true, true]; + public static var weekUnlocked:Array = []; var weekCharacters:Array = [ ['', 'bf', 'gf'], @@ -72,8 +72,21 @@ class StoryMenuState extends MusicBeatState var leftArrow:FlxSprite; var rightArrow:FlxSprite; + function unlockWeeks():Array + { + var weeks:Array = [true]; + + for(i in 0...FlxG.save.data.weekUnlocked) + { + weeks.push(true); + } + return weeks; + } + override function create() { + weekUnlocked = unlockWeeks(); + #if windows // Updating Discord Rich Presence DiscordClient.changePresence("In the Story Mode Menu", null); @@ -133,6 +146,7 @@ class StoryMenuState extends MusicBeatState // Needs an offset thingie if (!weekUnlocked[i]) { + trace('locking week ' + i); var lock:FlxSprite = new FlxSprite(weekThing.width + 10 + weekThing.x); lock.frames = ui_tex; lock.animation.addByPrefix('lock', 'lock'); diff --git a/source/TitleState.hx b/source/TitleState.hx index 6b86eca..9873de2 100644 --- a/source/TitleState.hx +++ b/source/TitleState.hx @@ -94,20 +94,6 @@ class TitleState extends MusicBeatState 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 From a940187af542f9838af83adbb250350aa2ea887c Mon Sep 17 00:00:00 2001 From: Lucky56 <55949451+Lucky-56@users.noreply.github.com> Date: Thu, 17 Jun 2021 18:18:27 +0200 Subject: [PATCH 02/22] better TODO name --- source/OptionsMenu.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 3a46c25..5c450a1 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -62,7 +62,7 @@ class OptionsMenu extends MusicBeatState new OptionCategory("Saved Data", [ new LockWeeksOption("Lock all weeks. (exept Tutorial of course)") - // TODO reset score + // TODO reset score option ]) ]; From 6ebdcd4ff78c43f71e4734a57c78c42833c484dd Mon Sep 17 00:00:00 2001 From: Lucky56 <55949451+Lucky-56@users.noreply.github.com> Date: Fri, 18 Jun 2021 21:40:50 +0200 Subject: [PATCH 03/22] fix error (getWeeks() is from patch-4) --- source/PlayState.hx | 9 +-------- source/StoryMenuState.hx | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index 434f293..1228ba8 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2581,14 +2581,7 @@ class PlayState extends MusicBeatState Highscore.saveWeekScore(storyWeek, campaignScore, storyDifficulty); } - if(storyWeek < StoryMenuState.getWeeks().length - 1 && FlxG.save.data.weekUnlocked == storyWeek) - { - StoryMenuState.weekUnlocked.push(true); - trace('Week ' + storyWeek + ' beat (Week ' + (storyWeek + 1) + ' unlocked)'); - } - - FlxG.save.data.weekUnlocked = StoryMenuState.weekUnlocked.length - 1; - FlxG.save.flush(); + StoryMenuState.unlockNextWeek(storyWeek); } else { diff --git a/source/StoryMenuState.hx b/source/StoryMenuState.hx index 74afeea..5d5b20f 100644 --- a/source/StoryMenuState.hx +++ b/source/StoryMenuState.hx @@ -410,4 +410,27 @@ class StoryMenuState extends MusicBeatState intendedScore = Highscore.getWeekScore(curWeek, curDifficulty); #end } + + public static function unlockNextWeek(week:Int):Void + { + // TODO: get the weekData from class (but making it static makes it weird) + var weekData:Array = [ + ['Tutorial'], + ['Bopeebo', 'Fresh', 'Dad Battle'], + ['Spookeez', 'South', "Monster"], + ['Pico', 'Philly Nice', "Blammed"], + ['Satin Panties', "High", "Milf"], + ['Cocoa', 'Eggnog', 'Winter Horrorland'], + ['Senpai', 'Roses', 'Thorns'] + ]; + + if(week < weekData.length - 1 && FlxG.save.data.weekUnlocked == week) + { + weekUnlocked.push(true); + trace('Week ' + week + ' beat (Week ' + (week + 1) + ' unlocked)'); + } + + FlxG.save.data.weekUnlocked = weekUnlocked.length - 1; + FlxG.save.flush(); + } } From ef3e0e135e30e4f59b4cba17b31f9e944aa46e38 Mon Sep 17 00:00:00 2001 From: Lucky56 <55949451+Lucky-56@users.noreply.github.com> Date: Fri, 18 Jun 2021 21:44:05 +0200 Subject: [PATCH 04/22] renamed 'lock weeks' to 'reset story mode progress' + added reset score --- source/Options.hx | 53 ++++++++++++++++++++++++++++++++++++++++--- source/OptionsMenu.hx | 4 ++-- 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/source/Options.hx b/source/Options.hx index a3210c6..cc82e65 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -637,6 +637,8 @@ class CamZoomOption extends Option class LockWeeksOption extends Option { + var confirm:Bool = false; + public function new(desc:String) { super(); @@ -644,8 +646,14 @@ class LockWeeksOption extends Option } public override function press():Bool { - FlxG.save.data.weekUnlocked = 0; - StoryMenuState.weekUnlocked = [true]; + if(!confirm) + { + confirm = true; + display = updateDisplay(); + return true; + } + FlxG.save.data.weekUnlocked = 1; + StoryMenuState.weekUnlocked = [true, true]; trace('Weeks Locked'); display = updateDisplay(); return true; @@ -653,6 +661,45 @@ class LockWeeksOption extends Option private override function updateDisplay():String { - return "Lock Weeks"; + return confirm ? "Confirm" : "Reset Story Progression"; + } +} + +class ResetScoreOption extends Option +{ + var confirm:Bool = false; + + public function new(desc:String) + { + super(); + description = desc; + } + public override function press():Bool + { + if(!confirm) + { + confirm = true; + display = updateDisplay(); + return true; + } + FlxG.save.data.songScores = null; + for(key in Highscore.songScores.keys()) + { + Highscore.songScores[key] = 0; + } + FlxG.save.data.songCombos = null; + for(key in Highscore.songCombos.keys()) + { + Highscore.songCombos[key] = ''; + } + confirm = false; + trace('Save Data Wiped'); + display = updateDisplay(); + return true; + } + + private override function updateDisplay():String + { + return confirm ? "Confirm" : "Reset Score"; } } diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 71a82ee..c2a4446 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -61,8 +61,8 @@ class OptionsMenu extends MusicBeatState ]), new OptionCategory("Saved Data", [ - new LockWeeksOption("Lock all weeks. (exept Tutorial of course)") - // TODO reset score option + new ResetScoreOption("Reset your score on all songs and weeks."), + new LockWeeksOption("Reset your storymode progress. (only Tutorial + Week 1 is unlocked)") ]) ]; From e13318ca1398e3e5e5b5d20af07c50aa7b6067e1 Mon Sep 17 00:00:00 2001 From: Lucky56 <55949451+Lucky-56@users.noreply.github.com> Date: Fri, 18 Jun 2021 23:58:33 +0200 Subject: [PATCH 05/22] better comprehensibility --- source/Options.hx | 6 +++--- source/OptionsMenu.hx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/Options.hx b/source/Options.hx index cc82e65..3462923 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -661,7 +661,7 @@ class LockWeeksOption extends Option private override function updateDisplay():String { - return confirm ? "Confirm" : "Reset Story Progression"; + return confirm ? "Confirm Story Reset" : "Reset Story Progress"; } } @@ -691,7 +691,7 @@ class ResetScoreOption extends Option for(key in Highscore.songCombos.keys()) { Highscore.songCombos[key] = ''; - } + } confirm = false; trace('Save Data Wiped'); display = updateDisplay(); @@ -700,6 +700,6 @@ class ResetScoreOption extends Option private override function updateDisplay():String { - return confirm ? "Confirm" : "Reset Score"; + return confirm ? "Confirm Score Reset" : "Reset Score"; } } diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index c2a4446..8a23b12 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -62,7 +62,7 @@ class OptionsMenu extends MusicBeatState new OptionCategory("Saved Data", [ new ResetScoreOption("Reset your score on all songs and weeks."), - new LockWeeksOption("Reset your storymode progress. (only Tutorial + Week 1 is unlocked)") + new LockWeeksOption("Reset your storymode progress. (only Tutorial + Week 1 will be unlocked)") ]) ]; From 354fa20a74769e41f0cd61f3790a4e9ce8972a25 Mon Sep 17 00:00:00 2001 From: Lucky56 <55949451+Lucky-56@users.noreply.github.com> Date: Sat, 19 Jun 2021 00:41:13 +0200 Subject: [PATCH 06/22] added reset settings option --- source/Options.hx | 56 +++++++++++++++++++++++++++++++++++++++++++ source/OptionsMenu.hx | 3 ++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/source/Options.hx b/source/Options.hx index 3462923..49480bd 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -703,3 +703,59 @@ class ResetScoreOption extends Option return confirm ? "Confirm Score Reset" : "Reset Score"; } } + +class ResetSettings extends Option +{ + var confirm:Bool = false; + + public function new(desc:String) + { + super(); + description = desc; + } + public override function press():Bool + { + if(!confirm) + { + confirm = true; + display = updateDisplay(); + return true; + } + FlxG.save.data.weekUnlocked = 6; + FlxG.save.data.newInput = true; + FlxG.save.data.downscroll = false; + FlxG.save.data.dfjk = false; + FlxG.save.data.accuracyDisplay = true; + FlxG.save.data.offset = 0; + FlxG.save.data.songPosition = false; + FlxG.save.data.fps = false; + FlxG.save.data.changedHitX = -1; + FlxG.save.data.changedHitY = -1; + FlxG.save.data.changedHit = false; + FlxG.save.data.fpsRain = false; + FlxG.save.data.fpsCap = 120; + FlxG.save.data.scrollSpeed = 1; + FlxG.save.data.npsDisplay = false; + FlxG.save.data.frames = 10; + FlxG.save.data.accuracyMod = 1; + FlxG.save.data.watermark = true; + FlxG.save.data.ghost = true; + FlxG.save.data.distractions = true; + FlxG.save.data.flashing = true; + FlxG.save.data.resetButton = false; + FlxG.save.data.botplay = false; + FlxG.save.data.cpuStrums = false; + FlxG.save.data.strumline = false; + FlxG.save.data.customStrumLine = 0; + FlxG.save.data.camzoom = true; + confirm = false; + trace('All settings have been reset'); + display = updateDisplay(); + return true; + } + + private override function updateDisplay():String + { + return confirm ? "Confirm Settings Reset" : "Reset Settings"; + } +} diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 8a23b12..8b45eb3 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -62,7 +62,8 @@ class OptionsMenu extends MusicBeatState new OptionCategory("Saved Data", [ new ResetScoreOption("Reset your score on all songs and weeks."), - new LockWeeksOption("Reset your storymode progress. (only Tutorial + Week 1 will be unlocked)") + new LockWeeksOption("Reset your storymode progress. (only Tutorial + Week 1 will be unlocked)"), + new ResetSettings("Reset ALL your settings.") ]) ]; From daf05521bc6a7628bdf6278fc4b950d0e3de41f9 Mon Sep 17 00:00:00 2001 From: Lucky56 <55949451+Lucky-56@users.noreply.github.com> Date: Sat, 19 Jun 2021 07:32:37 +0200 Subject: [PATCH 07/22] songs from weeks that are locked are no longer shown in freeplay --- source/FreeplayState.hx | 3 ++- source/StoryMenuState.hx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 91ca64a..d58f3f3 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -44,7 +44,8 @@ class FreeplayState extends MusicBeatState for (i in 0...initSonglist.length) { var data:Array = initSonglist[i].split(':'); - songs.push(new SongMetadata(data[0], Std.parseInt(data[2]), data[1])); + if(Std.parseInt(data[2]) <= FlxG.save.data.weekUnlocked - 1) + songs.push(new SongMetadata(data[0], Std.parseInt(data[2]), data[1])); } /* diff --git a/source/StoryMenuState.hx b/source/StoryMenuState.hx index 5d5b20f..4a3e1e0 100644 --- a/source/StoryMenuState.hx +++ b/source/StoryMenuState.hx @@ -413,7 +413,7 @@ class StoryMenuState extends MusicBeatState public static function unlockNextWeek(week:Int):Void { - // TODO: get the weekData from class (but making it static makes it weird) + // TODO: get the weekData from class (but making it static makes it dissapear when beating the week) var weekData:Array = [ ['Tutorial'], ['Bopeebo', 'Fresh', 'Dad Battle'], @@ -424,7 +424,7 @@ class StoryMenuState extends MusicBeatState ['Senpai', 'Roses', 'Thorns'] ]; - if(week < weekData.length - 1 && FlxG.save.data.weekUnlocked == week) + if(week <= weekData.length - 1 && FlxG.save.data.weekUnlocked == week) { weekUnlocked.push(true); trace('Week ' + week + ' beat (Week ' + (week + 1) + ' unlocked)'); From c4db591f09aa6a52de2c64c90dbe60aa311e9de9 Mon Sep 17 00:00:00 2001 From: Lucky56 <55949451+Lucky-56@users.noreply.github.com> Date: Sat, 19 Jun 2021 07:44:14 +0200 Subject: [PATCH 08/22] due to freeplay songs unlocking aswell, default value is 'week 6 beat' --- source/KadeEngineData.hx | 2 +- source/Options.hx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/KadeEngineData.hx b/source/KadeEngineData.hx index e412609..efe7d53 100644 --- a/source/KadeEngineData.hx +++ b/source/KadeEngineData.hx @@ -6,7 +6,7 @@ class KadeEngineData public static function initSave() { if (FlxG.save.data.weekUnlocked == null) - FlxG.save.data.weekUnlocked = 6; + FlxG.save.data.weekUnlocked = 7; if (FlxG.save.data.newInput == null) FlxG.save.data.newInput = true; diff --git a/source/Options.hx b/source/Options.hx index 49480bd..d84616d 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -721,7 +721,7 @@ class ResetSettings extends Option display = updateDisplay(); return true; } - FlxG.save.data.weekUnlocked = 6; + FlxG.save.data.weekUnlocked = 7; FlxG.save.data.newInput = true; FlxG.save.data.downscroll = false; FlxG.save.data.dfjk = false; From 1de649d441d87e1ebbc902de17e5e42d16882ad3 Mon Sep 17 00:00:00 2001 From: Lucky56 <55949451+Lucky-56@users.noreply.github.com> Date: Sat, 19 Jun 2021 08:16:10 +0200 Subject: [PATCH 09/22] fixed crash occurring in freeplay when no weeks are unlocked --- assets/preload/data/freeplaySonglist.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/preload/data/freeplaySonglist.txt b/assets/preload/data/freeplaySonglist.txt index a5939ad..7af8115 100644 --- a/assets/preload/data/freeplaySonglist.txt +++ b/assets/preload/data/freeplaySonglist.txt @@ -1,4 +1,4 @@ -Tutorial:gf:1 +Tutorial:gf:0 Bopeebo:dad:1 Fresh:dad:1 Dad Battle:dad:1 From 3696b71d7a44f249590a9a3baade2b5b64e406ce Mon Sep 17 00:00:00 2001 From: Lucky56 <55949451+Lucky-56@users.noreply.github.com> Date: Sat, 19 Jun 2021 09:52:17 +0200 Subject: [PATCH 10/22] slight adjustments --- source/KadeEngineData.hx | 2 +- source/Options.hx | 55 ++++++++++++++++++++-------------------- source/OptionsMenu.hx | 2 +- 3 files changed, 29 insertions(+), 30 deletions(-) diff --git a/source/KadeEngineData.hx b/source/KadeEngineData.hx index efe7d53..b5f65f4 100644 --- a/source/KadeEngineData.hx +++ b/source/KadeEngineData.hx @@ -5,7 +5,7 @@ class KadeEngineData { public static function initSave() { - if (FlxG.save.data.weekUnlocked == null) + if (FlxG.save.data.weekUnlocked == null) FlxG.save.data.weekUnlocked = 7; if (FlxG.save.data.newInput == null) diff --git a/source/Options.hx b/source/Options.hx index d84616d..6077498 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -693,7 +693,7 @@ class ResetScoreOption extends Option Highscore.songCombos[key] = ''; } confirm = false; - trace('Save Data Wiped'); + trace('Highscores Wiped'); display = updateDisplay(); return true; } @@ -721,33 +721,32 @@ class ResetSettings extends Option display = updateDisplay(); return true; } - FlxG.save.data.weekUnlocked = 7; - FlxG.save.data.newInput = true; - FlxG.save.data.downscroll = false; - FlxG.save.data.dfjk = false; - FlxG.save.data.accuracyDisplay = true; - FlxG.save.data.offset = 0; - FlxG.save.data.songPosition = false; - FlxG.save.data.fps = false; - FlxG.save.data.changedHitX = -1; - FlxG.save.data.changedHitY = -1; - FlxG.save.data.changedHit = false; - FlxG.save.data.fpsRain = false; - FlxG.save.data.fpsCap = 120; - FlxG.save.data.scrollSpeed = 1; - FlxG.save.data.npsDisplay = false; - FlxG.save.data.frames = 10; - FlxG.save.data.accuracyMod = 1; - FlxG.save.data.watermark = true; - FlxG.save.data.ghost = true; - FlxG.save.data.distractions = true; - FlxG.save.data.flashing = true; - FlxG.save.data.resetButton = false; - FlxG.save.data.botplay = false; - FlxG.save.data.cpuStrums = false; - FlxG.save.data.strumline = false; - FlxG.save.data.customStrumLine = 0; - FlxG.save.data.camzoom = true; + FlxG.save.data.weekUnlocked = null; + FlxG.save.data.newInput = null; + FlxG.save.data.downscroll = null; + FlxG.save.data.dfjk = null; + FlxG.save.data.accuracyDisplay = null; + FlxG.save.data.offset = null; + FlxG.save.data.songPosition = null; + FlxG.save.data.fps = null; + FlxG.save.data.changedHit = null; + FlxG.save.data.fpsRain = null; + FlxG.save.data.fpsCap = null; + FlxG.save.data.scrollSpeed = null; + FlxG.save.data.npsDisplay = null; + FlxG.save.data.frames = null; + FlxG.save.data.accuracyMod = null; + FlxG.save.data.watermark = null; + FlxG.save.data.ghost = null; + FlxG.save.data.distractions = null; + FlxG.save.data.flashing = null; + FlxG.save.data.resetButton = null; + FlxG.save.data.botplay = null; + FlxG.save.data.cpuStrums = null; + FlxG.save.data.strumline = null; + FlxG.save.data.customStrumLine = null; + FlxG.save.data.camzoom = null; + KadeEngineData.initSave(); confirm = false; trace('All settings have been reset'); display = updateDisplay(); diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 8b45eb3..a55c1c7 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -60,7 +60,7 @@ class OptionsMenu extends MusicBeatState new BotPlay("Showcase your charts and mods with autoplay.") ]), - new OptionCategory("Saved Data", [ + new OptionCategory("Manage Save Data", [ new ResetScoreOption("Reset your score on all songs and weeks."), new LockWeeksOption("Reset your storymode progress. (only Tutorial + Week 1 will be unlocked)"), new ResetSettings("Reset ALL your settings.") From 858c0ce8f7c75740a38accfecfe007b5d54e2c92 Mon Sep 17 00:00:00 2001 From: Lucky56 <55949451+Lucky-56@users.noreply.github.com> Date: Sat, 19 Jun 2021 11:45:07 +0200 Subject: [PATCH 11/22] changed weekData from variable to function --- source/StoryMenuState.hx | 44 ++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/source/StoryMenuState.hx b/source/StoryMenuState.hx index 4a3e1e0..98c2680 100644 --- a/source/StoryMenuState.hx +++ b/source/StoryMenuState.hx @@ -23,15 +23,18 @@ class StoryMenuState extends MusicBeatState { var scoreText:FlxText; - var weekData:Array = [ - ['Tutorial'], - ['Bopeebo', 'Fresh', 'Dad Battle'], - ['Spookeez', 'South', "Monster"], - ['Pico', 'Philly Nice', "Blammed"], - ['Satin Panties', "High", "Milf"], - ['Cocoa', 'Eggnog', 'Winter Horrorland'], - ['Senpai', 'Roses', 'Thorns'] - ]; + static function weekData():Array + { + return [ + ['Tutorial'], + ['Bopeebo', 'Fresh', 'Dad Battle'], + ['Spookeez', 'South', "Monster"], + ['Pico', 'Philly Nice', "Blammed"], + ['Satin Panties', "High", "Milf"], + ['Cocoa', 'Eggnog', 'Winter Horrorland'], + ['Senpai', 'Roses', 'Thorns'] + ]; + } var curDifficulty:Int = 1; public static var weekUnlocked:Array = []; @@ -132,7 +135,7 @@ class StoryMenuState extends MusicBeatState trace("Line 70"); - for (i in 0...weekData.length) + for (i in 0...weekData().length) { var weekThing:MenuItem = new MenuItem(0, yellowBG.y + yellowBG.height + 10, i); weekThing.y += ((weekThing.height + 20) * i); @@ -295,7 +298,7 @@ class StoryMenuState extends MusicBeatState stopspamming = true; } - PlayState.storyPlaylist = weekData[curWeek]; + PlayState.storyPlaylist = weekData()[curWeek]; PlayState.isStoryMode = true; selectedWeek = true; @@ -365,10 +368,10 @@ class StoryMenuState extends MusicBeatState { curWeek += change; - if (curWeek >= weekData.length) + if (curWeek >= weekData().length) curWeek = 0; if (curWeek < 0) - curWeek = weekData.length - 1; + curWeek = weekData().length - 1; var bullShit:Int = 0; @@ -394,7 +397,7 @@ class StoryMenuState extends MusicBeatState grpWeekCharacters.members[2].setCharacter(weekCharacters[curWeek][2]); txtTracklist.text = "Tracks\n"; - var stringThing:Array = weekData[curWeek]; + var stringThing:Array = weekData()[curWeek]; for (i in stringThing) txtTracklist.text += "\n" + i; @@ -413,18 +416,7 @@ class StoryMenuState extends MusicBeatState public static function unlockNextWeek(week:Int):Void { - // TODO: get the weekData from class (but making it static makes it dissapear when beating the week) - var weekData:Array = [ - ['Tutorial'], - ['Bopeebo', 'Fresh', 'Dad Battle'], - ['Spookeez', 'South', "Monster"], - ['Pico', 'Philly Nice', "Blammed"], - ['Satin Panties', "High", "Milf"], - ['Cocoa', 'Eggnog', 'Winter Horrorland'], - ['Senpai', 'Roses', 'Thorns'] - ]; - - if(week <= weekData.length - 1 && FlxG.save.data.weekUnlocked == week) + if(week <= weekData().length - 1 && FlxG.save.data.weekUnlocked == week) { weekUnlocked.push(true); trace('Week ' + week + ' beat (Week ' + (week + 1) + ' unlocked)'); From 40b2b08590e04fbe699d09195b1cbb52716bf355 Mon Sep 17 00:00:00 2001 From: Lucky56 <55949451+Lucky-56@users.noreply.github.com> Date: Sat, 19 Jun 2021 11:52:07 +0200 Subject: [PATCH 12/22] update docs --- docs/guides/weeks.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/docs/guides/weeks.md b/docs/guides/weeks.md index 90b89ca..f2097cb 100644 --- a/docs/guides/weeks.md +++ b/docs/guides/weeks.md @@ -15,8 +15,10 @@ Scroll down to Line 26, or Search (Windows/Linux: `Ctrl+F`, Mac: `Cmd+F`) for "w --- ```haxe -var weekData:Array = [ - +static function weekData():Array +{ + return [ + ['Tutorial'], ['Bopeebo', 'Fresh', 'Dadbattle'], @@ -30,8 +32,9 @@ var weekData:Array = [ ['Cocoa', 'Eggnog', 'Winter-Horrorland'], ['Senpai', 'Roses', 'Thorns'] - -]; + + ]; +} ``` --- @@ -45,8 +48,10 @@ Example --- ```haxe -var weekData:Array = [ - +static function weekData():Array +{ + return [ + ['Tutorial'], ['Bopeebo', 'Fresh', 'Dadbattle'], @@ -58,12 +63,13 @@ var weekData:Array = [ ['Satin-Panties', "High", "Milf"], ['Cocoa', 'Eggnog', 'Winter-Horrorland'], - + ['Senpai', 'Roses', 'Thorns'], ['Ugh', 'Guns', 'Stress'] - -]; + + ]; +} ``` --- From 41d42e0375627b2a2dba16409fa73a1f43ea8390 Mon Sep 17 00:00:00 2001 From: Lucky56 <55949451+Lucky-56@users.noreply.github.com> Date: Tue, 22 Jun 2021 13:13:57 +0200 Subject: [PATCH 13/22] ok --- source/OptionsMenu.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 0420ecd..6b6bf53 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -58,7 +58,7 @@ class OptionsMenu extends MusicBeatState new FlashingLightsOption("Toggle flashing lights that can cause epileptic seizures and strain."), new WatermarkOption("Enable and disable all watermarks from the engine."), new ScoreScreen("Show the score screen after the end of a song"), - new ShowInput("Display every single input in the score screen."), + new ShowInput("Display every single input in the score screen."), new Optimization("No backgrounds, no characters, centered notes, no player 2."), new BotPlay("Showcase your charts and mods with autoplay.") ]), From aab589ff9f006d38fbe38a8468637b609cbfb667 Mon Sep 17 00:00:00 2001 From: Lucky56 <55949451+Lucky-56@users.noreply.github.com> Date: Sat, 26 Jun 2021 12:49:12 +0200 Subject: [PATCH 14/22] resolve conflicts --- source/FreeplayState.hx | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/source/FreeplayState.hx b/source/FreeplayState.hx index 7ff0fd4..20db69e 100644 --- a/source/FreeplayState.hx +++ b/source/FreeplayState.hx @@ -63,21 +63,21 @@ class FreeplayState extends MusicBeatState var data:Array = initSonglist[i].split(':'); var meta = new SongMetadata(data[0], Std.parseInt(data[2]), data[1]); if(Std.parseInt(data[2]) <= FlxG.save.data.weekUnlocked - 1) - songs.push(new SongMetadata(data[0], Std.parseInt(data[2]), data[1])); - songs.push(meta); - var format = StringTools.replace(meta.songName, " ", "-"); - switch (format) { - case 'Dad-Battle': format = 'Dadbattle'; - case 'Philly-Nice': format = 'Philly'; + { + songs.push(meta); + var format = StringTools.replace(meta.songName, " ", "-"); + switch (format) { + case 'Dad-Battle': format = 'Dadbattle'; + case 'Philly-Nice': format = 'Philly'; + } + + var diffs = []; + FreeplayState.loadDiff(0,format,meta.songName,diffs); + FreeplayState.loadDiff(1,format,meta.songName,diffs); + FreeplayState.loadDiff(2,format,meta.songName,diffs); + FreeplayState.songData.set(meta.songName,diffs); + trace('loaded diffs for ' + meta.songName); } - - var diffs = []; - FreeplayState.loadDiff(0,format,meta.songName,diffs); - FreeplayState.loadDiff(1,format,meta.songName,diffs); - FreeplayState.loadDiff(2,format,meta.songName,diffs); - FreeplayState.songData.set(meta.songName,diffs); - trace('loaded diffs for ' + meta.songName); - } /* From aa581a2dd730705fe5d6290b106e05fae49c01e7 Mon Sep 17 00:00:00 2001 From: ACardboardBox <81185552+ACardboardBox1@users.noreply.github.com> Date: Sat, 26 Jun 2021 20:21:13 -0400 Subject: [PATCH 15/22] Go away senpai No more black senpai portrait covering spirit (fixes #1022) --- source/DialogueBox.hx | 1 - 1 file changed, 1 deletion(-) diff --git a/source/DialogueBox.hx b/source/DialogueBox.hx index d52358c..012d559 100644 --- a/source/DialogueBox.hx +++ b/source/DialogueBox.hx @@ -155,7 +155,6 @@ class DialogueBox extends FlxSpriteGroup portraitLeft.visible = false; if (PlayState.SONG.song.toLowerCase() == 'thorns') { - portraitLeft.color = FlxColor.BLACK; swagDialogue.color = FlxColor.WHITE; dropText.color = FlxColor.BLACK; } From 9da6c8fa1771409a5669a949a0285ff10845f164 Mon Sep 17 00:00:00 2001 From: ACardboardBox <81185552+ACardboardBox1@users.noreply.github.com> Date: Sun, 27 Jun 2021 10:24:26 -0400 Subject: [PATCH 16/22] Fix spelling issue --- source/Main.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Main.hx b/source/Main.hx index a065da2..6c06d39 100644 --- a/source/Main.hx +++ b/source/Main.hx @@ -23,7 +23,7 @@ class Main extends Sprite var skipSplash:Bool = true; // Whether to skip the flixel splash screen that appears in release mode. var startFullscreen:Bool = false; // Whether to start the game in fullscreen on desktop targets - public static var watermarks = true; // Whether to put Kade Engine liteartly anywhere + public static var watermarks = true; // Whether to put Kade Engine literally anywhere // You can pretty much ignore everything from here on - your code should go in your states. From ffa186dc1bd3cf7480c96b9fa651894f9c1a14ad Mon Sep 17 00:00:00 2001 From: codeeater_ <55358751+toxichead@users.noreply.github.com> Date: Sun, 27 Jun 2021 22:02:52 +0300 Subject: [PATCH 17/22] LOOKS LIKE I FIXED THIS --- appveyor-linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor-linux.yml b/appveyor-linux.yml index dc06bb0..6dfee0f 100644 --- a/appveyor-linux.yml +++ b/appveyor-linux.yml @@ -9,7 +9,7 @@ install: - cd /home/appveyor - sudo add-apt-repository ppa:haxe/releases -y - sudo apt update - - sudo apt install neko tar gcc-multilib g++-multilib -y + - sudo apt install neko tar gcc-7 g++-7 gcc-7-multilib g++-7-multilib -y - wget https://github.com/HaxeFoundation/haxe/releases/download/4.1.5/haxe-4.1.5-linux64.tar.gz - mkdir $HAXE_INSTALLDIR - tar -xf haxe-4.1.5-linux64.tar.gz -C $HAXE_INSTALLDIR From c53eacc2aa7c5dd16ef76ca33354c8fa8e2726b5 Mon Sep 17 00:00:00 2001 From: codeeater_ <55358751+toxichead@users.noreply.github.com> Date: Sun, 27 Jun 2021 22:11:44 +0300 Subject: [PATCH 18/22] why here's dublicate lmao --- appveyor-windows.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/appveyor-windows.yml b/appveyor-windows.yml index eaf9b74..ae69bca 100644 --- a/appveyor-windows.yml +++ b/appveyor-windows.yml @@ -37,8 +37,9 @@ install: - haxelib run lime rebuild extension-webm windows - haxelib install linc_luajit - haxelib install actuate - - haxelib git extension-webm https://github.com/KadeDev/extension-webm - - lime rebuild extension-webm windows + #- haxelib git extension-webm https://github.com/KadeDev/extension-webm + #- haxelib run lime rebuild extension-webm windows + #why here's dublicate lmao - haxelib list # No tests idk lol From 0fb73671181a8674883d6690238013bfab10f2ce Mon Sep 17 00:00:00 2001 From: Lucky56 <55949451+Lucky-56@users.noreply.github.com> Date: Mon, 28 Jun 2021 00:56:26 +0200 Subject: [PATCH 19/22] I thought we removed hard coded stuff --- source/Note.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Note.hx b/source/Note.hx index ec67490..72264a4 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -166,7 +166,7 @@ class Note extends FlxSprite x -= width / 2; - if (PlayState.curStage.startsWith('school')) + if (noteTypeCheck == 'pixel') x += 30; if (prevNote.isSustainNote) From d761779038e9d4879d0159c7129581f663f84731 Mon Sep 17 00:00:00 2001 From: ACardboardBox <81185552+ACardboardBox1@users.noreply.github.com> Date: Mon, 28 Jun 2021 18:24:42 -0400 Subject: [PATCH 20/22] Redid my old pr --- source/DialogueBox.hx | 1 + 1 file changed, 1 insertion(+) diff --git a/source/DialogueBox.hx b/source/DialogueBox.hx index 012d559..07363c6 100644 --- a/source/DialogueBox.hx +++ b/source/DialogueBox.hx @@ -155,6 +155,7 @@ class DialogueBox extends FlxSpriteGroup portraitLeft.visible = false; if (PlayState.SONG.song.toLowerCase() == 'thorns') { + portraitLeft.visible = false; swagDialogue.color = FlxColor.WHITE; dropText.color = FlxColor.BLACK; } From 2266a2923ea3b073754c209d8cea163e42bc7aee Mon Sep 17 00:00:00 2001 From: Raltyro <78720179+Raltyro@users.noreply.github.com> Date: Tue, 29 Jun 2021 09:34:14 +0700 Subject: [PATCH 21/22] stupid wrong icon Health fix --- source/ModchartState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ModchartState.hx b/source/ModchartState.hx index 6e194d1..571edbf 100644 --- a/source/ModchartState.hx +++ b/source/ModchartState.hx @@ -250,7 +250,7 @@ class ModchartState PlayState.instance.removeObject(PlayState.boyfriend); PlayState.boyfriend = new Boyfriend(oldboyfriendx, oldboyfriendy, id); PlayState.instance.addObject(PlayState.boyfriend); - PlayState.instance.iconP2.animation.play(id); + PlayState.instance.iconP1.animation.play(id); } function makeAnimatedLuaSprite(spritePath:String,names:Array,prefixes:Array,startAnim:String, id:String) From 8a8cf2cc785b384956a248729b70278a37c6a937 Mon Sep 17 00:00:00 2001 From: M&M Date: Mon, 28 Jun 2021 21:54:52 -0700 Subject: [PATCH 22/22] fix mom camera also: - optimize switch case - remove unnecessary code --- source/PlayState.hx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/source/PlayState.hx b/source/PlayState.hx index daca7ed..7e912ea 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -2318,18 +2318,12 @@ class PlayState extends MusicBeatState switch (dad.curCharacter) { - case 'mom': + case 'mom' | 'mom-car': camFollow.y = dad.getMidpoint().y; - case 'senpai': - camFollow.y = dad.getMidpoint().y - 430; - camFollow.x = dad.getMidpoint().x - 100; - case 'senpai-angry': + case 'senpai' | 'senpai-angry': camFollow.y = dad.getMidpoint().y - 430; camFollow.x = dad.getMidpoint().x - 100; } - - if (dad.curCharacter == 'mom') - vocals.volume = 1; } if (PlayState.SONG.notes[Std.int(curStep / 16)].mustHitSection && camFollow.x != boyfriend.getMidpoint().x - 100)