Example #1
0
        void Execute(string prefix = null)
        {
            IList <CCommand> cmds = CRegistery.ListCommands(prefix);

            foreach (CCommand cmd in cmds)
            {
                CVarCommand cvarCmd = cmd as CVarCommand;
                if (cvarCmd != null)
                {
                    cvarCmd.ParentCommand = this;
                    cvarCmd.SetDefault();
                    cvarCmd.ParentCommand = null;
                }
            }
        }
Example #2
0
        bool Execute(string name)
        {
            CVarCommand cmd = CRegistery.FindCvarCommand(name);

            if (cmd == null)
            {
                PrintError("Can't find cvar: '{0}'", name);
                return(false);
            }

            cmd.ParentCommand = this;
            cmd.SetDefault();
            cmd.ParentCommand = null;

            return(true);
        }
Example #3
0
        bool Execute(string cvarName)
        {
            CVarCommand cmd = CRegistery.FindCvarCommand(cvarName);

            if (cmd == null)
            {
                PrintError("Can't find cvar '" + cvarName + "'");
                return(false);
            }

            if (!cmd.IsInt)
            {
                PrintError("Can't toggle non-int value");
                return(false);
            }

            cmd.ParentCommand = this;
            cmd.SetValue(cmd.BoolValue ? 0 : 1);
            cmd.ParentCommand = null;

            return(true);
        }