![]() |
ezEngine
Release 25.03
|
[internal] Helper class to implement ezCVarInt, ezCVarFlag, ezCVarBool and ezCVarString. More...
#include <CVar.h>
Public Member Functions | |
ezTypedCVar (ezStringView sName, const Type &value, ezBitflags< ezCVarFlags > flags, ezStringView sDescription) | |
operator const Type & () const | |
Returns the 'current' value of the CVar. Same as 'GetValue(ezCVarValue::Current)'. | |
const Type & | GetValue (ezCVarValue::Enum val=ezCVarValue::Current) const |
Returns the internal values of the CVar. | |
void | operator= (const Type &value) |
Changes the CVar's value and broadcasts the proper events. More... | |
virtual ezCVarType::Enum | GetType () const override |
Returns the type of the CVar. | |
virtual void | SetToDelayedSyncValue () override |
Copies the 'DelayedSync' value into the 'Current' value. More... | |
bool | HasDelayedSyncValueChanged () const |
Checks whether a new value was set and now won't be visible until SetToDelayedSyncValue() is called. | |
![]() | |
ezStringView | GetName () const |
Returns the (display) name of the CVar. | |
ezStringView | GetDescription () const |
Returns the description of the CVar. | |
ezBitflags< ezCVarFlags > | GetFlags () const |
Returns all the CVar flags. | |
ezStringView | GetPluginName () const |
Returns the name of the plugin which this CVar is declared in. | |
Friends | |
class | ezCVar |
Additional Inherited Members | |
![]() | |
using | CVarEvents = ezEvent< const ezCVarEvent &, ezMutex, ezStaticsAllocatorWrapper > |
![]() | |
static void | SetStorageFolder (ezStringView sFolder) |
Sets the path (folder) in which all CVar setting files should be stored. More... | |
static ezCVar * | FindCVarByName (ezStringView sName) |
Searches all CVars for one with the given name. Returns nullptr if no CVar could be found. The name is case-insensitive. | |
static void | SaveCVars () |
Stores all CVar values in files in the storage folder, that must have been set via 'SetStorageFolder'. More... | |
static void | SaveCVarsToFile (ezStringView sPath, bool bIgnoreSaveFlag=false) |
Stores all CVar values into the given file. More... | |
static void | LoadCVars (bool bOnlyNewOnes=true, bool bSetAsCurrentValue=true) |
Calls LoadCVarsFromCommandLine() and then LoadCVarsFromFile() | |
static void | LoadCVarsFromFile (bool bOnlyNewOnes=true, bool bSetAsCurrentValue=true, ezDynamicArray< ezCVar * > *pOutCVars=nullptr) |
Loads the CVars from the settings files in the storage folder. More... | |
static void | LoadCVarsFromFile (ezStringView sPath, bool bOnlyNewOnes=true, bool bSetAsCurrentValue=true, bool bIgnoreSaveFlag=false, ezDynamicArray< ezCVar * > *pOutCVars=nullptr) |
Loads all CVars from the given file. Does not account for any plug-in specific files. More... | |
static void | LoadCVarsFromCommandLine (bool bOnlyNewOnes=true, bool bSetAsCurrentValue=true, ezDynamicArray< ezCVar * > *pOutCVars=nullptr) |
Similar to LoadCVarsFromFile() but tries to get the CVar values from the command line. More... | |
static void | ListOfCVarsChanged (ezStringView sSetPluginNameTo) |
Call this after creating or destroying CVars dynamically (not through loading plugins) to allow UIs to update their state. More... | |
![]() | |
static const ezRTTI * | GetStaticRTTI () |
![]() | |
CVarEvents | m_CVarEvents |
Code that needs to be execute whenever a cvar is changed can register itself here to be notified of such events. | |
![]() | |
static ezEvent< const ezCVarEvent & > | s_AllCVarEvents |
Broadcasts changes to ANY CVar. Thus code that needs to update when any one of them changes can use this to be notified. | |
![]() | |
ezCVar (ezStringView sName, ezBitflags< ezCVarFlags > Flags, ezStringView sDescription) | |
![]() | |
ezEnumerable * | m_pNextInstance |
[internal] Helper class to implement ezCVarInt, ezCVarFlag, ezCVarBool and ezCVarString.
void ezTypedCVar< Type, CVarType >::operator= | ( | const Type & | value | ) |
Changes the CVar's value and broadcasts the proper events.
Usually the 'Current' value is changed, unless the 'RequiresDelayedSync' flag is set. In that case only the 'DelayedSync' value is modified.
|
overridevirtual |
Copies the 'DelayedSync' value into the 'Current' value.
This change will not trigger a 'delayed sync value changed' event, but it might trigger a 'current value changed' event. Code that uses a CVar that is flagged as 'RequiresDelayedSync' for its initialization (and which is the reason, that that CVar is flagged as such) should always call this BEFORE it uses the CVar value.
Implements ezCVar.