Skip to content

Commit

Permalink
Do not scroll menu item value if menu is not active
Browse files Browse the repository at this point in the history
  • Loading branch information
JNechaevsky committed Dec 21, 2024
1 parent eb25bcb commit f545ee6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/doom/m_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -6072,7 +6072,7 @@ boolean M_Responder (event_t* ev)
}

// [JN] Scrolls through menu item values or navigates between pages.
if (ev->data1 & (1 << 4))
if (ev->data1 & (1 << 4) && menuactive)
{
if (currentMenu->menuitems[itemOn].status == 2)
{
Expand All @@ -6081,14 +6081,14 @@ boolean M_Responder (event_t* ev)
S_StartSound(NULL,sfx_stnmov);
}
else
if (menuactive && currentMenu->ScrollAR && !saveStringEnter && !KbdIsBinding)
if (currentMenu->ScrollAR && !saveStringEnter && !KbdIsBinding)
{
M_ScrollPages(1);
}
mousewait = I_GetTime();
}
else
if (ev->data1 & (1 << 3))
if (ev->data1 & (1 << 3) && menuactive)
{
if (currentMenu->menuitems[itemOn].status == 2)
{
Expand All @@ -6097,7 +6097,7 @@ boolean M_Responder (event_t* ev)
S_StartSound(NULL,sfx_stnmov);
}
else
if (menuactive && currentMenu->ScrollAR && !saveStringEnter && !KbdIsBinding)
if (currentMenu->ScrollAR && !saveStringEnter && !KbdIsBinding)
{
M_ScrollPages(0);

Expand Down
8 changes: 4 additions & 4 deletions src/heretic/mn_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -5889,7 +5889,7 @@ boolean MN_Responder(event_t * event)
}

// [JN] Scrolls through menu item values or navigates between pages.
if (/*mousebprevweapon >= 0 &&*/ event->data1 & (1 << 4/*mousebprevweapon*/))
if (event->data1 & (1 << 4) && MenuActive)
{
if (CurrentMenu->items[CurrentItPos].type == ITT_LRFUNC)
{
Expand All @@ -5898,14 +5898,14 @@ boolean MN_Responder(event_t * event)
S_StartSound(NULL, sfx_keyup);
}
else
if (MenuActive && CurrentMenu->ScrollAR && !FileMenuKeySteal && !KbdIsBinding)
if (CurrentMenu->ScrollAR && !FileMenuKeySteal && !KbdIsBinding)
{
M_ScrollPages(1);
}
mousewait = I_GetTime();
}
else
if (/*mousebnextweapon >= 0 &&*/ event->data1 & (1 << 3/*mousebnextweapon*/))
if (event->data1 & (1 << 3) && MenuActive)
{
if (CurrentMenu->items[CurrentItPos].type == ITT_LRFUNC)
{
Expand All @@ -5914,7 +5914,7 @@ boolean MN_Responder(event_t * event)
S_StartSound(NULL, sfx_keyup);
}
else
if (MenuActive && CurrentMenu->ScrollAR && !FileMenuKeySteal && !KbdIsBinding)
if (CurrentMenu->ScrollAR && !FileMenuKeySteal && !KbdIsBinding)
{
M_ScrollPages(0);
}
Expand Down
8 changes: 4 additions & 4 deletions src/hexen/mn_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -5305,7 +5305,7 @@ boolean MN_Responder(event_t * event)
}

// [JN] Scrolls through menu item values or navigates between pages.
if (event->data1 & (1 << 4))
if (event->data1 & (1 << 4) && MenuActive)
{
if (CurrentMenu->items[CurrentItPos].type == ITT_LRFUNC)
{
Expand All @@ -5314,14 +5314,14 @@ boolean MN_Responder(event_t * event)
S_StartSound(NULL, SFX_PICKUP_KEY);
}
else
if (MenuActive && CurrentMenu->ScrollAR && !FileMenuKeySteal && !KbdIsBinding)
if (CurrentMenu->ScrollAR && !FileMenuKeySteal && !KbdIsBinding)
{
M_ScrollPages(1);
}
mousewait = I_GetTime();
}
else
if (event->data1 & (1 << 3))
if (event->data1 & (1 << 3) && MenuActive)
{
if (CurrentMenu->items[CurrentItPos].type == ITT_LRFUNC)
{
Expand All @@ -5330,7 +5330,7 @@ boolean MN_Responder(event_t * event)
S_StartSound(NULL, SFX_PICKUP_KEY);
}
else
if (MenuActive && CurrentMenu->ScrollAR && !FileMenuKeySteal && !KbdIsBinding)
if (CurrentMenu->ScrollAR && !FileMenuKeySteal && !KbdIsBinding)
{
M_ScrollPages(0);
}
Expand Down

0 comments on commit f545ee6

Please sign in to comment.