mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-18 03:22:35 +00:00
menubehaviourflags_t: Add MBF_NOLOOPENTRIES
Abstracts one previously hardcoded exception to M_NextOpt/M_PrevOpt
This commit is contained in:
parent
e162fffecf
commit
c8f74aef2b
3 changed files with 12 additions and 9 deletions
|
|
@ -131,8 +131,9 @@ void M_HandlePauseMenuGametype(INT32 choice);
|
|||
|
||||
typedef enum
|
||||
{
|
||||
MBF_UD_LR_FLIPPED = 1, // flip up-down and left-right axes
|
||||
MBF_SOUNDLESS = 2, // do not play base menu sounds
|
||||
MBF_UD_LR_FLIPPED = 1, // flip up-down and left-right axes
|
||||
MBF_SOUNDLESS = 1<<1, // do not play base menu sounds
|
||||
MBF_NOLOOPENTRIES = 1<<2, // do not loop M_NextOpt/M_PrevOpt
|
||||
} menubehaviourflags_t;
|
||||
|
||||
struct menuitem_t
|
||||
|
|
|
|||
|
|
@ -159,10 +159,11 @@ boolean M_NextOpt(void)
|
|||
if (itemOn + 1 > currentMenu->numitems - 1)
|
||||
{
|
||||
// Prevent looparound here
|
||||
// If you're going to add any extra exceptions, DON'T.
|
||||
// Add a "don't loop" flag to the menu_t struct instead.
|
||||
if (currentMenu == &MISC_AddonsDef)
|
||||
if (currentMenu->behaviourflags & MBF_NOLOOPENTRIES)
|
||||
{
|
||||
itemOn = oldItemOn;
|
||||
return false;
|
||||
}
|
||||
itemOn = 0;
|
||||
}
|
||||
else
|
||||
|
|
@ -186,10 +187,11 @@ boolean M_PrevOpt(void)
|
|||
if (!itemOn)
|
||||
{
|
||||
// Prevent looparound here
|
||||
// If you're going to add any extra exceptions, DON'T.
|
||||
// Add a "don't loop" flag to the menu_t struct instead.
|
||||
if (currentMenu == &MISC_AddonsDef)
|
||||
if (currentMenu->behaviourflags & MBF_NOLOOPENTRIES)
|
||||
{
|
||||
itemOn = oldItemOn;
|
||||
return false;
|
||||
}
|
||||
itemOn = currentMenu->numitems - 1;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ menu_t MISC_AddonsDef = {
|
|||
MISC_AddonsMenu,
|
||||
50, 28,
|
||||
0, 0,
|
||||
0,
|
||||
MBF_NOLOOPENTRIES,
|
||||
"EXTRAS",
|
||||
0, 0,
|
||||
M_DrawAddons,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue