Merge pull request #1651 from Lil-Parrot/Instant-Respawn-Option
Instant Respawn Option
This commit is contained in:
@ -61,6 +61,16 @@ class GameOverState extends FlxTransitionableState
|
|||||||
|
|
||||||
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
|
var gamepad:FlxGamepad = FlxG.gamepads.lastActive;
|
||||||
|
|
||||||
|
if(FlxG.save.data.InstantRespawn)
|
||||||
|
{
|
||||||
|
fading = true;
|
||||||
|
FlxG.sound.music.fadeOut(0.5, 0, function(twn:FlxTween)
|
||||||
|
{
|
||||||
|
FlxG.sound.music.stop();
|
||||||
|
LoadingState.loadAndSwitchState(new PlayState());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (gamepad != null)
|
if (gamepad != null)
|
||||||
{
|
{
|
||||||
if (gamepad.justPressed.ANY)
|
if (gamepad.justPressed.ANY)
|
||||||
|
@ -59,6 +59,11 @@ class GameOverSubstate extends MusicBeatSubstate
|
|||||||
endBullshit();
|
endBullshit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(FlxG.save.data.InstantRespawn)
|
||||||
|
{
|
||||||
|
LoadingState.loadAndSwitchState(new PlayState());
|
||||||
|
}
|
||||||
|
|
||||||
if (controls.BACK)
|
if (controls.BACK)
|
||||||
{
|
{
|
||||||
FlxG.sound.music.stop();
|
FlxG.sound.music.stop();
|
||||||
|
@ -81,6 +81,9 @@ class KadeEngineData
|
|||||||
|
|
||||||
if (FlxG.save.data.resetButton == null)
|
if (FlxG.save.data.resetButton == null)
|
||||||
FlxG.save.data.resetButton = false;
|
FlxG.save.data.resetButton = false;
|
||||||
|
|
||||||
|
if (FlxG.save.data.InstantRespawn == null)
|
||||||
|
FlxG.save.data.InstantRespawn = false;
|
||||||
|
|
||||||
if (FlxG.save.data.botplay == null)
|
if (FlxG.save.data.botplay == null)
|
||||||
FlxG.save.data.botplay = false;
|
FlxG.save.data.botplay = false;
|
||||||
|
@ -307,6 +307,27 @@ class ResetButtonOption extends Option
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class InstantRespawn extends Option
|
||||||
|
{
|
||||||
|
public function new(desc:String)
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
description = desc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override function press():Bool
|
||||||
|
{
|
||||||
|
FlxG.save.data.InstantRespawn = !FlxG.save.data.InstantRespawn;
|
||||||
|
display = updateDisplay();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private override function updateDisplay():String
|
||||||
|
{
|
||||||
|
return "Instant Respawn " + (!FlxG.save.data.InstantRespawn ? "off" : "on");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class FlashingLightsOption extends Option
|
class FlashingLightsOption extends Option
|
||||||
{
|
{
|
||||||
public function new(desc:String)
|
public function new(desc:String)
|
||||||
|
@ -36,6 +36,7 @@ class OptionsMenu extends MusicBeatState
|
|||||||
new ScrollSpeedOption("Change your scroll speed. (1 = Chart dependent)"),
|
new ScrollSpeedOption("Change your scroll speed. (1 = Chart dependent)"),
|
||||||
new AccuracyDOption("Change how accuracy is calculated. (Accurate = Simple, Complex = Milisecond Based)"),
|
new AccuracyDOption("Change how accuracy is calculated. (Accurate = Simple, Complex = Milisecond Based)"),
|
||||||
new ResetButtonOption("Toggle pressing R to gameover."),
|
new ResetButtonOption("Toggle pressing R to gameover."),
|
||||||
|
new InstantRespawn("Toggle if you instantly respawn after dying."),
|
||||||
// new OffsetMenu("Get a note offset based off of your inputs!"),
|
// new OffsetMenu("Get a note offset based off of your inputs!"),
|
||||||
new CustomizeGameplay("Drag and drop gameplay modules to your prefered positions!")
|
new CustomizeGameplay("Drag and drop gameplay modules to your prefered positions!")
|
||||||
]),
|
]),
|
||||||
|
Reference in New Issue
Block a user