Example #1
0
 public void RemoveFlaggedAutoCompletion(CVAR flags)
 {
     foreach (var cvar in cvars.Values)
     {
         if ((cvar.Flags & flags) != 0)
         {
             cvar.valueCompletion = null;
         }
     }
 }
Example #2
0
 public void WriteFlaggedVariables(CVAR flags, string setCmd, VFile f)
 {
     foreach (var cvar in cvars.Values)
     {
         if ((cvar.Flags & flags) != 0)
         {
             f.Printf($"{setCmd} {cvar.Name} \"{cvar.String}\"\n");
         }
     }
 }
Example #3
0
 public void ResetFlaggedVariables(CVAR flags)
 {
     foreach (var cvar in cvars.Values)
     {
         if ((cvar.Flags & flags) != 0)
         {
             cvar.Set(null, true, true);
         }
     }
 }
Example #4
0
 public Dictionary <string, string> MoveCVarsToDict(CVAR flags)
 {
     moveCVarsToDict.Clear();
     foreach (var cvar in cvars.Values)
     {
         if ((cvar.Flags & flags) != 0)
         {
             moveCVarsToDict[cvar.Name] = cvar.String;
         }
     }
     return(moveCVarsToDict);
 }
Example #5
0
        public void SetInternal(string name, string value, CVAR flags)
        {
            var local = FindLocal(name);

            if (local != null)
            {
                local.InternalSetString(value); local.flags |= flags & ~CVAR.STATIC; local.UpdateCheat();
            }
            else
            {
                local = new CVarLocal(name, value, flags); cvars[local.nameString] = local;
            }
        }
Example #6
0
 public CVarLocal(string newName, string newValue, CVAR newFlags)
 {
     nameString        = newName;
     name              = nameString;
     valueString       = newValue;
     value             = valueString;
     resetString       = newValue;
     descriptionString = string.Empty;
     description       = descriptionString;
     flags             = (newFlags & ~CVAR.STATIC) | CVAR.MODIFIED;
     valueMin          = 1;
     valueMax          = -1;
     valueStrings      = null;
     valueCompletion   = null;
     UpdateValue();
     UpdateCheat();
     internalVar = this;
 }
Example #7
0
 public void ClearModifiedFlags(CVAR flags) => modifiedFlags &= ~flags;
Example #8
0
 public void SetModifiedFlags(CVAR flags) => modifiedFlags |= flags;
Example #9
0
 public void SetCVarFloat(string name, float value, CVAR flags   = 0) => SetInternal(name, value.ToString(), flags);
Example #10
0
 public void SetCVarInteger(string name, int value, CVAR flags   = 0) => SetInternal(name, value.ToString(), flags);
Example #11
0
 public void SetCVarBool(string name, bool value, CVAR flags     = 0) => SetInternal(name, value.ToString(), flags);
Example #12
0
 public void SetCVarString(string name, string value, CVAR flags = 0) => SetInternal(name, value, flags);