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] 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)');