Have "Clear Marks" key clear just the last mark (#808)

This commit is contained in:
Alaux 2022-11-17 03:41:40 -03:00 committed by GitHub
parent cb26aa9b89
commit 9bcf2be8a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 5 deletions

View File

@ -647,6 +647,13 @@ void AM_clearMarks(void)
markpointnum = 0; markpointnum = 0;
} }
// [Alaux] Clear just the last mark
static void AM_clearLastMark(void)
{
if (markpointnum)
markpointnum--;
}
void AM_enableSmoothLines(void) void AM_enableSmoothLines(void)
{ {
AM_drawFline = map_smooth_lines ? AM_drawFline_Smooth : AM_drawFline_Vanilla; AM_drawFline = map_smooth_lines ? AM_drawFline_Smooth : AM_drawFline_Vanilla;
@ -925,10 +932,15 @@ boolean AM_Responder
} }
else if (M_InputActivated(input_map_clear)) else if (M_InputActivated(input_map_clear))
{ {
AM_clearMarks(); // Ty 03/27/98 - *not* externalized // [Alaux] Clear just the last mark
plr->message = s_AMSTR_MARKSCLEARED; // ^ if (!markpointnum)
} // | plr->message = s_AMSTR_MARKSCLEARED;
else // phares else {
AM_clearLastMark();
doomprintf("Cleared spot %d", markpointnum);
}
}
else
if (M_InputActivated(input_map_overlay)) if (M_InputActivated(input_map_overlay))
{ {
automapoverlay = !automapoverlay; automapoverlay = !automapoverlay;

View File

@ -2997,7 +2997,7 @@ setup_menu_t keys_settings6[] = // Key Binding screen strings
{"SHIFT LEFT" ,S_INPUT ,m_map ,KB_X,M_Y+10*M_SPC,{0},input_map_left}, {"SHIFT LEFT" ,S_INPUT ,m_map ,KB_X,M_Y+10*M_SPC,{0},input_map_left},
{"SHIFT RIGHT",S_INPUT ,m_map ,KB_X,M_Y+11*M_SPC,{0},input_map_right}, {"SHIFT RIGHT",S_INPUT ,m_map ,KB_X,M_Y+11*M_SPC,{0},input_map_right},
{"MARK PLACE" ,S_INPUT ,m_map ,KB_X,M_Y+12*M_SPC,{0},input_map_mark}, {"MARK PLACE" ,S_INPUT ,m_map ,KB_X,M_Y+12*M_SPC,{0},input_map_mark},
{"CLEAR MARKS",S_INPUT ,m_map ,KB_X,M_Y+13*M_SPC,{0},input_map_clear}, {"CLEAR LAST MARK",S_INPUT ,m_map ,KB_X,M_Y+13*M_SPC,{0},input_map_clear},
{"FULL/ZOOM" ,S_INPUT ,m_map ,KB_X,M_Y+14*M_SPC,{0},input_map_gobig}, {"FULL/ZOOM" ,S_INPUT ,m_map ,KB_X,M_Y+14*M_SPC,{0},input_map_gobig},
{"GRID" ,S_INPUT ,m_map ,KB_X,M_Y+15*M_SPC,{0},input_map_grid}, {"GRID" ,S_INPUT ,m_map ,KB_X,M_Y+15*M_SPC,{0},input_map_grid},