diff --git a/src/k_menu.h b/src/k_menu.h index 8d0e0b5a3..6ae486504 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -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 diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 55b308fbf..2c2bf3d40 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -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 diff --git a/src/menus/extras-addons.c b/src/menus/extras-addons.c index 147f6e714..6ecf56398 100644 --- a/src/menus/extras-addons.c +++ b/src/menus/extras-addons.c @@ -23,7 +23,7 @@ menu_t MISC_AddonsDef = { MISC_AddonsMenu, 50, 28, 0, 0, - 0, + MBF_NOLOOPENTRIES, "EXTRAS", 0, 0, M_DrawAddons,