git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3442 c06c8d41-db1a-0410-9941-cceddc491573
EMJSHEKS7UTRRLF7GW5WYVI7RAAUJJQX2D3PAIO7UZFGNREIZOAAC
NTHQ3RE6DK47HACSWRRVH7QPETSRCLTWMUN2AWKNVWYSV55GFNZAC
HYS3HXTXATFPN7GLN3WBGDCP22UT2D3JBVUS7SP5FE7L54TDCJRQC
CIPVRZGLOZHCERK6YPOBV3P2E4IAB4H6D5EHLRQE2O5E4P4VCBUAC
7NDXS36TE7QVXTXJWMYSVG5UHCCLPIO4VL6NXFGTDK3ZNKE3A2IAC
6HQB2N6N75R2RGKJFWRUN7WAC2PNGWQFXTII5DTRLTHZ2BOTMTVAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
LAMIVDKY7LO5ONX5Z273ZCCEA5UBENOJD5VWNE4AK2EXGFED6BFQC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
5ASC3STDYCNLZFEBN6UTMUCGDETHBR2OCBZCF5VIAZ5RRWLOTDYQC
TOKBONNNPTP2CIEHMMR4QAJZTXYETS55OGGDA6FY6NIMNDYMWJDAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
43ZTEB57FU7KE5EVMYWZONNVJBZCGF3JEAJZIY25LC4LGE65PG5QC
NXVPOFYKJFWQWKVPQUMWH2Y2KJEZX44BUOBFJ4JD4KFGPEGYHG4QC
2GV6OW7P54FXZ5OD2NUMX7MLXH424LYAFMOAUQ2UGSOLKLYDBJGAC
snprintf(buf, sizeof buf, "%-7s: <%s>%s</%s>",
slot, colname,
item.name(DESC_PLAIN).substr(0,37).c_str(), colname);
const char equip_char = index_to_letter(item_idx);
snprintf(buf, sizeof buf, "%-7s: <w>%c</w> - <%s>%s</%s>",
slot, equip_char, colname,
item.name(DESC_PLAIN).substr(0,33).c_str(), colname);
equip_chars.push_back(equip_char);
cmd_help.add_item_formatted_string(blines[i]);
{
// Kind of a hack -- we don't care really what items these
// hotkeys go to. So just pick the first few.
const char hotkey = (i < equip_chars.size()) ? equip_chars[i] : 0;
cmd_help.add_item_formatted_string(blines[i], hotkey);
}
cmd_help.show();
redraw_screen();
while (true)
{
std::vector<MenuEntry *> results = cmd_help.show();
if (results.size() == 0)
{
redraw_screen();
break;
}
const char c = results[0]->hotkeys[0];
item_def& item = you.inv[letter_to_index(c)];
describe_item(item, false);
// loop around for another go.
}
// selection is impossible...in other words, you just want a browser.
// Hotkeys can be set on menu items, in which case you can jump
// to them by pressing the appropriate key.
// you want mostly a browser.
//
// If MF_NOSELECT, hotkeys jump to menu items.
// If MF_SINGLESELECT, hotkeys end the menu immediately.
// MF_MULTISELECT is not supported.