1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-06-25 14:43:01 +00:00

rogueviz:: ads:: improved the standalone version

This commit is contained in:
Zeno Rogue 2025-06-22 16:06:39 +02:00
parent 6dc7a5f079
commit ad39c9f4c0
2 changed files with 31 additions and 7 deletions

View File

@ -20,7 +20,8 @@
#define CAP_ARCM 0
#define CAP_HISTORY 0
#define CAP_STARTANIM 0
#include "../hyper.cpp"
#include "../../hyper.cpp"
#include "../presentation.cpp"
namespace rogueviz { std::vector<hr::reaction_t> cleanup; }
@ -369,15 +370,18 @@ auto shot_hooks =
#ifdef RELHELL
auto hook1=
addHook(hooks_config, 100, [] {
lps_enable(&lps_relhell);
default_settings();
set_config();
enable_canvas();
if(arg::curphase == 1)
conffile = "relhell.ini";
if(arg::curphase == 3) pushScreen(pick_the_game);
if(arg::curphase == 3) { showstartmenu = false; popScreenAll(); pushScreen(pick_the_game); }
});
#else
auto hook2 = addHook(hooks_configfile, 300, default_settings);
#endif
auto hook2 = addHook(hooks_configfile, 300, default_settings);
}
}

View File

@ -270,6 +270,22 @@ void game_menu() {
dialog::display();
}
void pick_the_game();
void may_subloop() {
#if RELHELL
mainloop();
if(tour::on) tour::stop_tour();
quitmainloop = false;
popScreenAll();
stop_game();
set_geometry(gEuclid);
pmodel = mdDisk;
start_game();
pushScreen(pick_the_game);
#endif
}
void pick_the_game() {
cmode = sm::NOSCR;
clearMessages();
@ -280,24 +296,28 @@ void pick_the_game() {
dialog::addBreak(200);
dialog::addBigItem("anti-de Sitter space", 'a');
dialog::add_action([] { popScreen(); run_ads_game_std(); add_ads_cleanup(); clearMessages(); });
dialog::add_action([] { popScreen(); run_ads_game_std(); add_ads_cleanup(); clearMessages(); may_subloop(); });
dialog::addInfo(XLAT("shoot asteroids, mine resources, collect gold"));
dialog::addBreak(100);
dialog::addBigItem("de Sitter space", 'd');
dialog::add_action([] { popScreen(); run_ds_game_std(); add_ds_cleanup(); clearMessages(); });
dialog::add_action([] { popScreen(); run_ds_game_std(); add_ds_cleanup(); clearMessages(); may_subloop(); });
dialog::addInfo(XLAT("avoid energy balls, but do not let the main star run away!"));
dialog::addBreak(100);
dialog::addBigItem("guided tour", 't');
dialog::add_action(start_relhell_tour);
dialog::add_action([] { start_relhell_tour(); may_subloop(); });
dialog::addInfo(XLAT("but what exactly are these spaces?"));
dialog::addBreak(100);
#if RELHELL
dialog::addBigItem("quit the game", 'q');
#else
dialog::addItem("not now", 'q');
#endif
dialog::add_action([] { quitmainloop = true; });
dialog::display();