git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1393 c06c8d41-db1a-0410-9941-cceddc491573
43BZJ22AMZ4562BBF325ABM5W7GLUT3MDUOHAQ5QJPPQFGTBISKAC
SIKFXNXSAMU6IYRGDG6SWP3LOX6SEE7PDFA7RVQAGG2SLWQ72D2QC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
#include <sstream>
char buf[ITEMNAME_SIZE]; char suffix[ITEMNAME_SIZE] = "";
char buf[ITEMNAME_SIZE];
char suffix[ITEMNAME_SIZE] = "";
std::ostringstream tstr;
tstr << ' ' << static_cast<char>(hotkeys[0]) << ' '; if ( !selected_qty ) tstr << '-'; else if ( selected_qty < quantity ) tstr << '#'; else tstr << '+'; tstr << ' ' << text;
tstr << ' ' << static_cast<char>(hotkeys[0]) << ' ';
if ( !selected_qty )
tstr << '-';
else if ( selected_qty < quantity )
tstr << '#';
else
tstr << '+';
tstr << ' ' << text;
snprintf(suffix, sizeof suffix, " (%d gold)", value);
snprintf(suffix, sizeof suffix,
" (%d gold)", value);
tstr << " (" << value << " gold)"; } if ( Options.show_inventory_weights ) { const int mass = item_mass(*item); tstr << " [" << (mass/10) << '.' << (mass%10) << " aum]";
tstr << " (" << value << " gold)";
}
if ( Options.show_inventory_weights )
{
const int mass = item_mass(*item);
tstr << " [" << (mass/10) << '.' << (mass%10) << " aum]";
snprintf( buf, sizeof buf, " %c %c %s%s", hotkeys[0], (!selected_qty? '-' : selected_qty < quantity? '#' : '+'), text.c_str(), suffix ); return (buf);
snprintf( buf, sizeof buf,
" %c %c %s%s",
hotkeys[0],
(!selected_qty? '-' : selected_qty < quantity? '#' : '+'),
text.c_str(),
suffix );
return (buf);
return tstr.str();
show_inventory_weights = false;
} else if (key == "show_inventory_weights") { // should weights be shown on inventory items? show_inventory_weights = read_bool( field, show_inventory_weights );
else if (key == "show_inventory_weights")
// should weights be shown on inventory items?
show_inventory_weights = read_bool( field, show_inventory_weights );
bool show_inventory_weights; // show weights in inventory listings