mirror of
https://github.com/FunkinCrew/Funkin.git
synced 2024-11-27 01:55:52 -05:00
Move the crash keybind into a global plugin.
This commit is contained in:
parent
744e2f95bd
commit
0b49a88cdd
4 changed files with 49 additions and 9 deletions
|
@ -202,8 +202,9 @@ class InitState extends FlxState
|
||||||
//
|
//
|
||||||
// Plugins provide a useful interface for globally active Flixel objects,
|
// Plugins provide a useful interface for globally active Flixel objects,
|
||||||
// that receive update events regardless of the current state.
|
// that receive update events regardless of the current state.
|
||||||
// TODO: Move Module behavior to a Flixel plugin.
|
// TODO: Move scripted Module behavior to a Flixel plugin.
|
||||||
funkin.util.plugins.EvacuateDebugPlugin.initialize();
|
funkin.util.plugins.EvacuateDebugPlugin.initialize();
|
||||||
|
funkin.util.plugins.ForceCrashPlugin.initialize();
|
||||||
funkin.util.plugins.ReloadAssetsDebugPlugin.initialize();
|
funkin.util.plugins.ReloadAssetsDebugPlugin.initialize();
|
||||||
funkin.util.plugins.ScreenshotPlugin.initialize();
|
funkin.util.plugins.ScreenshotPlugin.initialize();
|
||||||
funkin.util.plugins.VolumePlugin.initialize();
|
funkin.util.plugins.VolumePlugin.initialize();
|
||||||
|
|
|
@ -5258,14 +5258,6 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState
|
||||||
{
|
{
|
||||||
// F1 = Open Help
|
// F1 = Open Help
|
||||||
if (FlxG.keys.justPressed.F1) this.openUserGuideDialog();
|
if (FlxG.keys.justPressed.F1) this.openUserGuideDialog();
|
||||||
|
|
||||||
// DEBUG KEYBIND: Ctrl + Alt + Shift + L = Crash the game.
|
|
||||||
#if debug
|
|
||||||
if (FlxG.keys.pressed.CONTROL && FlxG.keys.pressed.ALT && FlxG.keys.pressed.SHIFT && FlxG.keys.justPressed.L)
|
|
||||||
{
|
|
||||||
throw "DEBUG: Crashing the chart editor!";
|
|
||||||
}
|
|
||||||
#end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleQuickWatch():Void
|
function handleQuickWatch():Void
|
||||||
|
|
|
@ -133,6 +133,16 @@ class CrashHandler
|
||||||
|
|
||||||
fullContents += '=====================\n';
|
fullContents += '=====================\n';
|
||||||
|
|
||||||
|
fullContents += '\n';
|
||||||
|
|
||||||
|
fullContents += 'Flixel Current State: ${Type.getClassName(Type.getClass(FlxG.state))}\n';
|
||||||
|
|
||||||
|
fullContents += '\n';
|
||||||
|
|
||||||
|
fullContents += '=====================\n';
|
||||||
|
|
||||||
|
fullContents += '\n';
|
||||||
|
|
||||||
fullContents += 'Haxelibs: \n';
|
fullContents += 'Haxelibs: \n';
|
||||||
|
|
||||||
for (lib in Constants.LIBRARY_VERSIONS)
|
for (lib in Constants.LIBRARY_VERSIONS)
|
||||||
|
|
37
source/funkin/util/plugins/ForceCrashPlugin.hx
Normal file
37
source/funkin/util/plugins/ForceCrashPlugin.hx
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
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);
|
||||||
|
|
||||||
|
// Ctrl + Alt + Shift + L = Crash the game for debugging purposes
|
||||||
|
if (FlxG.keys.pressed.CONTROL && FlxG.keys.pressed.ALT && FlxG.keys.pressed.SHIFT && FlxG.keys.justPressed.L)
|
||||||
|
{
|
||||||
|
// TODO: Make this message 87% funnier.
|
||||||
|
throw "DEBUG: Crashing the game via debug keybind!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override function destroy():Void
|
||||||
|
{
|
||||||
|
super.destroy();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue