1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-07-25 04:02:50 +00:00

config:: hooks for extending the config file, added asonov/nilv settings

This commit is contained in:
Zeno Rogue 2019-11-16 01:39:58 +01:00
parent 90c0260d5f
commit cba1408021

View File

@ -108,6 +108,11 @@ template<> struct saver<ld> : dsaver<ld> {
#endif #endif
EX void addparam(ld& val, const string s) {
addsaver(val, s);
params.emplace(s, val);
}
EX ld bounded_mine_percentage = 0.1; EX ld bounded_mine_percentage = 0.1;
EX int bounded_mine_quantity, bounded_mine_max; EX int bounded_mine_quantity, bounded_mine_max;
@ -252,6 +257,8 @@ EX void savecolortable(colortable& ct, string name) {
addsaver(ct[i], "color:" + name + ":" + its(i)); addsaver(ct[i], "color:" + name + ":" + its(i));
} }
EX purehookset hooks_configfile;
EX void initConfig() { EX void initConfig() {
// basic config // basic config
@ -609,6 +616,14 @@ EX void initConfig() {
multi::initConfig(); multi::initConfig();
#endif #endif
addsaver(asonov::period_xy, "asonov:period_xy");
addsaver(asonov::period_z, "asonov:period_z");
addsaver(nilv::nilperiod[0], "nilperiod_x");
addsaver(nilv::nilperiod[1], "nilperiod_y");
addsaver(nilv::nilperiod[2], "nilperiod_z");
callhooks(hooks_configfile);
#if CAP_CONFIG #if CAP_CONFIG
for(auto s: savers) s->reset(); for(auto s: savers) s->reset();
#endif #endif