From 041bb51cbf68b460ed41b3d8d42d5522775b7060 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Mon, 23 Jul 2007 13:34:16 +0000 Subject: [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 --- crawl-ref/source/cio.cc | 2 +- crawl-ref/source/command.cc | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/cio.cc b/crawl-ref/source/cio.cc index 23305e556c..91f1ddd295 100644 --- a/crawl-ref/source/cio.cc +++ b/crawl-ref/source/cio.cc @@ -335,7 +335,7 @@ int line_reader::read_line(bool clear_previous) for ( ; ; ) { - int ch = c_getch(); + int ch = getchm(c_getch); if (keyfn) { 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", -- cgit v1.2.3-54-g00ecf