Skip to content

Commit

Permalink
Select next active option if previous one no longer is
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-drexler committed Dec 29, 2023
1 parent dc4a493 commit 6f3b8ef
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Quake/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -3397,6 +3397,7 @@ static qboolean M_Options_IsSelectable (int index)
index += optionsmenu.first_item;
return
(unsigned int) index < countof (options_names) &&
(unsigned int) index < (unsigned int)optionsmenu.list.numitems &&
options_names[index][0] != '\0'
;
}
Expand Down Expand Up @@ -3461,6 +3462,10 @@ void M_Options_Init (enum m_state_e state)

M_List_ClearSearch (&optionsmenu.list);

// If the cursor is on an inactive item, move it to the next active one
if (!M_Options_IsSelectable (optionsmenu.list.cursor))
M_List_SelectNextActive (&optionsmenu.list, optionsmenu.list.cursor, 1, true);

M_Options_UpdateLayout ();
}

Expand Down

0 comments on commit 6f3b8ef

Please sign in to comment.