Menu: Hotkeys should only select selectable items.

This commit is contained in:
svdijk 2017-05-18 20:35:54 +02:00 committed by Christoph Oelckers
parent bb1e927c46
commit 4b8f4212ef

View file

@ -114,7 +114,7 @@ class ListMenu : Menu
for(int i = mDesc.mSelectedItem + 1; i < mDesc.mItems.Size(); i++) for(int i = mDesc.mSelectedItem + 1; i < mDesc.mItems.Size(); i++)
{ {
if (mDesc.mItems[i].CheckHotkey(ch)) if (mDesc.mitems[i].Selectable() && mDesc.mItems[i].CheckHotkey(ch))
{ {
mDesc.mSelectedItem = i; mDesc.mSelectedItem = i;
MenuSound("menu/cursor"); MenuSound("menu/cursor");
@ -123,7 +123,7 @@ class ListMenu : Menu
} }
for(int i = 0; i < mDesc.mSelectedItem; i++) for(int i = 0; i < mDesc.mSelectedItem; i++)
{ {
if (mDesc.mItems[i].CheckHotkey(ch)) if (mDesc.mitems[i].Selectable() && mDesc.mItems[i].CheckHotkey(ch))
{ {
mDesc.mSelectedItem = i; mDesc.mSelectedItem = i;
MenuSound("menu/cursor"); MenuSound("menu/cursor");