Пример #1
0
 private static void Bind_c(string[] args)
 {
     if (args.Length == 0)
     {
         string[] bindlist = BindManager.GetAllBindPairs();
         Console.LogInfo("Current bindings:");
         foreach (string s in bindlist)
         {
             Console.Log(s);
         }
     }
     else if (args.Length == 1)
     {
         if (BindManager.TryGetBindCommand(args[0], out string c))
         {
             Console.Log("Key " + args[0] + " is " + c);
         }
     }
     else if (args.Length >= 2)
     {
         string bindArg = string.Join(" ", args, 1, args.Length - 1);
         if (BindManager.SetBind(args[0], bindArg, bindArg.StartsWith("+") ? BindType.hold : BindType.toggle, false))
         {
             Console.LogInfo(args[0] + " -> " + bindArg);
         }
     }
     else
     {
         LogBadArgcount("Cvar", args.Length);
     }
 }
Пример #2
0
 private static void Unbind_c(string[] args)
 {
     if (args.Length == 0)
     {
         string[] bindlist = BindManager.GetAllBindPairs();
         Console.LogInfo("Current bindings:");
         foreach (string s in bindlist)
         {
             Console.Log(s);
         }
     }
     else if (args.Length == 1)
     {
         if (BindManager.RemoveBind(args[0]))
         {
             Console.LogInfo("Removed bind from key " + args[0]);
         }
     }
     else
     {
         LogBadArgcount("Unbind", args.Length);
     }
 }