diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-08 07:52:36 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-08 07:52:36 +0000 |
commit | cebfd4f93efdfe6cc517f1bda0a59699a8149d3e (patch) | |
tree | 6793a9eed2d7ba84c0c1577c7b85ac20ad6058b9 /crawl-ref/source/food.cc | |
parent | e94375e1a0ecdbfa3032609c29a42eb071d3682a (diff) | |
download | crawl-ref-cebfd4f93efdfe6cc517f1bda0a59699a8149d3e.tar.gz crawl-ref-cebfd4f93efdfe6cc517f1bda0a59699a8149d3e.zip |
Apply previous fixes to 0.4.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6450 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/food.cc')
-rw-r--r-- | crawl-ref/source/food.cc | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index b915203df7..1f4ece801e 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -1187,26 +1187,33 @@ int eat_from_floor() } found_valid = true; - std::ostringstream prompt; - prompt << (you.species == SP_VAMPIRE ? "Drink blood from" : "Eat") - << ' ' << ((si->quantity > 1) ? "one of " : "") - << si->name(DESC_NOCAP_A) << '?'; + mprf(MSGCH_PROMPT, "%s %s%s? (ye/n/q/i?)", + (you.species == SP_VAMPIRE ? "Drink blood from" : "Eat"), + ((si->quantity > 1) ? "one of " : ""), + si->name(DESC_NOCAP_A).c_str()); - const int ans = yesnoquit( prompt.str().c_str(), true, 0, false, false, - 'E' ); - - if (ans == -1) // quit - return -1; - else if (ans == 1) // yes + int keyin = tolower(c_getch()); + switch (keyin) { + case 'q': + canned_msg(MSG_OK); + return -1; + case 'e': + case 'y': if (can_ingest(si->base_type, si->sub_type, false)) { eat_floor_item(si->index()); return 1; } need_more = true; + case 'i': + case '?': + // Directly skip ahead to inventory. + return (0); + default: + // Else no: try next one. + break; } - // else no: try next one } if (!found_valid) @@ -1245,7 +1252,7 @@ int eat_from_floor() if (need_more && Options.auto_list) more(); - return (false); + return (0); } static const char *_chunk_flavour_phrase(bool likes_chunks) |