diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-01 19:42:19 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-04-01 19:42:19 +0000 |
commit | 3156b39e958b466c424a27e888861e029ddb0602 (patch) | |
tree | c7fc0722864bad6adf523bbfb0af0ce9d90951ea /crawl-ref/source/stuff.cc | |
parent | 99beaf9eb5a1ef9ee360732140f89dae8e44d57c (diff) | |
download | crawl-ref-3156b39e958b466c424a27e888861e029ddb0602.tar.gz crawl-ref-3156b39e958b466c424a27e888861e029ddb0602.zip |
Yet Another Code Cleanup, this time concentrating on libx11.cc and
view.cc. (Yes, this is semi-random.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4032 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/stuff.cc')
-rw-r--r-- | crawl-ref/source/stuff.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/crawl-ref/source/stuff.cc b/crawl-ref/source/stuff.cc index 8f2055badc..b43efaa035 100644 --- a/crawl-ref/source/stuff.cc +++ b/crawl-ref/source/stuff.cc @@ -794,9 +794,8 @@ bool yesno( const char *str, bool safe, int safeanswer, bool clear_after, interrupt_activity( AI_FORCE_INTERRUPT ); std::string prompt = make_stringf("%s ", str ? str : "Buggy prompt?"); - // std::string prompt = make_stringf("%s (y/n) ", str); - for (;;) + while (true) { if ( !noprompt ) mpr(prompt.c_str(), MSGCH_PROMPT); @@ -806,9 +805,11 @@ bool yesno( const char *str, bool safe, int safeanswer, bool clear_after, if (map && map->find(tmp) != map->end()) tmp = map->find(tmp)->second; - if ((tmp == ' ' || tmp == 27 || tmp == '\r' || tmp == '\n') - && safeanswer) + if (safeanswer + && (tmp == ' ' || tmp == 27 || tmp == '\r' || tmp == '\n')) + { tmp = safeanswer; + } if (Options.easy_confirm == CONFIRM_ALL_EASY || tmp == safeanswer @@ -888,9 +889,10 @@ int yesnoquit( const char* str, bool safe, int safeanswer, interrupt_activity( AI_FORCE_INTERRUPT ); std::string prompt = make_stringf("%s%s ", str ? str : "Buggy prompt?", - _list_allowed_keys(alt_yes, alt_yes2, safe)); + _list_allowed_keys(alt_yes, alt_yes2, + safe)); - while (1) + while (true) { mpr(prompt.c_str(), MSGCH_PROMPT); @@ -917,8 +919,10 @@ int yesnoquit( const char* str, bool safe, int safeanswer, else if (tmp == 'Y' || tmp == alt_yes) return 1; else + { mprf("[Y]es%s, [N]o or [Q]uit only, please.", _list_alternative_yes(alt_yes, alt_yes2, false, true).c_str()); + } } } |