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(); + } }