mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-31 04:20:34 +00:00
- don't freeze if the menu item search can't find anything selectable.
This commit is contained in:
parent
d8c009bb41
commit
4d2b9fbe1b
1 changed files with 4 additions and 0 deletions
|
@ -156,7 +156,9 @@ bool DListMenu::Responder (event_t *ev)
|
|||
|
||||
bool DListMenu::MenuEvent (int mkey, bool fromcontroller)
|
||||
{
|
||||
int oldSelect = mDesc->mSelectedItem;
|
||||
int startedAt = mDesc->mSelectedItem;
|
||||
if (startedAt < 0) startedAt = 0;
|
||||
|
||||
switch (mkey)
|
||||
{
|
||||
|
@ -166,6 +168,7 @@ bool DListMenu::MenuEvent (int mkey, bool fromcontroller)
|
|||
if (--mDesc->mSelectedItem < 0) mDesc->mSelectedItem = mDesc->mItems.Size()-1;
|
||||
}
|
||||
while (!mDesc->mItems[mDesc->mSelectedItem]->Selectable() && mDesc->mSelectedItem != startedAt);
|
||||
if (mDesc->mSelectedItem == startedAt) mDesc->mSelectedItem = oldSelect;
|
||||
S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", snd_menuvolume, ATTN_NONE);
|
||||
return true;
|
||||
|
||||
|
@ -175,6 +178,7 @@ bool DListMenu::MenuEvent (int mkey, bool fromcontroller)
|
|||
if (++mDesc->mSelectedItem >= (int)mDesc->mItems.Size()) mDesc->mSelectedItem = 0;
|
||||
}
|
||||
while (!mDesc->mItems[mDesc->mSelectedItem]->Selectable() && mDesc->mSelectedItem != startedAt);
|
||||
if (mDesc->mSelectedItem == startedAt) mDesc->mSelectedItem = oldSelect;
|
||||
S_Sound (CHAN_VOICE | CHAN_UI, "menu/cursor", snd_menuvolume, ATTN_NONE);
|
||||
return true;
|
||||
|
||||
|
|
Loading…
Reference in a new issue