diff --git a/Plugins/IngameDebugConsole/Scripts/DebugLogConsole.cs b/Plugins/IngameDebugConsole/Scripts/DebugLogConsole.cs index f8c0a5d..3eaf83e 100644 --- a/Plugins/IngameDebugConsole/Scripts/DebugLogConsole.cs +++ b/Plugins/IngameDebugConsole/Scripts/DebugLogConsole.cs @@ -54,6 +54,9 @@ public static class DebugLogConsole { public delegate bool ParseFunction( string input, out object output ); + public delegate void CommandExecutedDelegate( string command, object[] parameters ); + public static event CommandExecutedDelegate OnCommandExecuted; + // All the commands private static readonly List methods = new List(); private static readonly List matchingMethods = new List( 4 ); @@ -212,6 +215,11 @@ public static void SearchAssemblyForConsoleMethods( Assembly assembly ) } } + public static List GetAllCommands() + { + return methods; + } + // Logs the list of available commands public static void LogAllCommands() { @@ -745,6 +753,9 @@ public static void ExecuteCommand( string command ) else Debug.Log( "Returned: " + result.ToString() ); } + + if( OnCommandExecuted != null ) + OnCommandExecuted( methodToExecute.command, parameters ); } } @@ -1507,4 +1518,4 @@ private static bool ParseVector( string input, Type vectorType, out object outpu return true; } } -} \ No newline at end of file +}