summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/docs/options_guide.txt4
-rw-r--r--crawl-ref/source/itemname.cc16
-rw-r--r--crawl-ref/source/itemname.h22
-rw-r--r--crawl-ref/source/items.cc2
4 files changed, 18 insertions, 26 deletions
diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt
index 224d86d347..6215c2e9b2 100644
--- a/crawl-ref/docs/options_guide.txt
+++ b/crawl-ref/docs/options_guide.txt
@@ -1331,8 +1331,8 @@ menu_colour = <match>:<colour>:<regex>
When looking for menu_colour matches, these prefixes are prepended to
the actual item name, e.g. in the form of
- identified, evil_item wand of draining (4)
- unidentified, equipped, artefact sparkling ring (left hand)
+ identified evil_item wand of draining (4)
+ unidentified equipped artefact sparkling ring (left hand)
The same prefixes can also be used for highlighting prompts pertaining
to items matching the description, or to define autopickup_exceptions.
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 9e463fe46f..9f10028228 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -2248,7 +2248,7 @@ bool is_interesting_item( const item_def& item )
return (true);
}
- const std::string iname = menu_colour_item_prefix(item, false)
+ const std::string iname = menu_colour_item_prefix(item, false) + " "
+ item.name(DESC_PLAIN);
for (unsigned i = 0; i < Options.note_items.size(); ++i)
if (Options.note_items[i].matches(iname))
@@ -2765,18 +2765,18 @@ static const std::string _item_prefix(const item_def &item, bool temp,
return result;
}
-const std::string menu_colour_item_prefix(const item_def &item, bool temp)
+std::string menu_colour_item_prefix(const item_def &item, bool temp)
{
return _item_prefix(item, temp, false);
}
-const std::string filtering_item_prefix(const item_def &item, bool temp)
+std::string filtering_item_prefix(const item_def &item, bool temp)
{
return _item_prefix(item, temp, true);
}
-const std::string get_menu_colour_prefix_tags(item_def &item,
- description_level_type desc)
+std::string get_menu_colour_prefix_tags(const item_def &item,
+ description_level_type desc)
{
std::string cprf = menu_colour_item_prefix(item);
std::string colour = "";
@@ -2798,9 +2798,9 @@ const std::string get_menu_colour_prefix_tags(item_def &item,
return (item_name);
}
-const std::string get_message_colour_tags(item_def &item,
- description_level_type desc,
- msg_channel_type channel)
+std::string get_message_colour_tags(const item_def &item,
+ description_level_type desc,
+ msg_channel_type channel)
{
std::string cprf = menu_colour_item_prefix(item);
std::string colour = "";
diff --git a/crawl-ref/source/itemname.h b/crawl-ref/source/itemname.h
index a7b7bcd268..1e46bb866f 100644
--- a/crawl-ref/source/itemname.h
+++ b/crawl-ref/source/itemname.h
@@ -114,27 +114,19 @@ void set_ident_type( item_def &item, item_type_id_state_type setting,
void set_ident_type( object_class_type basetype, int subtype,
item_type_id_state_type setting, bool force = false);
-/* ***********************************************************************
- * called from: command - itemname - invent.h
- * *********************************************************************** */
-const std::string menu_colour_item_prefix(const item_def &item,
- bool temp = true);
-const std::string filtering_item_prefix(const item_def &item,
- bool temp = true);
-const std::string get_menu_colour_prefix_tags(item_def &item,
- description_level_type desc);
-const std::string get_message_colour_tags(item_def &item,
- description_level_type desc,
- msg_channel_type channel = MSGCH_PLAIN);
+std::string menu_colour_item_prefix(const item_def &item, bool temp = true);
+std::string filtering_item_prefix(const item_def &item, bool temp = true);
+std::string get_menu_colour_prefix_tags(const item_def &item,
+ description_level_type desc);
+std::string get_message_colour_tags(const item_def &item,
+ description_level_type desc,
+ msg_channel_type channel = MSGCH_PLAIN);
void init_item_name_cache();
item_types_pair item_types_by_name(std::string name);
std::vector<std::string> item_name_list_for_glyph(unsigned glyph);
-/* ***********************************************************************
- * called from: newgame
- * *********************************************************************** */
const char* wand_type_name(int wandtype);
bool is_named_corpse(const item_def &corpse);
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index c91e3bd8d3..e0fec19f33 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -2293,7 +2293,7 @@ void autoinscribe()
static inline std::string _autopickup_item_name(const item_def &item)
{
return userdef_annotate_item(STASH_LUA_SEARCH_ANNOTATE, &item, true)
- + menu_colour_item_prefix(item, false)
+ + menu_colour_item_prefix(item, false) + " "
+ item.name(DESC_PLAIN);
}