summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/items.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-08-02 17:57:40 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-08-02 17:57:40 +0000
commit73945a5e77bcfacb8aa8aa935f074cabb0a0f3cf (patch)
tree84cbacf4db1eb4ff91bbb30f3e069169bd2f2a48 /crawl-ref/source/items.cc
parente160fb287cda3717eebdee04c7a0a45b484549d6 (diff)
downloadcrawl-ref-73945a5e77bcfacb8aa8aa935f074cabb0a0f3cf.tar.gz
crawl-ref-73945a5e77bcfacb8aa8aa935f074cabb0a0f3cf.zip
Apply Yelve Yakut's patch (2020369) to list monsters and items in view.
The command to do so is xx, and you can select an entry for more details, which will be the database description ('v') for items and the more detailed 'x' description for monsters, which I think is more useful. What's still needed is some kind of sorting by, I guess, difficulty for monsters and respecting sort_menus for the items. Also, the item listing is not terribly useful at the moment but surely soon someone will think of a way to change that. :) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6755 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r--crawl-ref/source/items.cc18
1 files changed, 8 insertions, 10 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index c4a3c61682..9b00cd6011 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -80,8 +80,6 @@
#include "xom.h"
static bool _invisible_to_player( const item_def& item );
-static void _item_list_on_square( std::vector<const item_def*>& items,
- int obj, bool force_squelch = false );
static void _autoinscribe_item( item_def& item );
static void _autoinscribe_floor_items();
static void _autoinscribe_inventory();
@@ -196,14 +194,14 @@ static int _cull_items(void)
if (z != -1)
set_unrandart_exist(z, false);
}
-
+
if (first_cleaned == NON_ITEM)
first_cleaned = si->index();
// POOF!
destroy_item( si->index() );
}
- }
+ }
}
return (first_cleaned);
@@ -613,8 +611,8 @@ static int _count_nonsquelched_items( int obj )
// the square contains *only* squelched items, in which case they
// are included. If force_squelch is true, squelched items are
// never displayed.
-static void _item_list_on_square( std::vector<const item_def*>& items,
- int obj, bool force_squelch )
+void item_list_on_square( std::vector<const item_def*>& items,
+ int obj, bool force_squelch )
{
const bool have_nonsquelched = (force_squelch
|| _count_nonsquelched_items(obj));
@@ -639,7 +637,7 @@ void request_autopickup(bool do_pickup)
}
// 2 - artefact, 1 - glowing/runed, 0 - mundane
-static int _item_name_specialness(const item_def& item)
+int item_name_specialness(const item_def& item)
{
// All jewellery is worth looking at.
// And we can always tell from the name if it's an artefact.
@@ -711,7 +709,7 @@ void item_check(bool verbose)
std::vector<const item_def*> items;
- _item_list_on_square( items, igrd(you.pos()), true );
+ item_list_on_square( items, igrd(you.pos()), true );
if (items.empty())
{
@@ -740,7 +738,7 @@ void item_check(bool verbose)
unsigned short glyph_col;
get_item_glyph( items[i], &glyph_char, &glyph_col );
item_chars.push_back( glyph_char * 0x100 +
- (10 - _item_name_specialness(*(items[i]))) );
+ (10 - item_name_specialness(*(items[i]))) );
}
std::sort(item_chars.begin(), item_chars.end());
@@ -794,7 +792,7 @@ void item_check(bool verbose)
static void _pickup_menu(int item_link)
{
std::vector<const item_def*> items;
- _item_list_on_square( items, item_link, false );
+ item_list_on_square( items, item_link, false );
std::vector<SelItem> selected =
select_items( items, "Select items to pick up" );