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
HKQTMQVLLOBG2VO47TUGSTQALA3D2YLMEVADXXYNR4RGGKD3F2ZAC
R4HHAP27V6RU7AVHYJ3TVOA6Y4RMWIN24XLGD4O2PE6DEGM3RIHQC
SIDH2P7NBIG5KEOE27XHD3ZT2NQ2OJZFN6VZXWNWYFFY5YVXSSVQC
2BTN774TDEFKS7L23YNEDQJSLSUWWKXPC5GA73ZGKLCKDHVEWSJAC
LDBTCT5WIPLJPZWXS2RUQ26QKISCUUTLO77M464WOE6VSYSNPKYAC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
Q5SFQO7ANODRI6OXKHPFQ4QWKGQ367S64DPURQW2TWK7ANTYO4NQC
WCK6TM2ZD56WSOK6SMMKBYAYGG4OUCTILLMVVLMB4QO5I5S2IVNAC
NS3KXJXQSN33UQSOBDK3WXXKA3KY5YOUJL67NBZKGQAJYDYZ2COQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
O6ZMFKDI3XO2SWPNEYHIPYFDWJR4TVDP5BAATK6LVCVETQID6E7AC
PHBACPMH3F34GODHVDKNCMXWU373RJQGVTDLBFCCDLLWDXVYOLTAC
RX6575DZOHRUXQUZH34YZGPZJF4STUPLBQDIVTINA2L6LVCKRIGQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
WL5WZXFJ6TONUQRSHUY4GQ5USU47ILWNN5X2JDQZO4CRJJZSRQIAC
VNIAJEGE3PYE6F6EAMCQDWMAS52EQTKJUPAFXK7ARCITZ326WTTQC
B7DNCNY7SXL5WAW5B3XZP5KIQSBWOJ3N2YW46WOUQKTRBRRZ7YOQC
TJRYL3NXPW5IUGEV3YOC7JYWEXCZDBFPLT4AUG4P227WVKVB72ZAC
IVVTHLTTLOP5TSULXJWUSSXHOKYWVU3OWKYVK45A7RIB6V34MYQAC
GQL5SIGBHLU3FMCE54XVGLRY5AZHRM6DUEB722REA2DPLGJSN6EQC
JM7UAK777RAVDAVLQLEOBRTGNW2B47S5G55XITJXO243IUNZHVYQC
FEGNPOJI2SALUA2PVIXIQ2CIXFLSXD7UB7CNUSAAKV4L3POXCRFQC
LW4N5EHKL776DURXZMAM6JEW3JPWWX5BSNP7TCZHTLCDOQTTGFCAC
33QMQXTWFPR4LUBHEWTFGR74L5QJJDQTT5JZRBFTPDQBPXIHQIUQC
WXZQJUZXMYS7R6ORNB7DWE5KEUXT262GXWMRPOJYYB4I3BFGYLLAC
TYCM7ZQG5JPPK4A5K6IBVRKJYQS2F2A3SESBC53MUNXHMZCKYF5QC
VRFQK6S2TXOFFO5K5HRDXPR7QEKKAZAVCASSIJVPWQ4GE26UOGTQC
X2FMEN4E345XD26Z2X7JMJ7VGHOGCGIELMHQRE2ITLVNQACP3NOQC
YQDXXS2M7PYVJHY6KAHSRKE5ZRC6T72W7LTGNRVPKCSP5VATWAVAC
J6QMBZJOAWTIERCY5VXKYYXMR5HDSJS7K564X6LEMQMEELARN55AC
R5Q2OJMXNVK5RPXIKLTHHAOP67XOBB44AZKKZ2TOI3USPL6HACXAC
WTBI53EKHGSNOQJ7DJVKJNKGW2VFFEDYTQATU53WFH3IAMSSGOZAC
RVST2QHYJ757ZHK4AUJ5NGPDZ44AD6RVFVXYPKQIBJXZBDNUCHXQC
// takes a (possibly tagged) string, breaks it into lines and
// prints it into the given message channel
// Takes a (possibly tagged) string, breaks it into lines and
// prints it into the given message channel.
/* ***********************************************************************
* called from: directn
* *********************************************************************** */
int item_name_specialness(const item_def& item);
void item_list_on_square( std::vector<const item_def*>& items,
int obj, bool force_squelch = false );
}
static void _describe_monster(const monsters *mon);
// Lists all the monsters and items currently in view by the player.
// Internals:
// Menu items have meaningful tags. 'i' means item and 'm' means monster.
//
void _full_describe_view()
{
const coord_def start = view2grid(coord_def(1,1));
const coord_def end(start.x + crawl_view.viewsz.x,
start.y + crawl_view.viewsz.y);
std::vector<monsters*> list_mons;
std::vector<const item_def*> list_items;
coord_def p;
// Iterate over viewport and get all the items and monsters in view.
// TODO: Allow sorting of monster and items lists.
for (p.x = start.x; p.x < end.x; p.x++)
for (p.y = start.y; p.y < end.y; p.y++)
{
if (!in_bounds(p.x,p.y) || !see_grid(p.x,p.y))
continue;
const int mid = mgrd(p);
const int oid = igrd(p);
if (mid != NON_MONSTER && player_monster_visible(&menv[mid]))
list_mons.push_back(&menv[mid]);
if (oid != NON_ITEM)
{
std::vector<const item_def*> items;
item_list_on_square( items, oid, true );
list_items.insert(list_items.end(), items.begin(), items.end());
}
}
if (!list_mons.size() && !list_items.size())
{
mprf("Neither monsters nor items are visible.");
return;
}
Menu desc_menu(MF_SINGLESELECT | MF_ANYPRINTABLE |
/*MF_ALWAYS_SHOW_MORE |*/ MF_ALLOW_FORMATTING);
desc_menu.set_highlighter(NULL);
desc_menu.set_title(new MenuEntry("Visible Monsters/Items:",
MEL_TITLE));
desc_menu.set_tag("description");
int menu_index = -1;
// Build menu entries for monsters.
if (!list_mons.empty())
{
desc_menu.add_entry( new MenuEntry("Monsters", MEL_SUBTITLE) );
for (unsigned int i = 0; i < list_mons.size(); ++i)
{
// List monsters in the form
// (g) A goblin wielding an orcish dagger
++menu_index;
const char letter = index_to_letter(menu_index);
// Get colour-coded letter.
unsigned char colour = mons_class_colour(list_mons[i]->type);
if (colour == BLACK)
colour = LIGHTGREY;
std::string prefix = "(<";
prefix += colour_to_str(colour);
prefix += ">";
prefix += stringize_glyph(mons_char( list_mons[i]->type) );
prefix += "</";
prefix += colour_to_str(colour);
prefix += ">) ";
// Get damage level.
std::string wound_str;
mon_dam_level_type dam_level;
mons_get_damage_level(list_mons[i], wound_str, dam_level);
// Get monster description.
// TODO: Show monsters being friendly or neutral, if not by
// colour, then by description.
std::vector<formatted_string> fss;
std::string str = prefix + get_monster_desc(list_mons[i], true);
if (dam_level != MDAM_OKAY)
str = str + ", " + wound_str;
// Wraparound if the description is longer than allowed.
linebreak_string2(str, get_number_of_cols() - 4);
formatted_string::parse_string_to_multiple(str, fss);
MenuEntry *me;
for (unsigned int j = 0; j < fss.size(); j++)
{
if (j == 0)
{
me = new MenuEntry(uppercase_first(str), MEL_ITEM, 1, letter);
me->data = (void*) list_mons[i];
me->tag = "m";
me->quantity = 1; // Hack to make monsters selectable.
}
else
{
str = " " + fss[j].tostring();
me = new MenuEntry(str, MEL_ITEM, 1);
}
desc_menu.add_entry(me);
}
}
}
// Build menu entries for items.
if (list_items.size())
{
desc_menu.add_entry( new MenuEntry( "Items", MEL_SUBTITLE ) );
for (unsigned int i = 0; i < list_items.size(); ++i)
{
++menu_index;
const char letter = index_to_letter(menu_index);
unsigned glyph_char;
// TODO: check if this can be used instead of
// manually doing so with item_specialness --yy
unsigned short glyph_col;
get_item_glyph( list_items[i], &glyph_char, &glyph_col );
std::string col_string;
int specialness = item_name_specialness(*(list_items[i]));
switch (specialness)
{
case 2: col_string = "yellow"; break; // artefact
case 1: col_string = "white"; break; // glowing/runed
case 0: col_string = "darkgrey"; break; // mundane
}
std::string prefix = "(<" + col_string + ">"
+ (char)glyph_char
+ "</" + col_string + ">) ";
std::string str = prefix + list_items[i]->name(DESC_PLAIN);
MenuEntry *me = new MenuEntry(uppercase_first(str),
MEL_ITEM, 1, letter);
me->data = (void*) list_items[i];
me->tag = "i";
me->quantity = 2; // Hack to make items selectable.
desc_menu.add_entry(me);
}
}
// Menu loop
while (true)
{
std::vector<MenuEntry*> sel = desc_menu.show();
redraw_screen();
if (sel.empty())
break;
// Possibility to select a menu item to get full description
// HACK: quantity == 1: monsters, quantity == 2: items
const int quant = sel[0]->quantity;
if (quant == 1)
{
mesclr();
//Monster selected
monsters* m = (monsters*)(sel[0]->data);
_describe_monster( m );
if (getch() == 0)
getch();
}
else if (quant == 2)
{
//Item selected
item_def* i = (item_def*)(sel[0]->data);
describe_item( *i );
}
}
"recommended that you save your game and reload. Please report "
"monsters who masquerade as program bugs or run around the "
"dungeon without a proper description to the authorities.";
"recommended that you save your game and reload. Please report "
"monsters who masquerade as program bugs or run around the "
"dungeon without a proper description to the authorities.";