summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/invent.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-17 13:43:42 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-17 13:43:42 +0000
commitf672c6472dfa1ac6fa64f1d77e5701589576ca6c (patch)
tree96309e9add139ef71e0ba3f529f7502ebb2e1530 /crawl-ref/source/invent.cc
parent7a0cf4fa055dbebc676db78dde82881be8a6e6af (diff)
downloadcrawl-ref-f672c6472dfa1ac6fa64f1d77e5701589576ca6c.tar.gz
crawl-ref-f672c6472dfa1ac6fa64f1d77e5701589576ca6c.zip
Allow specific colouring of pickup menu (as opposed to general
inventory). To do so, use "pickup:colour:pattern". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4287 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/invent.cc')
-rw-r--r--crawl-ref/source/invent.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index 71850082ba..01e5bd5543 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -558,19 +558,20 @@ void InvMenu::load_items(const std::vector<const item_def*> &mitems,
menu_letter ckey;
std::vector<InvEntry*> items_in_class;
-
const menu_sort_condition *cond = find_menu_sort_condition();
for (int i = 0; i < NUM_OBJECT_CLASSES; ++i)
{
- if (!inv_class[i]) continue;
+ if (!inv_class[i])
+ continue;
add_entry( new MenuEntry( item_class_name(i), MEL_SUBTITLE ) );
items_in_class.clear();
for (int j = 0, count = mitems.size(); j < count; ++j)
{
- if (mitems[j]->base_type != i) continue;
+ if (mitems[j]->base_type != i)
+ continue;
items_in_class.push_back( new InvEntry(*mitems[j]) );
}
@@ -579,6 +580,8 @@ void InvMenu::load_items(const std::vector<const item_def*> &mitems,
for (unsigned int j = 0; j < items_in_class.size(); ++j)
{
InvEntry *ie = items_in_class[j];
+ if (this->tag == "pickup")
+ ie->tag = "pickup";
// If there's no hotkey, provide one.
if (ie->hotkeys[0] == ' ')
ie->hotkeys[0] = ckey++;
@@ -738,6 +741,8 @@ std::vector<SelItem> select_items( const std::vector<const item_def*> &items,
InvMenu menu;
menu.set_type(mtype);
menu.set_title(title);
+ if (mtype == MT_PICKUP)
+ menu.set_tag("pickup");
menu.load_items(items);
menu.set_flags(noselect ? MF_NOSELECT | MF_SHOW_PAGENUMBERS :
MF_MULTISELECT | MF_ALLOW_FILTER | MF_SHOW_PAGENUMBERS);