diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-08-13 15:54:31 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-08-13 15:54:31 +0000 |
commit | 9b663069fe25975eadd0c85ea7a3af08dea32937 (patch) | |
tree | 027ce75a02900323bdda3f2d10673d1db387533d /crawl-ref/source/describe.cc | |
parent | a9ce7ae8b24aa41d98b331f10fa68dbfad90fd46 (diff) | |
download | crawl-ref-9b663069fe25975eadd0c85ea7a3af08dea32937.tar.gz crawl-ref-9b663069fe25975eadd0c85ea7a3af08dea32937.zip |
Allow inscription when viewing items.
This also works in shops which I think is okay.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1994 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r-- | crawl-ref/source/describe.cc | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 25ef73103e..8d081759a9 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -34,6 +34,7 @@ #include "externs.h" #include "abl-show.h" +#include "cio.h" #include "debug.h" #include "decks.h" #include "fight.h" @@ -3360,7 +3361,7 @@ static bool describe_spells(const item_def &item) // Describes all items in the game. // //--------------------------------------------------------------- -void describe_item( const item_def &item ) +void describe_item( item_def &item ) { for (;;) { @@ -3371,14 +3372,25 @@ void describe_item( const item_def &item ) textcolor(LIGHTGREY); cprintf("Select a spell to read its description."); if (!describe_spells(item)) - return; + break; continue; } break; } - if (getch() == 0) - getch(); + gotoxy(1, wherey() + 2); + formatted_string::parse_string("<cyan>Do you wish to inscribe this item? ").display(); + + if (toupper(getch()) == 'Y') + { + char buf[79]; + cprintf("\nInscribe with what? "); + if (!cancelable_get_line(buf, sizeof buf)) + { + item.inscription = std::string(buf); + } + } + } |