IQuakeCvars
Namespace: QuakeReloaded.Interfaces
Provides access to the game cvars.
public interface IQuakeCvars
Methods
GetPointer(String)
Gets a pointer to the cvar object. This pointer can then be used with other cvar methods in order to optimize speed.
IntPtr GetPointer(string name)
Parameters
name
String
Name of the cvar
Returns
IntPtr
Pointer to the cvar object. If the cvar doesn’t exist, IntPtr.Zero is returned instead.
Exists(String)
Returns whether a specific cvar exists.
bool Exists(string name)
Parameters
name
String
Name of the cvar
Returns
Boolean
True if a cvar with the specified exists, false otherwise.
GetBoolValue(String, Boolean)
Gets a boolean value from a cvar.
bool GetBoolValue(string name, bool defaultValue)
Parameters
name
String
Name of the cvar
defaultValue
Boolean
The default value of the cvar if it isn’t set, value is invalid or doesn’t exist.
Returns
Boolean
The value of the cvar. 0 = false, 1 = true
GetBoolValue(IntPtr, Boolean)
Gets a boolean value from a cvar using a cvar pointer.
bool GetBoolValue(IntPtr pointer, bool defaultValue)
Parameters
pointer
IntPtr
Pointer to the cvar
defaultValue
Boolean
The default value of the cvar if it isn’t set, value is invalid or doesn’t exist.
Returns
Boolean
The value of the cvar. 0 = false, 1 = true
GetFloatValue(String, Single)
Gets a float value from a cvar.
float GetFloatValue(string name, float defaultValue)
Parameters
name
String
Name of the cvar
defaultValue
Single
The default value for the cvar if it isn’t set, value is invalid or doesn’t exist.
Returns
Single
The value of the cvar
GetFloatValue(IntPtr, Single)
Gets a float value from a cvar.
float GetFloatValue(IntPtr pointer, float defaultValue)
Parameters
pointer
IntPtr
Pointer to the cvar
defaultValue
Single
The default value for the cvar if it isn’t set, value is invalid or doesn’t exist.
Returns
Single
The value of the cvar, as a Single
GetStringValue(IntPtr, String)
Gets a string value from a cvar.
string GetStringValue(IntPtr pointer, string defaultValue)
Parameters
pointer
IntPtr
Pointer to the cvar
defaultValue
String
The default value for the cvar if it isn’t set, value is invalid or doesn’t exist.
Returns
String
The value of the cvar, as a String
GetStringValue(String, String)
Gets a string value from a cvar.
string GetStringValue(string name, string defaultValue)
Parameters
name
String
Name of the cvar
defaultValue
String
The default value for the cvar if it isn’t set, value is invalid or doesn’t exist.
Returns
String
The value of the cvar, as a String
GetIntValue(String, Int32)
Gets an Int32 value from a cvar.
int GetIntValue(string name, int defaultValue)
Parameters
name
String
Name of the cvar
defaultValue
Int32
The default value for the cvar if it isn’t set, value is invalid or doesn’t exist.
Returns
Int32
The value of the cvar, as a Single
GetIntValue(IntPtr, Int32)
Gets an Int32 value from a cvar.
int GetIntValue(IntPtr pointer, int defaultValue)
Parameters
pointer
IntPtr
Pointer to the cvar
defaultValue
Int32
The default value for the cvar if it isn’t set, value is invalid or doesn’t exist.
Returns
Int32
The value of the cvar, as a Single
Register(String, String, String, CvarFlags, Single, Single)
Registers a new cvar. If you’re using CvarFlags.Saved make sure to register it in PreInitialize.
IntPtr Register(string name, string defaultValue, string description, CvarFlags flags, float min, float max)
Parameters
name
String
Name of the cvar
defaultValue
String
The initial value of the cvar
description
String
Description that shows in the console
flags
CvarFlags
Attributes of the cvar
min
Single
Minimum cvar value
max
Single
Maximum cvar value
Returns
IntPtr
Pointer to the created cvar
_EXPERIMENTAL_Register(String, String, String, Int32, Single, Single)
Caution
This API is experimental and can be removed at any time
IntPtr _EXPERIMENTAL_Register(string name, string defaultValue, string description, int flags, float min, float max)
Parameters
name
String
defaultValue
String
description
String
flags
Int32
min
Single
max
Single