add default cvar getters
This commit is contained in:
parent
5a5bed5c31
commit
dcbd66a528
2 changed files with 25 additions and 0 deletions
|
|
@ -902,6 +902,27 @@ DEFINE_ACTION_FUNCTION(_CVar, GetString)
|
|||
ACTION_RETURN_STRING(v.String);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(_CVar, GetDefaultInt)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FBaseCVar);
|
||||
auto v = self->GetGenericRepDefault(CVAR_Int);
|
||||
ACTION_RETURN_INT(v.Int);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(_CVar, GetDefaultFloat)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FBaseCVar);
|
||||
auto v = self->GetGenericRepDefault(CVAR_Float);
|
||||
ACTION_RETURN_FLOAT(v.Float);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(_CVar, GetDefaultString)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FBaseCVar);
|
||||
auto v = self->GetGenericRepDefault(CVAR_String);
|
||||
ACTION_RETURN_STRING(v.String);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(_CVar, SetInt)
|
||||
{
|
||||
// Only menus are allowed to change CVARs.
|
||||
|
|
|
|||
|
|
@ -696,6 +696,10 @@ struct CVar native
|
|||
native int GetInt();
|
||||
native double GetFloat();
|
||||
native String GetString();
|
||||
bool GetDefaultBool() { return GetDefaultInt(); }
|
||||
native int GetDefaultInt();
|
||||
native double GetDefaultFloat();
|
||||
native String GetDefaultString();
|
||||
void SetBool(bool b) { SetInt(b); }
|
||||
native void SetInt(int v);
|
||||
native void SetFloat(double v);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue