2024-02-22 06:47:35 +00:00
|
|
|
package funkin.util.plugins;
|
|
|
|
|
|
|
|
import flixel.FlxBasic;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A plugin which forcibly crashes the application.
|
|
|
|
* TODO: Should we disable this in release builds?
|
|
|
|
*/
|
|
|
|
class ForceCrashPlugin extends FlxBasic
|
|
|
|
{
|
|
|
|
public function new()
|
|
|
|
{
|
|
|
|
super();
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function initialize():Void
|
|
|
|
{
|
|
|
|
FlxG.plugins.addPlugin(new ForceCrashPlugin());
|
|
|
|
}
|
|
|
|
|
|
|
|
public override function update(elapsed:Float):Void
|
|
|
|
{
|
|
|
|
super.update(elapsed);
|
|
|
|
|
2024-02-22 23:51:18 +00:00
|
|
|
// Ctrl + Shift + L = Crash the game for debugging purposes
|
|
|
|
if (FlxG.keys.pressed.CONTROL && FlxG.keys.pressed.SHIFT && FlxG.keys.pressed.L)
|
2024-02-22 06:47:35 +00:00
|
|
|
{
|
|
|
|
// TODO: Make this message 87% funnier.
|
|
|
|
throw "DEBUG: Crashing the game via debug keybind!";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public override function destroy():Void
|
|
|
|
{
|
|
|
|
super.destroy();
|
|
|
|
}
|
|
|
|
}
|