summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Howard2011-10-20 23:19:32 +0000
committerSimon Howard2011-10-20 23:19:32 +0000
commit15f1bce94eec21fe9e11ee7e6745d01ccd4cfa70 (patch)
tree0eed440b0593e2d2ba9d4e35889d54bb1fafad75 /src
parent112bc3fcab6654c20bc980a04d377b5b03044067 (diff)
downloadchocolate-doom-15f1bce94eec21fe9e11ee7e6745d01ccd4cfa70.tar.gz
chocolate-doom-15f1bce94eec21fe9e11ee7e6745d01ccd4cfa70.tar.bz2
chocolate-doom-15f1bce94eec21fe9e11ee7e6745d01ccd4cfa70.zip
Confirm quit game when the window close button is clicked a second time.
Subversion-branch: /branches/v2-branch Subversion-revision: 2449
Diffstat (limited to 'src')
-rw-r--r--src/doom/m_menu.c16
-rw-r--r--src/heretic/mn_menu.c15
-rw-r--r--src/hexen/mn_menu.c16
-rw-r--r--src/strife/m_menu.c15
4 files changed, 53 insertions, 9 deletions
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;
}
diff --git a/src/heretic/mn_menu.c b/src/heretic/mn_menu.c
index 4db108cf..bba0da5c 100644
--- a/src/heretic/mn_menu.c
+++ b/src/heretic/mn_menu.c
@@ -1066,8 +1066,19 @@ boolean MN_Responder(event_t * event)
// "close" button pressed on window?
if (event->type == ev_quit)
{
- SCQuitGame(0);
- S_StartSound(NULL, sfx_chat);
+ // First click on close = bring up quit confirm message.
+ // Second click = confirm quit.
+
+ if (!MenuActive && askforquit && typeofask == 1)
+ {
+ G_CheckDemoStatus();
+ I_Quit();
+ }
+ else
+ {
+ SCQuitGame(0);
+ S_StartSound(NULL, sfx_chat);
+ }
return true;
}
diff --git a/src/hexen/mn_menu.c b/src/hexen/mn_menu.c
index 0bd942a4..94f6b1a3 100644
--- a/src/hexen/mn_menu.c
+++ b/src/hexen/mn_menu.c
@@ -1162,8 +1162,20 @@ boolean MN_Responder(event_t * event)
// "close" button pressed on window?
if (event->type == ev_quit)
{
- SCQuitGame(0);
- S_StartSound(NULL, SFX_CHAT);
+ // First click on close = bring up quit confirm message.
+ // Second click = confirm quit.
+
+ if (!MenuActive && askforquit && typeofask == 1)
+ {
+ G_CheckDemoStatus();
+ I_Quit();
+ }
+ else
+ {
+ SCQuitGame(0);
+ S_StartSound(NULL, SFX_CHAT);
+ }
+
return true;
}
diff --git a/src/strife/m_menu.c b/src/strife/m_menu.c
index 1593bdf2..2fa63abc 100644
--- a/src/strife/m_menu.c
+++ b/src/strife/m_menu.c
@@ -1686,8 +1686,19 @@ boolean M_Responder (event_t* ev)
// "close" button pressed on window?
if (ev->type == ev_quit)
{
- S_StartSound(NULL, sfx_swtchn);
- M_QuitStrife(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_QuitStrife(0);
+ }
+
return true;
}