git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1922 c06c8d41-db1a-0410-9941-cceddc491573
O3QBT2ISABMEWTNSYEJKAJG6LZMON7U6RQZDSLY2KQHSMILUYQFQC
K2MLPJIAXXZRWEWZCNSGICCBNIU2WAAPT7SPIMOH7FLLTOB4QFRAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
ZP2KE7A2LE7Z2S7AC45WE4CXDSEVDTWIMV2EM4IBUKXYJIDU6R7QC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
BWAQ3FHBBM6G3K3KYP75CRTR343RDQZJRYX5ZGYUEXYBAC3APDLAC
UEAJDUSNR7OHYBVHEE2ZSKGKHA6EL4OKU3QYLXLVHXX7BUH3A3KQC
SIKFXNXSAMU6IYRGDG6SWP3LOX6SEE7PDFA7RVQAGG2SLWQ72D2QC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
EHSY6DVGUMI6C67WKET3GDJVLWJWGYBYQONNDK5JVT7BCTHBEZVAC
RVST2QHYJ757ZHK4AUJ5NGPDZ44AD6RVFVXYPKQIBJXZBDNUCHXQC
E5GFDGV5XJVVDZGWFQIIZ47FGGF7AEJLGGBWRUZ34HPLNFJTNLLQC
void game_options::add_all(const std::string &s, const std::string &separator,
void (game_options::*add)(const std::string &))
void game_options::split_parse(
const std::string &s, const std::string &separator,
void (game_options::*add)(const std::string &))
void game_options::set_option_fragment(const std::string &s)
{
if (s.empty())
return;
std::string::size_type st = s.find(':');
if (st == std::string::npos)
{
// Boolean option.
if (s[0] == '!')
read_option_line(s.substr(1) + " = false");
else
read_option_line(s + " = true");
}
else
{
// key:val option.
read_option_line(s.substr(0, st) + " = " + s.substr(st + 1));
}
}
There are basically three types of Crawl options: true/false values (booleans),
numbers, and lists. An option is most often specified with its default value
(if there is one); this should also explain which of the above-mentioned types
it is. Each option should have some remarks on how it's typically used - beware
that this depends strongly on your playing style and sometimes also on hardware
or operating system.
There are three broad types of Crawl options: true/false values
(booleans), arbitrary values, and lists of values. In this document,
options are usually described with their default values (if there is a
default); this should also explain which of the above-mentioned types
it is. Each option should have some remarks on how it's typically used
- but keep in mind that the options you want to use depend on your
playing style and sometimes also on your operating system.
Note that the init.txt coming with regular distributions has all boolean
options commented out. The commented-out values are always the _non-defaults_,
so you can toggle boolean options by just uncommenting them.
The standard init.txt distributed with Crawl includes all boolean
options, commented out. The commented-out values are always the
_non-defaults_, so you can toggle boolean options by uncommenting
them.
Some options need a path as an argument; here you have to use a filesystem path
suitable for your system. Other options accept regular expressions (regexes):
here you can simply use ordinary strings, adapt the suggested regexes to your
needs or search the internet for regex syntax.
There are two styles you can use to set options. The classic
name=value syntax, one option per-line:
remember_name = true
explore_greedy = false
drop_mode = multi
And the NetHack-style combined option line:
OPTION = remember_name, !explore_greedy, drop_mode:multi
The second style is useful to specify simple options in a few lines,
but it cannot be used for options that take complex lists of values
(such as the autopickup_exceptions option).
Some options need a path as an argument; here you have to use a
filesystem path suitable for your system. Other options accept regular
expressions (regexes): here you can simply use ordinary strings, adapt
the suggested regexes to your needs or search the internet for regex
syntax.