Example #1
0
        // Cvar_Set()
        public static void Set(string name, string value)
        {
            cvar var = Find(name);

            if (var == null)
            {
                // there is an error in C code if this happens
                Con.Print("Cvar.Set: variable {0} not found\n", name);
                return;
            }
            var.Set(value);
        }
Example #2
0
        // Cvar_Command()
        // Handles variable inspection and changing from the console
        public static bool Command()
        {
            // check variables
            cvar var = Find(cmd.Argv(0));

            if (var == null)
            {
                return(false);
            }

            // perform a variable print or set
            if (cmd.Argc == 1)
            {
                Con.Print("\"{0}\" is \"{1}\"\n", var._Name, var._String);
            }
            else
            {
                var.Set(cmd.Argv(1));
            }
            return(true);
        }