diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-23 13:34:16 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-07-23 13:34:16 +0000 |
commit | 041bb51cbf68b460ed41b3d8d42d5522775b7060 (patch) | |
tree | 9778fe1cccb3ae9e694bd0494c0ed6b8b7ed2856 /crawl-ref/source/command.cc | |
parent | 78367ed8343d077b7975873b4319efb6b749079c (diff) | |
download | crawl-ref-041bb51cbf68b460ed41b3d8d42d5522775b7060.tar.gz crawl-ref-041bb51cbf68b460ed41b3d8d42d5522775b7060.zip |
[1757173] Ask user to type "yes" in full to quit. Compulsive quitters can still
macro some key to Qyes\{13}.
Allow macros to enter text in cancelable_get_line prompts.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1914 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/command.cc')
-rw-r--r-- | crawl-ref/source/command.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index 3b4a476490..2103084a76 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -25,6 +25,7 @@ #include "abl-show.h" #include "chardump.h" +#include "cio.h" #include "files.h" #include "invent.h" #include "itemname.h" @@ -49,9 +50,14 @@ static const char *command_string( int i ); void quit_game(void) { - if (yesno("Really quit?", false, 'n')) + char buf[10]; + mpr("Are you sure you want to quit (enter \"yes\" to confirm)? ", + MSGCH_PROMPT); + if (!cancelable_get_line(buf, sizeof buf) && !strcasecmp(buf, "yes")) ouch(INSTANT_DEATH, 0, KILLED_BY_QUITTING); -} // end quit_game() + else + canned_msg(MSG_OK); +} static const char *features[] = { "Stash-tracking", |