diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-09-17 02:55:58 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-09-17 02:55:58 +0000 |
commit | 0bc00794625760f93f2d1fd20a78d02aaa7299f9 (patch) | |
tree | 871ae18ee6f478dc7c331bf95011a9efa183a6fc /crawl-ref/source/itemname.cc | |
parent | 27a123d67702ee2b24b29df5374cb9a95f53d5af (diff) | |
download | crawl-ref-0bc00794625760f93f2d1fd20a78d02aaa7299f9.tar.gz crawl-ref-0bc00794625760f93f2d1fd20a78d02aaa7299f9.zip |
A handful of new game options:
menu_colour_prefix_id, if set to true, causes the identification state
of an object to be prefixed to the string menu colour regexes are
matched against (but does not alter the string displayed on the screen).
menu_colour_prefix_class, if set to true, prefixes the object's base type
to the string menu colour regexes are matched against.
user_note_prefix can be set to a string which will be prefixed to
manual user notes when they are displayed, to make them easier to find.
detailed_hunger, if set to true, will cause three new informational-only
hunger states to be displayed: near starving, very hungry and very full.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2121 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r-- | crawl-ref/source/itemname.cc | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 0fa28e52c2..783951d8b9 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -1986,3 +1986,54 @@ bool is_interesting_item( const item_def& item ) return (true); return (false); } + +const std::string menu_colour_item_prefix(const item_def &item) +{ + std::string str = ""; + + if (Options.menu_colour_prefix_id) + { + if (item_ident(item, ISFLAG_KNOW_TYPE) + || item.base_type == OBJ_FOOD + || item.base_type == OBJ_CORPSES) + { + str += "identified "; + } + else + { + if (get_ident_type(item.base_type, + item.sub_type) == ID_KNOWN_TYPE) + { + // Wands are only fully identified if we know the + // number of charges. + if (item.base_type == OBJ_WANDS) + str += "known "; + // Rings are fully identified simply by knowing their + // type, unless the ring has plusses, like a ring of + // dexterity. + else if (item.base_type == OBJ_JEWELLERY + && !jewellery_is_amulet(item)) + { + if (item.plus == 0 && item.plus2 == 0) + str += "identified "; + else + str += "known "; + } + // All other types of magical items are fully identified + // simply by knowing the type + else + str += "identified "; + } + else + str += "unidentified "; + } + } + + if (Options.menu_colour_prefix_class) + { + str += item_class_name(item.base_type, true) + " "; + } + + return str; +} + |