From 73945a5e77bcfacb8aa8aa935f074cabb0a0f3cf Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sat, 2 Aug 2008 17:57:40 +0000 Subject: 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 --- crawl-ref/source/items.cc | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'crawl-ref/source/items.cc') 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& 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& items, - int obj, bool force_squelch ) +void item_list_on_square( std::vector& 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 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 items; - _item_list_on_square( items, item_link, false ); + item_list_on_square( items, item_link, false ); std::vector selected = select_items( items, "Select items to pick up" ); -- cgit v1.2.3-54-g00ecf