remove same input element in menu instead of ignoring (#1041)

* edit help string
This commit is contained in:
Roman Fomin 2023-05-07 21:18:12 +07:00 committed by GitHub
parent a37167944c
commit ae0281d38b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2627,7 +2627,7 @@ void M_DrawInstructions()
{ // killough 11/98: reformatted
const char *s = "";
int color = CR_HILITE,x = setup_select ? color = CR_SELECT,
flags & S_INPUT ? (s = "Press key or button for this action", 49) :
flags & S_INPUT ? (s = "Press key or button to bind/unbind", 50) :
flags & S_YESNO ? (s = "Press ENTER key to toggle", 78) :
// [FG] selection of choices
flags & (S_CHOICE|S_CRITEM|S_THERMO)
@ -6040,6 +6040,14 @@ boolean M_Responder (event_t* ev)
group = ptr1->m_group;
if ((ch = ev->data1) == -1)
return true;
if (M_InputMatchJoyB(s_input, ch))
{
M_InputRemoveJoyB(s_input, ch);
M_SelectDone(ptr1);
return true;
}
for (i = 0 ; keys_settings[i] && search ; i++)
for (ptr2 = keys_settings[i] ; !(ptr2->m_flags & S_END) ; ptr2++)
if (ptr2->m_group == group && ptr1 != ptr2)
@ -6074,6 +6082,14 @@ boolean M_Responder (event_t* ev)
group = ptr1->m_group;
if ((ch = ev->data1) == -1)
return true;
if (M_InputMatchMouseB(s_input, ch))
{
M_InputRemoveMouseB(s_input, ch);
M_SelectDone(ptr1);
return true;
}
// Don't bind movement and turning to mouse wheel. It needs to
// be impossible to input a one-frame of movement automatically
// in speedrunning.
@ -6113,6 +6129,13 @@ boolean M_Responder (event_t* ev)
// bound to that S_KEEP action, and that action has to
// keep that key.
if (M_InputMatchKey(s_input, ch))
{
M_InputRemoveKey(s_input, ch);
M_SelectDone(ptr1);
return true;
}
group = ptr1->m_group;
for (i = 0 ; keys_settings[i] && search ; i++)
for (ptr2 = keys_settings[i] ; !(ptr2->m_flags & S_END) ; ptr2++)