From 9b663069fe25975eadd0c85ea7a3af08dea32937 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 13 Aug 2007 15:54:31 +0000 Subject: 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 --- crawl-ref/source/describe.cc | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/describe.cc') 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("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); + } + } + } -- cgit v1.2.3-54-g00ecf