menu fixes

* Esc key doesn't change input mode

* Fix warning and help messages in mouse mode
This commit is contained in:
Roman Fomin 2024-04-23 18:43:29 +07:00
parent 44045866fa
commit 8f0ba6e119
2 changed files with 7 additions and 6 deletions

View File

@ -2581,6 +2581,10 @@ boolean M_Responder(event_t *ev)
return false;
case ev_keydown:
if (menu_input == mouse_mode && M_InputActivated(input_menu_escape))
{
break;
}
menu_input = key_mode;
ch = ev->data1;
break;

View File

@ -922,18 +922,14 @@ void MN_DrawDelVerify(void)
static void DrawInstructions()
{
int flags = current_menu[set_item_on].m_flags;
int index = (menu_input == mouse_mode ? highlight_item : set_item_on);
int flags = current_menu[index].m_flags;
if (ItemDisabled(flags) || print_warning_about_changes > 0)
{
return;
}
if (menu_input == mouse_mode && !(flags & S_HILITE))
{
return;
}
// There are different instruction messages depending on whether you
// are changing an item or just sitting on it.
@ -2926,6 +2922,7 @@ boolean MN_SetupCursorPostion(int x, int y)
if (highlight_item != i)
{
print_warning_about_changes = false;
highlight_item = i;
M_StartSound(sfx_itemup);
}