in which case categories with >= 5 items will be sorted.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@476 c06c8d41-db1a-0410-9941-cceddc491573
VDNTHQOGDJKBTO7MKRCYH5MCOPCUWHFLPHAWDYDUIV7JKTKENBYQC
// read a value which can be either a boolean (in which case return
// 0 for true, -1 for false), or a string of the form PREFIX:NUMBER
// (e.g., auto:7), in which case return NUMBER as an int.
static int read_bool_or_number( const std::string &field, int def_value,
const std::string& num_prefix)
{
int ret = def_value;
if (field == "true" || field == "1" || field == "yes")
ret = 0;
if (field == "false" || field == "0" || field == "no")
ret = -1;
if ( field.find(num_prefix) == 0 )
ret = atoi(field.c_str() + num_prefix.size());
return (ret);
}
equipment slot.
equipment slot. When set to a number - using a syntax of the form
sort_menus = auto:5 - items are sorted by their description if
the total number of items in that category is at least that
number; in the default case, having 4 kinds of potions would not
sort them, but having 5 would.