mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-24 00:42:32 +00:00
M_ChangeCvar: Split out core of function into M_ChangeCvarDirect, to prevent future code duplication
This commit is contained in:
parent
3ca1c554c4
commit
a2fadd2ff4
2 changed files with 7 additions and 4 deletions
|
|
@ -576,7 +576,7 @@ boolean M_MenuButtonPressed(UINT8 pid, UINT32 bt);
|
|||
boolean M_MenuButtonHeld(UINT8 pid, UINT32 bt);
|
||||
|
||||
boolean M_ChangeStringCvar(INT32 choice);
|
||||
|
||||
void M_ChangeCvarDirect(INT32 choice, consvar_t *cv);
|
||||
boolean M_NextOpt(void);
|
||||
boolean M_PrevOpt(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -132,10 +132,8 @@ static void Dummystaff_OnChange(void)
|
|||
// BASIC MENU HANDLING
|
||||
// =========================================================================
|
||||
|
||||
static void M_ChangeCvar(INT32 choice)
|
||||
void M_ChangeCvarDirect(INT32 choice, consvar_t *cv)
|
||||
{
|
||||
consvar_t *cv = currentMenu->menuitems[itemOn].itemaction.cvar;
|
||||
|
||||
// Backspace sets values to default value
|
||||
if (choice == -1)
|
||||
{
|
||||
|
|
@ -170,6 +168,11 @@ static void M_ChangeCvar(INT32 choice)
|
|||
}
|
||||
}
|
||||
|
||||
static void M_ChangeCvar(INT32 choice)
|
||||
{
|
||||
M_ChangeCvarDirect(choice, currentMenu->menuitems[itemOn].itemaction.cvar);
|
||||
}
|
||||
|
||||
boolean M_NextOpt(void)
|
||||
{
|
||||
INT16 oldItemOn = itemOn; // prevent infinite loop
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue