- Fixed: I forgot to reimplement the number keys for Strife's dialogues when I redid the

menus to work with controllers.

SVN r2103 (trunk)
This commit is contained in:
Randy Heit 2010-01-08 02:10:05 +00:00
parent 870628dda5
commit 1e5b84ea14
2 changed files with 52 additions and 57 deletions

View file

@ -2966,7 +2966,13 @@ bool M_Responder (event_t *ev)
{ {
mkey = MKEY_Clear; mkey = MKEY_Clear;
} }
else if (!keyup && !OptionsActive) else if (!keyup)
{
if (OptionsActive)
{
M_OptResponder(ev);
}
else
{ {
ch = tolower (ch); ch = tolower (ch);
if (messageToPrint) if (messageToPrint)
@ -3002,6 +3008,7 @@ bool M_Responder (event_t *ev)
} }
} }
} }
}
break; break;
} }
} }

View file

@ -2141,11 +2141,10 @@ void M_OptResponder(event_t *ev)
CurrentMenu->items[0].label = OldMessage; CurrentMenu->items[0].label = OldMessage;
CurrentMenu->items[0].type = OldType; CurrentMenu->items[0].type = OldType;
} }
else if (ev->type == EV_GUI_Event && ev->subtype == EV_GUI_KeyDown && tolower(ev->data1) == 't') else if (ev->type == EV_GUI_Event && ev->subtype == EV_GUI_KeyDown)
{
// Test selected resolution
if (CurrentMenu == &ModesMenu)
{ {
if (CurrentMenu == &ModesMenu && (ev->data1 == 't' || ev->data1 == 'T'))
{ // Test selected resolution
if (!(item->type == screenres && if (!(item->type == screenres &&
GetSelectedSize (CurrentItem, &NewWidth, &NewHeight))) GetSelectedSize (CurrentItem, &NewWidth, &NewHeight)))
{ {
@ -2161,6 +2160,23 @@ void M_OptResponder(event_t *ev)
S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", 1, ATTN_NONE); S_Sound (CHAN_VOICE | CHAN_UI, "menu/choose", 1, ATTN_NONE);
SetModesMenu (NewWidth, NewHeight, NewBits); SetModesMenu (NewWidth, NewHeight, NewBits);
} }
else if (ev->data1 >= '0' && ev->data1 <= '9')
{ // Activate an item of type numberedmore
int i;
int num = ev->data1 == '0' ? 10 : ev->data1 - '0';
for (i = 0; i < CurrentMenu->numitems; ++i)
{
menuitem_t *item = CurrentMenu->items + i;
if (item->type == numberedmore && item->b.position == num)
{
CurrentItem = i;
M_OptButtonHandler(MKEY_Enter, false);
break;
}
}
}
} }
} }
@ -2769,35 +2785,7 @@ void M_OptButtonHandler(EMenuKey key, bool repeat)
item->b.key1 = item->c.key2 = 0; item->b.key1 = item->c.key2 = 0;
} }
break; break;
/*
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
{
int lookfor = ch == '0' ? 10 : ch - '0', i;
for (i = 0; i < CurrentMenu->numitems; ++i)
{
if (CurrentMenu->items[i].b.position == lookfor)
{
CurrentItem = i;
item = &CurrentMenu->items[i];
break;
}
}
if (i == CurrentMenu->numitems)
{
break;
}
// Otherwise, fall through to '\r' below
}
*/
case MKEY_Enter: case MKEY_Enter:
if (CurrentMenu == &ModesMenu && item->type == screenres) if (CurrentMenu == &ModesMenu && item->type == screenres)
{ {