struct ICVar { enum EConsoleLogMode { eCLM_Off, eCLM_ConsoleAndFile, eCLM_FileOnly, eCLM_FullInfo }; };
IConsole.h
This interface is the 1:1 "C++ representation" of a console variable.
A console variable is accessible in C++ trough this interface and in all scripts as global variable (with the same name of the variable in the console)
enum EConsoleLogMode { eCLM_Off, eCLM_ConsoleAndFile, eCLM_FileOnly, eCLM_FullInfo };
IConsole.h
Members |
Description |
eCLM_Off |
off |
eCLM_ConsoleAndFile |
normal info to console and file |
eCLM_FileOnly |
normal info to file only |
eCLM_FullInfo |
full info to file only |
virtual ~ICVar();
virtual void AddOnChangeFunctor(const SFunctor& pChangeFunctor) = 0;
Adds a new on change functor to the list. It will add from index 1 on (0 is reserved).
virtual void ClearFlags(int flags) = 0;
clear the specified bits in the flag field
virtual void DebugLog(const int iExpectedValue, const EConsoleLogMode mode) const;
only useful for CVarGroups log difference between expected state and real state
virtual void ForceSet(const char* s) = 0;
Force to set the string value of the variable - can be called from inside code only @param s string representation the value
virtual const char * GetDataProbeString() const = 0;
Return the data probe string value of the variable, don't store pointer as multiple calls to this function might return same memory ptr @return the value
virtual int GetFlags() const = 0;
return the variable's flags @return the variable's flags
virtual float GetFVal() const = 0;
Return the float value of the variable @return the value
virtual const char* GetHelp() = 0;
return the variable's help text @return the variable's help text, can be 0 if no help is available
virtual int64 GetI64Val() const = 0;
Return the 64-bit integer value of the variable @return the value
virtual int GetIVal() const = 0;
Return the integer value of the variable @return the value
virtual void GetMemoryUsage(class ICrySizer* pSizer) const = 0;
virtual const char* GetName() const = 0;
return the variable's name @return the variable's name
virtual uint64 GetNumberOfOnChangeFunctors() const = 0;
Returns the number of registered on change functos.
virtual ConsoleVarFunc GetOnChangeCallback() const = 0;
Get the current callback function.
virtual const SFunctor& GetOnChangeFunctor(uint64 nFunctorIndex) const = 0;
Returns the number of registered on change functors.
virtual int GetRealIVal() const = 0;
value that would represent the state, -1 if the state cannot be found
only useful for CVarGroups, other types return GetIVal() CVarGroups set multiple other CVars and this function returns the integer value the CVarGroup should have, when looking at the controlled cvars
virtual const char * GetString() const = 0;
Return the string value of the variable, don't store pointer as multiple calls to this function might return same memory ptr @return the value
virtual int GetType() = 0;
return the primary variable's type @return the primary variable's type e.g. CVAR_INT, CVAR_FLOAT, CVAR_STRING
virtual bool IsConstCVar() const = 0;
return if the variable may be modified in config files @return if the variable may be modified in config files
virtual void Release() = 0;
delete the variable
the variable will automatically unregister itself from the console
virtual bool RemoveOnChangeFunctor(const uint64 nElement) = 0;
Removes an on change functor returns true if removal was successful.
virtual void Set(const char* s) = 0;
set the string value of the variable @param s string representation the value
virtual void Set(const float f) = 0;
set the float value of the variable @param s float representation the value
virtual void Set(const int i) = 0;
set the float value of the variable @param s integer representation the value
virtual int SetFlags(int flags) = 0;
Set the variable's flags
virtual void SetOnChangeCallback(ConsoleVarFunc pChangeFunc) = 0;
Set a new on change function callback. Deprecated function. The functor should be preferred.