diff --git a/config.cpp b/config.cpp index 9626f499..81a39bd6 100644 --- a/config.cpp +++ b/config.cpp @@ -499,19 +499,6 @@ EX void initConfig() { #if CAP_FILES && CAP_SHOT && CAP_ANIMATIONS addsaver(anims::animfile, "animation file format"); #endif - #if CAP_ANIMATIONS - addparamsaver(anims::period, "aperiod", "animation period"); - addsaver(anims::noframes, "animation frames"); - addparamsaver(anims::cycle_length, "acycle", "animation cycle length"); - addparamsaver(anims::parabolic_length, "aparabolic", "animation parabolic length"); - addparamsaver(anims::rug_angle, "arugangle", "animation rug angle"); - addparamsaver(anims::circle_radius, "acradius", "animation circle radius"); - addparamsaver(anims::circle_spins, "acspins", "animation circle spins"); - addsaver(anims::rug_movement_angle, "rug forward movement angle", 90); - addsaver(anims::rug_shift_angle, "rug forward shift angle", 0); - addsaver(anims::a, "a", 0); - addsaver(anims::b, "b", 0); - #endif #if CAP_RUG addsaver(rug::move_on_touch, "rug move on touch"); @@ -522,16 +509,6 @@ EX void initConfig() { addsaver(crystal::view_coordinates, "crystal-coordinates"); #endif - #if CAP_SHOT - addsaver(shot::shotx, "shotx"); - addsaver(shot::shoty, "shoty"); - addsaverenum(shot::format, "shotsvg"); - addsaver(shot::transparent, "shottransparent"); - addparamsaver(shot::gamma, "shotgamma"); - addsaver(shot::caption, "shotcaption"); - addparamsaver(shot::fade, "shotfade"); - #endif - #if CAP_TEXTURE addsaver(texture::texture_aura, "texture-aura", false); #endif @@ -619,16 +596,6 @@ EX void initConfig() { addsaver(vid.consider_shader_projection, "shader-projection", true); -#if CAP_RACING - addsaver(racing::race_advance, "race_advance"); - addsaver(racing::race_angle, "race_angle"); - addsaver(racing::ghosts_to_show, "race_ghosts_to_show"); - addsaver(racing::ghosts_to_save, "race_ghosts_to_save"); - addsaver(racing::guiding, "race_guiding"); - addsaver(racing::player_relative, "race_player_relative"); - addsaver(racing::standard_centering, "race_standard_centering"); -#endif - addsaver(tortoise::shading_enabled, "tortoise_shading", true); addsaver(bounded_mine_percentage, "bounded_mine_percentage"); diff --git a/racing.cpp b/racing.cpp index a42f0e1e..7bc43254 100644 --- a/racing.cpp +++ b/racing.cpp @@ -851,9 +851,10 @@ int readArgs() { int tstart, tstop; heptspin sview; -#if CAP_COMMANDLINE auto hook = +#if CAP_COMMANDLINE addHook(hooks_args, 100, readArgs) +#endif + addHook(hooks_clearmemory, 0, []() { track_ready = false; track.clear(); @@ -861,9 +862,17 @@ auto hook = rti_id.clear(); for(auto &ch: current_history) ch.clear(); }) ++ addHook(hooks_config, 100, [] { + addsaver(racing::race_advance, "race_advance"); + addsaver(racing::race_angle, "race_angle"); + addsaver(racing::ghosts_to_show, "race_ghosts_to_show"); + addsaver(racing::ghosts_to_save, "race_ghosts_to_save"); + addsaver(racing::guiding, "race_guiding"); + addsaver(racing::player_relative, "race_player_relative"); + addsaver(racing::standard_centering, "race_standard_centering"); + }) // + addHook(hooks_handleKey, 120, akh); ; -#endif EX vector race_lands = { laHunting, diff --git a/screenshot.cpp b/screenshot.cpp index b4f06a33..12d99baa 100644 --- a/screenshot.cpp +++ b/screenshot.cpp @@ -233,6 +233,17 @@ int read_args() { auto ah = addHook(hooks_args, 0, read_args); #endif +auto ah2 = addHook(hooks_config, 100, [] { + addsaver(shot::shotx, "shotx"); + addsaver(shot::shoty, "shoty"); + addsaverenum(shot::format, "shotsvg"); + addsaver(shot::transparent, "shottransparent"); + addparamsaver(shot::gamma, "shotgamma"); + addsaver(shot::caption, "shotcaption"); + addparamsaver(shot::fade, "shotfade"); + #endif + }); + #endif EX } @@ -1790,7 +1801,19 @@ auto animhook = addHook(hooks_frame, 100, display_animation) #if CAP_COMMANDLINE + addHook(hooks_args, 100, readArgs) #endif - ; + + addHook(hooks_config, 100, [] { + addparamsaver(anims::period, "aperiod", "animation period"); + addsaver(anims::noframes, "animation frames"); + addparamsaver(anims::cycle_length, "acycle", "animation cycle length"); + addparamsaver(anims::parabolic_length, "aparabolic", "animation parabolic length"); + addparamsaver(anims::rug_angle, "arugangle", "animation rug angle"); + addparamsaver(anims::circle_radius, "acradius", "animation circle radius"); + addparamsaver(anims::circle_spins, "acspins", "animation circle spins"); + addsaver(anims::rug_movement_angle, "rug forward movement angle", 90); + addsaver(anims::rug_shift_angle, "rug forward shift angle", 0); + addsaver(anims::a, "a", 0); + addsaver(anims::b, "b", 0); + }); EX bool any_animation() { if(history::on) return true;