2024-01-03 19:53:17 -05:00
|
|
|
package funkin.util.plugins;
|
|
|
|
|
|
|
|
import flixel.FlxBasic;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A plugin which adds functionality to press `F4` to immediately transition to the main menu.
|
|
|
|
* This is useful for debugging or if you get softlocked or something.
|
|
|
|
*/
|
|
|
|
class EvacuateDebugPlugin extends FlxBasic
|
|
|
|
{
|
|
|
|
public function new()
|
|
|
|
{
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function initialize():Void
|
|
|
|
{
|
|
|
|
FlxG.plugins.addPlugin(new EvacuateDebugPlugin());
|
|
|
|
}
|
|
|
|
|
|
|
|
public override function update(elapsed:Float):Void
|
|
|
|
{
|
|
|
|
super.update(elapsed);
|
|
|
|
|
|
|
|
if (FlxG.keys.justPressed.F4)
|
|
|
|
{
|
2024-02-05 19:46:11 -05:00
|
|
|
FlxG.switchState(() -> new funkin.ui.mainmenu.MainMenuState());
|
2024-01-03 19:53:17 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public override function destroy():Void
|
|
|
|
{
|
|
|
|
super.destroy();
|
|
|
|
}
|
|
|
|
}
|