with some clean-up and fix in acr.cc to make the results apply at once (instead of only after a screen redraw).
I've tested it and everything works fine. Recursive inclusion, e.g. read_options('init.txt'), prints a stack overflow error but doesn't crash the game, so I think that's fine for now.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3469 c06c8d41-db1a-0410-9941-cceddc491573
TP5EDQXPVPTKQYTAMN3VQYHM4WRT2RNIR4EDLWLDAV2OQGKSB6KAC
NQIXUYGUIQTKZUB2IQDII7BBDMZ4VN4NUUTGT2ARQBZTDJUMPKRQC
DGB7DKTR6OEQEMOOF3MAHDT4PAPKZ54Y33MWYVD7XIOESPFAXHQQC
SDLKLUNFGVKDS55DDJZCBAVIB7NL3RRYPTACAY65SCUQKV6APFSAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
4O3VTUJT5T7NBNF3Q45XO2WHS6TCJXVLH6CKX4K36WUBDRT5F6KAC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
GQL5SIGBHLU3FMCE54XVGLRY5AZHRM6DUEB722REA2DPLGJSN6EQC
Y2VKZYSQXLYYQNB6OSQP44IYLT2M56SE2ZW2MHOAZUODKCVDHEAQC
VBG2GGMVC66LQM4OSI67VKXGAQK4GVOEHX3OL6V3IFOO52MQL72QC
NCDWWDJQLAU5ORSAQGZKJJ5E22VTDGGPJMVVBWQFHQ2B3U3UFHDQC
4K4XALUPQZBXIPMPTU42DZP4Q7DDJSB6TCIWG5O5T4TX26GXIWFQC
K2MLPJIAXXZRWEWZCNSGICCBNIU2WAAPT7SPIMOH7FLLTOB4QFRAC
TOKBONNNPTP2CIEHMMR4QAJZTXYETS55OGGDA6FY6NIMNDYMWJDAC
WL5WZXFJ6TONUQRSHUY4GQ5USU47ILWNN5X2JDQZO4CRJJZSRQIAC
XPCGZBHHSL6MB3ORMUJI64BAERU6AZTIY6RK56BBW7SNB3IK24IAC
EHSY6DVGUMI6C67WKET3GDJVLWJWGYBYQONNDK5JVT7BCTHBEZVAC
RVST2QHYJ757ZHK4AUJ5NGPDZ44AD6RVFVXYPKQIBJXZBDNUCHXQC
UPJVSMMMHGRDUIJG4MZX6IBLQ4ODBF5Z3PF3RHDYTSAEOCVDZM5AC
TTGCXNOSKYDDDJYGJV2RKHKJTWZROB7RNOZCXIO2TVXVYIDNIAWQC
25CH7HH4LKXFIZ75YNMXS3TSXO6O27DYSOPLOD45K4OCNFWLS4LQC
WQU4ORZR2C52JNRTH5DN4XKNLEC4Q4SUZ7MLO6MBU6SSL2YXLSOAC
R5Q2OJMXNVK5RPXIKLTHHAOP67XOBB44AZKKZ2TOI3USPL6HACXAC
you.redraw_evasion = true;
you.redraw_experience = true;
you.redraw_gold = true;
you.wield_change = true;
you.quiver_change = true;
you.redraw_evasion = true;
you.redraw_experience = true;
you.redraw_gold = true;
you.wield_change = true;
you.quiver_change = true;
#ifdef CLUA_BINDINGS
clua.runhook("chk_startgame", "b", newc);
std::string yname = you.your_name;
read_init_file(true);
Options.fixup_options();
strncpy(you.your_name, yname.c_str(), kNameLen);
you.your_name[kNameLen - 1] = 0;
// In case Lua changed the character set.
init_char_table(Options.char_set);
init_feature_table();
init_monster_symbols();
#endif
< Lua code >
or
<
Lua code
>
or
: Lua code till end of line
{ Possibly multi-line
Lua code }
In the second and third cases, the restriction is that the delimiter
characters appear at the beginning and end of a line, respectively.
The difference between the <> and {} is when the code gets executed.
Code {}, it is executed right away. Other Lua code is executed only
after the entire init file is read in.
# Controlling visibility of options:
{
function ch_autopickup(it) [ ... body omitted ... ] end
}
7-b Conditional options.
----------------------------
You can use Lua to selectively include parts of your init.txt (based
on character type, for instance) using the same syntax.
Examples:
7-c Including external files.
---------------------------------
You can use Lua to include options from other files. This is actually
just a particularly useful way to use the previously discussed features.
Example:
# Set the monster glyphs back to the way they were in 0.3.4
: crawl.read_options('docs/monsters_034.rc')
If you don't like the standard keyset (either because some keys do not
work properly, or because you want to decrease the amount of typing
necessary), you can use keymaps and macros. See macro.txt in the Docs
directory, or read it from the in-game help menu.
If you don't like the standard keyset (either because some keys do not
work properly, or because you want to decrease the amount of typing
necessary), you can use keymaps and macros. See crawl_macro.txt in the
Docs directory, or read it from the in-game help menu.