summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/invent.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-15 20:12:11 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-15 20:12:11 +0000
commitd82ee4ebd849c7bfebb8d9998604e63767849efb (patch)
tree9c60b216c873b3a257b3eee09cd7fc41296aa26c /crawl-ref/source/invent.cc
parent778880771386e5f111aca28d397c5d32f3e7dca0 (diff)
downloadcrawl-ref-d82ee4ebd849c7bfebb8d9998604e63767849efb.tar.gz
crawl-ref-d82ee4ebd849c7bfebb8d9998604e63767849efb.zip
Minor cleanups.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1477 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/invent.cc')
-rw-r--r--crawl-ref/source/invent.cc26
1 files changed, 3 insertions, 23 deletions
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index d45051a80d..121768c4d7 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -61,33 +61,13 @@ std::string InvTitle::get_text() const
InvEntry::InvEntry( const item_def &i ) : MenuEntry( "", MEL_ITEM ), item( &i )
{
data = const_cast<item_def *>( item );
-
- if (i.base_type == OBJ_GOLD)
- {
- // XXX XXX FIXME XXX XXX Why the special-casing?
- char buf[ITEMNAME_SIZE];
- snprintf(buf, sizeof buf, "%d gold piece%s", i.quantity,
- (i.quantity > 1? "s" : ""));
- text = buf;
- }
- else
- {
- text = i.name(in_inventory(i)? DESC_INVENTORY_EQUIP : DESC_NOCAP_A,
- false);
- }
+ text = i.name(DESC_NOCAP_A, false);
if (i.base_type != OBJ_GOLD && in_inventory(i))
- {
- // FIXME: This is HORRIBLE! We're skipping the inventory letter prefix
- // which looks like this: "a - ".
- text = text.substr( 4 );
add_hotkey(index_to_letter( i.link ));
- }
else
- {
- // Dummy hotkey for gold or non-inventory items.
- add_hotkey(' ');
- }
+ add_hotkey(' '); // dummy hotkey
+
add_class_hotkeys(i);
quantity = i.quantity;