From 15f1bce94eec21fe9e11ee7e6745d01ccd4cfa70 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Thu, 20 Oct 2011 23:19:32 +0000 Subject: Confirm quit game when the window close button is clicked a second time. Subversion-branch: /branches/v2-branch Subversion-revision: 2449 --- src/doom/m_menu.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/doom') diff --git a/src/doom/m_menu.c b/src/doom/m_menu.c index bae11cc8..a21060b1 100644 --- a/src/doom/m_menu.c +++ b/src/doom/m_menu.c @@ -1310,7 +1310,6 @@ M_StartMessage } - void M_StopMessage(void) { menuactive = messageLastMenuActive; @@ -1447,8 +1446,19 @@ boolean M_Responder (event_t* ev) // "close" button pressed on window? if (ev->type == ev_quit) { - S_StartSound(NULL,sfx_swtchn); - M_QuitDOOM(0); + // First click on close button = bring up quit confirm message. + // Second click on close button = confirm quit + + if (menuactive && messageToPrint && messageRoutine == M_QuitResponse) + { + M_QuitResponse(key_menu_confirm); + } + else + { + S_StartSound(NULL,sfx_swtchn); + M_QuitDOOM(0); + } + return true; } -- cgit v1.2.3