brought back the week locking
This commit is contained in:
parent
19134e6694
commit
b6953ec111
@ -5,7 +5,10 @@ class KadeEngineData
|
|||||||
{
|
{
|
||||||
public static function initSave()
|
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;
|
FlxG.save.data.newInput = true;
|
||||||
|
|
||||||
if (FlxG.save.data.downscroll == null)
|
if (FlxG.save.data.downscroll == null)
|
||||||
|
@ -634,3 +634,25 @@ class CamZoomOption extends Option
|
|||||||
return "Camera Zoom " + (!FlxG.save.data.camzoom ? "off" : "on");
|
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";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -58,6 +58,11 @@ class OptionsMenu extends MusicBeatState
|
|||||||
new FlashingLightsOption("Toggle flashing lights that can cause epileptic seizures and strain."),
|
new FlashingLightsOption("Toggle flashing lights that can cause epileptic seizures and strain."),
|
||||||
new WatermarkOption("Enable and disable all watermarks from the engine."),
|
new WatermarkOption("Enable and disable all watermarks from the engine."),
|
||||||
new BotPlay("Showcase your charts and mods with autoplay.")
|
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
|
||||||
])
|
])
|
||||||
|
|
||||||
];
|
];
|
||||||
|
@ -2576,16 +2576,19 @@ class PlayState extends MusicBeatState
|
|||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
||||||
// if ()
|
|
||||||
StoryMenuState.weekUnlocked[Std.int(Math.min(storyWeek + 1, StoryMenuState.weekUnlocked.length - 1))] = true;
|
|
||||||
|
|
||||||
if (SONG.validScore)
|
if (SONG.validScore)
|
||||||
{
|
{
|
||||||
NGio.unlockMedal(60961);
|
NGio.unlockMedal(60961);
|
||||||
Highscore.saveWeekScore(storyWeek, campaignScore, storyDifficulty);
|
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();
|
FlxG.save.flush();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -34,7 +34,7 @@ class StoryMenuState extends MusicBeatState
|
|||||||
];
|
];
|
||||||
var curDifficulty:Int = 1;
|
var curDifficulty:Int = 1;
|
||||||
|
|
||||||
public static var weekUnlocked:Array<Bool> = [true, true, true, true, true, true, true];
|
public static var weekUnlocked:Array<Bool> = [];
|
||||||
|
|
||||||
var weekCharacters:Array<Dynamic> = [
|
var weekCharacters:Array<Dynamic> = [
|
||||||
['', 'bf', 'gf'],
|
['', 'bf', 'gf'],
|
||||||
@ -72,8 +72,21 @@ class StoryMenuState extends MusicBeatState
|
|||||||
var leftArrow:FlxSprite;
|
var leftArrow:FlxSprite;
|
||||||
var rightArrow:FlxSprite;
|
var rightArrow:FlxSprite;
|
||||||
|
|
||||||
|
function unlockWeeks():Array<Bool>
|
||||||
|
{
|
||||||
|
var weeks:Array<Bool> = [true];
|
||||||
|
|
||||||
|
for(i in 0...FlxG.save.data.weekUnlocked)
|
||||||
|
{
|
||||||
|
weeks.push(true);
|
||||||
|
}
|
||||||
|
return weeks;
|
||||||
|
}
|
||||||
|
|
||||||
override function create()
|
override function create()
|
||||||
{
|
{
|
||||||
|
weekUnlocked = unlockWeeks();
|
||||||
|
|
||||||
#if windows
|
#if windows
|
||||||
// Updating Discord Rich Presence
|
// Updating Discord Rich Presence
|
||||||
DiscordClient.changePresence("In the Story Mode Menu", null);
|
DiscordClient.changePresence("In the Story Mode Menu", null);
|
||||||
@ -133,6 +146,7 @@ class StoryMenuState extends MusicBeatState
|
|||||||
// Needs an offset thingie
|
// Needs an offset thingie
|
||||||
if (!weekUnlocked[i])
|
if (!weekUnlocked[i])
|
||||||
{
|
{
|
||||||
|
trace('locking week ' + i);
|
||||||
var lock:FlxSprite = new FlxSprite(weekThing.width + 10 + weekThing.x);
|
var lock:FlxSprite = new FlxSprite(weekThing.width + 10 + weekThing.x);
|
||||||
lock.frames = ui_tex;
|
lock.frames = ui_tex;
|
||||||
lock.animation.addByPrefix('lock', 'lock');
|
lock.animation.addByPrefix('lock', 'lock');
|
||||||
|
@ -94,20 +94,6 @@ class TitleState extends MusicBeatState
|
|||||||
|
|
||||||
Highscore.load();
|
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
|
#if FREEPLAY
|
||||||
FlxG.switchState(new FreeplayState());
|
FlxG.switchState(new FreeplayState());
|
||||||
#elseif CHARTING
|
#elseif CHARTING
|
||||||
|
Loading…
x
Reference in New Issue
Block a user