2022-03-08 08:13:53 +00:00
|
|
|
package funkin;
|
2021-02-15 00:03:02 +00:00
|
|
|
|
|
|
|
import flixel.FlxSprite;
|
|
|
|
import flixel.graphics.frames.FlxAtlasFrames;
|
2022-03-08 08:13:53 +00:00
|
|
|
import funkin.play.PlayState;
|
2023-08-02 22:08:49 +00:00
|
|
|
import flixel.addons.transition.FlxTransitionableState;
|
2021-02-15 00:03:02 +00:00
|
|
|
|
|
|
|
class GitarooPause extends MusicBeatState
|
|
|
|
{
|
2023-01-23 03:25:45 +00:00
|
|
|
var replayButton:FlxSprite;
|
|
|
|
var cancelButton:FlxSprite;
|
|
|
|
|
|
|
|
var replaySelect:Bool = false;
|
|
|
|
|
2023-06-06 21:38:31 +00:00
|
|
|
var previousParams:PlayStateParams;
|
|
|
|
|
|
|
|
public function new(previousParams:PlayStateParams):Void
|
2023-01-23 03:25:45 +00:00
|
|
|
{
|
|
|
|
super();
|
2023-06-06 21:38:31 +00:00
|
|
|
|
|
|
|
this.previousParams = previousParams;
|
2023-01-23 03:25:45 +00:00
|
|
|
}
|
|
|
|
|
2023-06-06 21:38:31 +00:00
|
|
|
override function create():Void
|
2023-01-23 03:25:45 +00:00
|
|
|
{
|
|
|
|
if (FlxG.sound.music != null) FlxG.sound.music.stop();
|
|
|
|
|
|
|
|
var bg:FlxSprite = new FlxSprite().loadGraphic(Paths.image('pauseAlt/pauseBG'));
|
|
|
|
add(bg);
|
|
|
|
|
|
|
|
var bf:FlxSprite = new FlxSprite(0, 30);
|
|
|
|
bf.frames = Paths.getSparrowAtlas('pauseAlt/bfLol');
|
|
|
|
bf.animation.addByPrefix('lol', "funnyThing", 13);
|
|
|
|
bf.animation.play('lol');
|
|
|
|
add(bf);
|
|
|
|
bf.screenCenter(X);
|
|
|
|
|
|
|
|
replayButton = new FlxSprite(FlxG.width * 0.28, FlxG.height * 0.7);
|
|
|
|
replayButton.frames = Paths.getSparrowAtlas('pauseAlt/pauseUI');
|
|
|
|
replayButton.animation.addByPrefix('selected', 'bluereplay', 0, false);
|
|
|
|
replayButton.animation.appendByPrefix('selected', 'yellowreplay');
|
|
|
|
replayButton.animation.play('selected');
|
|
|
|
add(replayButton);
|
|
|
|
|
|
|
|
cancelButton = new FlxSprite(FlxG.width * 0.58, replayButton.y);
|
|
|
|
cancelButton.frames = Paths.getSparrowAtlas('pauseAlt/pauseUI');
|
|
|
|
cancelButton.animation.addByPrefix('selected', 'bluecancel', 0, false);
|
|
|
|
cancelButton.animation.appendByPrefix('selected', 'cancelyellow');
|
|
|
|
cancelButton.animation.play('selected');
|
|
|
|
add(cancelButton);
|
|
|
|
|
|
|
|
changeThing();
|
|
|
|
|
|
|
|
super.create();
|
|
|
|
}
|
|
|
|
|
2023-06-06 21:38:31 +00:00
|
|
|
override function update(elapsed:Float):Void
|
2023-01-23 03:25:45 +00:00
|
|
|
{
|
|
|
|
if (controls.UI_LEFT_P || controls.UI_RIGHT_P) changeThing();
|
|
|
|
|
|
|
|
if (controls.ACCEPT)
|
|
|
|
{
|
|
|
|
if (replaySelect)
|
|
|
|
{
|
2023-08-02 22:08:49 +00:00
|
|
|
FlxTransitionableState.skipNextTransIn = false;
|
|
|
|
FlxTransitionableState.skipNextTransOut = false;
|
2023-06-06 21:38:31 +00:00
|
|
|
FlxG.switchState(new PlayState(previousParams));
|
2023-01-23 03:25:45 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FlxG.switchState(new MainMenuState());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
super.update(elapsed);
|
|
|
|
}
|
|
|
|
|
|
|
|
function changeThing():Void
|
|
|
|
{
|
|
|
|
replaySelect = !replaySelect;
|
|
|
|
|
|
|
|
if (replaySelect)
|
|
|
|
{
|
|
|
|
cancelButton.animation.curAnim.curFrame = 0;
|
|
|
|
replayButton.animation.curAnim.curFrame = 1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cancelButton.animation.curAnim.curFrame = 1;
|
|
|
|
replayButton.animation.curAnim.curFrame = 0;
|
|
|
|
}
|
|
|
|
}
|
2021-02-15 00:03:02 +00:00
|
|
|
}
|