1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-07-30 06:12:51 +00:00

rogueviz::ads:: imrpoved restarting

This commit is contained in:
Zeno Rogue 2025-04-06 10:24:45 +02:00
parent c42d457c56
commit ba3674f078
2 changed files with 15 additions and 3 deletions

View File

@ -60,11 +60,11 @@ void set_default_keys() {
multi::change_default_key(lps_relhell, 'l', 16 + 15);
}
void restart() {
void ads_sub_restart() {
if(in_spacetime()) {
switch_spacetime();
restart();
ads_sub_restart();
switch_spacetime();
return;
}
@ -89,6 +89,15 @@ void restart() {
init_gamedata();
}
void ads_restart() {
bool b = in_spacetime();
stop_game();
run_ads_game();
// to ensure correct LPS, switch reverse first
switch_spacetime_to(!b);
switch_spacetime_to(b);
}
void run_ads_game_hooks() {
rogueviz::rv_hook(hooks_global_mouseover, 100, generate_mouseovers);
rogueviz::rv_change<color_t>(titlecolor, 0);
@ -140,7 +149,7 @@ void run_ads_game() {
pmodel = mdDisk;
cwt.at = centerover = currentmap->gamestart();
restart();
ads_sub_restart();
}
void add_ads_cleanup() {

View File

@ -256,4 +256,7 @@ bool params_changed();
void start_relhell_tour();
void ads_restart();
void run_ads_game();
}}