diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-08-14 23:23:49 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-08-14 23:23:49 +0000 |
commit | 474793c7638ec859494caef26d03f6e1ce731f87 (patch) | |
tree | b01474bbe5e6dcf85db4f5ed9e0af8ba66c297ec /crawl-ref | |
parent | 99b051c4e4650638e0f902304a649c2ab55c3040 (diff) | |
download | crawl-ref-474793c7638ec859494caef26d03f6e1ce731f87.tar.gz crawl-ref-474793c7638ec859494caef26d03f6e1ce731f87.zip |
Inscribing now only works for items in inventory.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2002 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/describe.cc | 24 | ||||
-rw-r--r-- | crawl-ref/source/describe.h | 2 | ||||
-rw-r--r-- | crawl-ref/source/invent.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/item_use.cc | 2 |
4 files changed, 17 insertions, 13 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index d1d2401f9d..9adc69245b 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -3369,7 +3369,7 @@ static bool describe_spells(const item_def &item) // Describes all items in the game. // //--------------------------------------------------------------- -void describe_item( item_def &item ) +void describe_item( item_def &item, bool allow_inscribe ) { for (;;) { @@ -3391,19 +3391,23 @@ void describe_item( item_def &item ) gotoxy(1, wherey() + 2); tutorial_describe_item(item); } - - gotoxy(1, wherey() + 2); - formatted_string::parse_string("<cyan>Do you wish to inscribe this item? ").display(); - - if (toupper(getch()) == 'Y') + if (allow_inscribe) { - char buf[79]; - cprintf("\nInscribe with what? "); - if (!cancelable_get_line(buf, sizeof buf)) + gotoxy(1, wherey() + 2); + formatted_string::parse_string("<cyan>Do you wish to inscribe this item? ").display(); + + if (toupper(getch()) == 'Y') { - item.inscription = std::string(buf); + char buf[79]; + cprintf("\nInscribe with what? "); + if (!cancelable_get_line(buf, sizeof buf)) + { + item.inscription = std::string(buf); + } } } + else if (getch() == 0) + getch(); } diff --git a/crawl-ref/source/describe.h b/crawl-ref/source/describe.h index d2dcf9edb3..aaa6044e33 100644 --- a/crawl-ref/source/describe.h +++ b/crawl-ref/source/describe.h @@ -43,7 +43,7 @@ void describe_feature_wide(int x, int y); /* *********************************************************************** * called from: item_use - shopping * *********************************************************************** */ -void describe_item( item_def &item ); +void describe_item( item_def &item, bool allow_inscribe = false ); /* *********************************************************************** * called from: direct diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 082b9bb6d1..c3e8603b76 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -536,7 +536,7 @@ unsigned char get_invent( int invent_type ) { const int invidx = letter_to_index(select); if ( is_valid_item(you.inv[invidx]) ) - describe_item( you.inv[invidx] ); + describe_item( you.inv[invidx], true ); } redraw_screen(); return select; diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 5d7a49a509..eeab91d2cc 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -3788,7 +3788,7 @@ void examine_object(void) return; } - describe_item( you.inv[item_slot] ); + describe_item( you.inv[item_slot], true ); redraw_screen(); mesclr(true); } // end original_name() |