diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-15 18:51:46 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-03-15 18:51:46 +0000 |
commit | 24dd7bfc967050b9fcead40e820742feffe3ac49 (patch) | |
tree | 9a3f3fb2ea561bfc65beb1a9b0e3ffb45b23135a /crawl-ref/source/describe.cc | |
parent | 7426d8145861b8ec8bb2b95ca0f541cc94ac343b (diff) | |
download | crawl-ref-24dd7bfc967050b9fcead40e820742feffe3ac49.tar.gz crawl-ref-24dd7bfc967050b9fcead40e820742feffe3ac49.zip |
* Add deck names to card descriptions, and vice versa. This should
eventually be done procedurally but for now this will do.
* Use non-verbose descriptions when hovering over spellbooks in Tiles,
so the description will include the spell list.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9506 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r-- | crawl-ref/source/describe.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 3e61fce6f1..9b43b76a8c 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -2082,7 +2082,7 @@ std::string get_item_description( const item_def &item, bool verbose, } return description.str(); -} // end get_item_description() +} static std::string _marker_feature_description(const coord_def &pos) { @@ -2193,9 +2193,13 @@ void set_feature_desc_long(const std::string &raw_name, desc_table[raw_name] = desc; } -void get_item_desc(const item_def &item, describe_info &inf) +void get_item_desc(const item_def &item, describe_info &inf, bool terse) { - inf.body << get_item_description(item, true, false, Options.tutorial_left); + // Don't use verbose descriptions if terse and the item contains spells, + // so we can actually output these spells if space is scarce. + const bool verbose = !terse || !item.has_spells(); + inf.body << get_item_description(item, verbose, false, + Options.tutorial_left); } // Returns true if spells can be shown to player. @@ -2228,11 +2232,9 @@ static bool _show_item_description(const item_def &item) formatted_string fs; item_def dup = item; - spellbook_contents( dup, - item.base_type == OBJ_BOOKS? - RBOOK_READ_SPELL - : RBOOK_USE_STAFF, - &fs ); + spellbook_contents( dup, item.base_type == OBJ_BOOKS ? RBOOK_READ_SPELL + : RBOOK_USE_STAFF, + &fs ); fs.display(2, -2); return (true); } |