summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/describe.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-17 11:11:48 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-17 11:11:48 +0000
commitb077eb8665d53ff4c307678ad0c6ca07d73b623e (patch)
treea552e7374e2763f38d79e39828a5e5afa1109f2c /crawl-ref/source/describe.cc
parentc76e3a228cfc6bc3b115c99278b38f21bdc733af (diff)
downloadcrawl-ref-b077eb8665d53ff4c307678ad0c6ca07d73b623e.tar.gz
crawl-ref-b077eb8665d53ff4c307678ad0c6ca07d73b623e.zip
Apply several recent commits to 0.4.1
* r6547 (Matthew's item quote patch) * r6550 (Haran's mapmark patch, no idea what part it plays in fixing the bug but it surely won't hurt) * r6561 (Haran's hell effects patch) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6584 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 18ffe14195..cf4f1e96b8 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);