mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-20 15:02:37 +00:00
consvar_t: add step_amount field, used by menus
This commit is contained in:
parent
99baf4e8e1
commit
9df8dd2bc0
3 changed files with 9 additions and 2 deletions
|
|
@ -156,6 +156,7 @@ struct consvar_t //NULL, NULL, 0, NULL, NULL |, 0, NULL, NULL, 0, 0, NULL
|
|||
INT32 flags; // flags see cvflags_t above
|
||||
CV_PossibleValue_t *PossibleValue; // table of possible values
|
||||
void (*func)(void); // called on change, if CV_CALL set
|
||||
INT32 step_amount;
|
||||
const char *description;
|
||||
INT32 value; // for INT32 and fixed_t
|
||||
const char *string; // value in string
|
||||
|
|
@ -217,7 +218,7 @@ struct CVarList;
|
|||
#define CVAR_INIT consvar_t
|
||||
#else
|
||||
#define CVAR_INIT( ... ) \
|
||||
{ __VA_ARGS__, NULL, 0, NULL, NULL, {0, {NULL}}, 0U, (char)0, NULL }
|
||||
{ __VA_ARGS__, 0, NULL, 0, NULL, NULL, {0, {NULL}}, 0U, (char)0, NULL }
|
||||
#endif
|
||||
|
||||
extern consvar_t *consvar_vars; // list of registered console variables
|
||||
|
|
|
|||
|
|
@ -92,6 +92,12 @@ struct consvar_t::Builder
|
|||
return *this;
|
||||
}
|
||||
|
||||
Builder& step_amount(INT32 step_amount)
|
||||
{
|
||||
var_.step_amount = step_amount;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Builder& save()
|
||||
{
|
||||
var_.flags |= CV_SAVE;
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ void M_ChangeCvarDirect(INT32 choice, consvar_t *cv)
|
|||
}
|
||||
else if (cv->flags & CV_FLOAT)
|
||||
{
|
||||
M_AddFloatVar(cv, (FRACUNIT/16) * choice);
|
||||
M_AddFloatVar(cv, (cv->step_amount ? cv->step_amount : FRACUNIT/16) * choice);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue