summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/describe.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-15 00:06:02 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-15 00:06:02 +0000
commit3afc16e7cfabead8fcd91fc77d066f5abb8fbc5b (patch)
tree10a849e5d29ab29c5bdbe703ca04fb917c91ff3c /crawl-ref/source/describe.cc
parent762270f5b068efc28fa82bc45efa29bd790efac6 (diff)
downloadcrawl-ref-3afc16e7cfabead8fcd91fc77d066f5abb8fbc5b.tar.gz
crawl-ref-3afc16e7cfabead8fcd91fc77d066f5abb8fbc5b.zip
Bug 2017912: fix item quote taking up too much screen space. A hack until
quotes are separated out into their own DB. Also, don't use item quotes when doing an item dump or during tutorial. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6547 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r--crawl-ref/source/describe.cc23
1 files changed, 20 insertions, 3 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 9799d95d9f..d7dd7d100d 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -1612,8 +1612,11 @@ bool is_dumpable_artefact( const item_def &item, bool verbose)
//
//---------------------------------------------------------------
std::string get_item_description( const item_def &item, bool verbose,
- bool dump )
+ bool dump, bool noquote )
{
+ if (dump)
+ noquote = true;
+
std::ostringstream description;
if (!dump)
@@ -1674,7 +1677,7 @@ std::string get_item_description( const item_def &item, bool verbose,
{
std::string db_name = item.name(DESC_DBNAME, true, false, false);
std::string db_desc =
- getLongDescription(db_name, is_artefact(item));
+ getLongDescription(db_name, is_artefact(item) || noquote);
if (db_desc.empty())
{
@@ -1956,7 +1959,21 @@ void describe_feature_wide(int x, int y)
// Returns true if spells can be shown to player.
static bool _show_item_description(const item_def &item)
{
- const std::string description = get_item_description( item, 1 );
+ const unsigned int lineWidth = get_number_of_cols() - 1;
+ const int height = get_number_of_lines();
+
+ std::string description = get_item_description( item, 1, false,
+ Options.tutorial_left);
+
+ int num_lines = _count_desc_lines(description, lineWidth) + 1;
+
+ // XXX: hack: Leave room for "Inscribe item?" and the blank line above
+ // it by removing item quote. This should really be taken care of
+ // by putting the quotes into a separate DB and treating them as
+ // a suffix that can be ignored by print_description().
+ if (height - num_lines <= 2)
+ description = get_item_description( item, 1, false, true);
+
print_description(description);
if (Options.tutorial_left)
tutorial_describe_item(item);