File tree Expand file tree Collapse file tree 3 files changed +27
-5
lines changed Expand file tree Collapse file tree 3 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ using StringTools;
25
25
/**
26
26
* A powerful console for the flixel debugger screen with supports custom commands, registering
27
27
* objects and functions and saves the last 25 commands used. Inspired by Eric Smith's "CoolConsole".
28
- * @link http://www.youtube.com/watch?v=QWfpw7elWk8
28
+ * @see http://www.youtube.com/watch?v=QWfpw7elWk8
29
29
*/
30
30
class Console extends Window
31
31
{
@@ -306,12 +306,23 @@ class Console extends Window
306
306
/**
307
307
* Register a new class to use in any command.
308
308
*
309
- * @param cl The class to register.
309
+ * @param cl The class to register.
310
310
*/
311
311
public inline function registerClass (cl : Class <Dynamic >)
312
312
{
313
313
registerObject (FlxStringUtil .getClassName (cl , true ), cl );
314
314
}
315
+
316
+ /**
317
+ * Register a new enum to use in any command.
318
+ *
319
+ * @param e The enum to register.
320
+ * @since 4.4.0
321
+ */
322
+ public inline function registerEnum (e : Enum <Dynamic >)
323
+ {
324
+ registerObject (FlxStringUtil .getEnumName (e , true ), e );
325
+ }
315
326
316
327
override public function destroy ()
317
328
{
Original file line number Diff line number Diff line change @@ -67,7 +67,8 @@ class ConsoleCommands
67
67
console .registerClass (FlxPoint );
68
68
console .registerClass (FlxRect );
69
69
70
- console .registerObject (" FlxDebuggerLayout" , FlxDebuggerLayout );
70
+ console .registerEnum (FlxDebuggerLayout );
71
+
71
72
console .registerObject (" selection" , null );
72
73
}
73
74
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ class ConsoleFrontEnd
46
46
/**
47
47
* Register a new class to use in any command.
48
48
*
49
- * @param cl The class to register.
49
+ * @param cl The class to register.
50
50
*/
51
51
public inline function registerClass (cl : Class <Dynamic >): Void
52
52
{
@@ -56,8 +56,18 @@ class ConsoleFrontEnd
56
56
}
57
57
58
58
/**
59
- * Just needed to create an instance.
59
+ * Register a new enum to use in any command.
60
+ *
61
+ * @param e The enum to register.
62
+ * @since 4.4.0
60
63
*/
64
+ public inline function registerEnum (e : Enum <Dynamic >): Void
65
+ {
66
+ #if FLX_DEBUG
67
+ FlxG .game .debugger .console .registerEnum (e );
68
+ #end
69
+ }
70
+
61
71
@:allow (flixel. FlxG )
62
72
private function new () {}
63
73
}
You can’t perform that action at this time.
0 commit comments