mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-04-07 18:42:36 +00:00
add default cvar getters
This commit is contained in:
parent
f1e6445e82
commit
9f6c1d65c5
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…
Reference in a new issue