public static void SetVar(ConCommandArgs args)
        {
            if (args.args.Length == 2)
            {
                GameConsole.ConsoleMessage(args.args[0].ToLower() + ": " + GetVar(args.args[0]));
            }
            else if (args.args.Length == 3)
            {

                SetVar(args.args[0], args.args[1]);
                GameConsole.ConsoleMessage(args.args[0].ToLower() +" = "+ args.args[1]);
            }
            else
            {
                GameConsole.ConsoleMessage("Usage: Set [Ident] [Value]");
            }
        }
 public static void Quit(ConCommandArgs args)
 {
     Watertight.GetGame().Shutdown();
 }
 public static void Msg(ConCommandArgs args)
 {
     GameConsole.ConsoleMessage(args.ArgString);
 }
 private static void ToggleConsole(ConCommandArgs args)
 {
 }
 private static void Ls(ConCommandArgs args)
 {
     foreach (KeyValuePair<string, ConsoleCommand> kv in commands)
     {
         ConsoleMessage(kv.Key);
     }
 }
 private static void InvokeCommand(string commandname, ConCommandArgs args)
 {
     MethodInfo command = commands[commandname.ToLower()].cmd;
     command.Invoke(null, new[] { args });
 }
        public static void DoCommand(string InString)
        {
            if (InString == string.Empty) return; //Make sure we don't react to empty strings

            string[] input = ParseInput(InString);
            string cmdString = input[0].ToLower();
            if (!commands.ContainsKey(cmdString))
            {
                ConsoleMessage("Unknown Console Command: " + input[0]);
                return;
            }
            ConsoleCommand command = commands[cmdString];
            if (!command.Silent)
            {
                ConsoleMessage("> " + InString);
            }
            ConCommandArgs args = new ConCommandArgs();
            args.CommandName = input[0];
            args.args = new string[input.Length];
            for (int i = 1; i < input.Length; i++)
            {
                args.args[i - 1] = input[i];
            }
            InvokeCommand(cmdString, args);
        }
Example #8
0
 private static void ToggleConsole(ConCommandArgs args)
 {
 }
Example #9
0
        private static void InvokeCommand(string commandname, ConCommandArgs args)
        {
            MethodInfo command = commands[commandname.ToLower()].cmd;

            command.Invoke(null, new[] { args });
        }
Example #10
0
 public static void Quit(ConCommandArgs args)
 {
     //Watertight.GetGame().Shutdown();
 }
Example #11
0
 public static void Msg(ConCommandArgs args)
 {
     GameConsole.ConsoleMessage(args.ArgString);
 }