renamed 'lock weeks' to 'reset story mode progress' + added reset score
This commit is contained in:
parent
6ebdcd4ff7
commit
ef3e0e135e
@ -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";
|
||||
}
|
||||
}
|
||||
|
@ -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)")
|
||||
])
|
||||
|
||||
];
|
||||
|
Loading…
x
Reference in New Issue
Block a user