This commit is contained in:
Rachael Alexanderson 2017-05-19 04:10:25 -04:00
commit 2f743c3128
2 changed files with 5 additions and 5 deletions

View file

@ -106,15 +106,15 @@ class ListMenu : Menu
override bool OnUIEvent(UIEvent ev)
{
if (ev.Type == UIEvent.Type_KeyDown)
if (ev.Type == UIEvent.Type_KeyDown && ev.KeyChar > 0)
{
// tolower
int ch = ev.KeyChar;
ch = ch >= 65 && ch <91? ch + 32 : ch;
ch = ch >= 65 && ch < 91 ? ch + 32 : ch;
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;
MenuSound("menu/cursor");
@ -123,7 +123,7 @@ class ListMenu : Menu
}
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;
MenuSound("menu/cursor");

View file

@ -199,7 +199,7 @@ class ListMenuItemSelectable : ListMenuItem
override bool CheckHotkey(int c)
{
return c == mHotkey;
return c > 0 && c == mHotkey;
}
override bool Activate()