public void RemoveFlaggedAutoCompletion(CVAR flags) { foreach (var cvar in cvars.Values) { if ((cvar.Flags & flags) != 0) { cvar.valueCompletion = null; } } }
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"); } } }
public void ResetFlaggedVariables(CVAR flags) { foreach (var cvar in cvars.Values) { if ((cvar.Flags & flags) != 0) { cvar.Set(null, true, true); } } }
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); }
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; } }
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; }
public void ClearModifiedFlags(CVAR flags) => modifiedFlags &= ~flags;
public void SetModifiedFlags(CVAR flags) => modifiedFlags |= flags;
public void SetCVarFloat(string name, float value, CVAR flags = 0) => SetInternal(name, value.ToString(), flags);
public void SetCVarInteger(string name, int value, CVAR flags = 0) => SetInternal(name, value.ToString(), flags);
public void SetCVarBool(string name, bool value, CVAR flags = 0) => SetInternal(name, value.ToString(), flags);
public void SetCVarString(string name, string value, CVAR flags = 0) => SetInternal(name, value, flags);