1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

ads:: use lps

This commit is contained in:
Zeno Rogue 2023-08-07 17:15:50 +02:00
parent 861543b9e5
commit 38baf6605a
4 changed files with 32 additions and 13 deletions

View File

@ -130,21 +130,30 @@ void run_ads_game() {
restart();
}
local_parameter_set lps_relhell("relhell:");
void default_settings() {
set_default_keys();
lps_add_enum(lps_relhell, nohelp, 1);
lps_add(lps_relhell, nomenukey, true);
lps_add(lps_relhell, no_find_player, true);
lps_add(lps_relhell, showstartmenu, false);
lps_add(lps_relhell, mapeditor::drawplayer, false);
lps_add(lps_relhell, vid.drawmousecircle, false);
lps_add(lps_relhell, draw_centerover, false);
lps_add(lps_relhell, vid.axes3, false);
lps_add(lps_relhell, patterns::whichCanvas, 'r');
lps_add(lps_relhell, patterns::rwalls, 0);
}
void set_config() {
nohelp = true;
nomenukey = true;
no_find_player = true;
showstartmenu = false;
mapeditor::drawplayer = false;
vid.drawmousecircle = false;
draw_centerover = false;
vid.axes3 = false;
lps_enable(&lps_relhell);
enable_canvas();
patterns::whichCanvas = 'r';
patterns::rwalls = 0;
}
void run_ads_game_std() {
set_config();
set_geometry(gNormal);
set_variation(eVariation::pure);
run_ads_game();
@ -256,14 +265,15 @@ auto shot_hooks =
#ifdef RELHELL
auto hook1=
addHook(hooks_config, 100, [] {
set_config();
lps_enable(&lps_relhell);
enable_canvas();
if(arg::curphase == 1)
conffile = "relhell.ini";
if(arg::curphase == 3) pushScreen(pick_the_game);
});
#endif
auto hook2 = addHook(hooks_configfile, 100, set_default_keys);
auto hook2 = addHook(hooks_configfile, 300, default_settings);
}
}

View File

@ -737,6 +737,12 @@ void run_ds_game() {
rogueviz::rv_hook(anims::hooks_anim, 100, replay_animation);
}
void run_ds_game_std() {
lps_enable(&lps_relhell);
enable_canvas();
run_ds_game();
}
auto ds_hooks =
arg::add3("-ds-game", run_ds_game);

View File

@ -113,6 +113,8 @@ ads_object *main_rock;
extern string copyright_shown;
extern local_parameter_set lps_relhell;
int XSCALE = 48;
int YSCALE = 48;
int talpha = 32;
@ -124,6 +126,7 @@ void reset_textures();
void ds_restart();
void run_ads_game_std();
void run_ds_game();
void run_ds_game_std();
/** in the replay mode */
bool rev_replay;

View File

@ -232,7 +232,7 @@ void pick_the_game() {
dialog::addBreak(100);
dialog::addBigItem("de Sitter space", '2');
dialog::add_action([] { popScreen(); run_ds_game(); clearMessages(); });
dialog::add_action([] { popScreen(); run_ds_game_std(); clearMessages(); });
dialog::addInfo(XLAT("avoid energy balls, but do not let the main star run away!"));
dialog::addBreak(100);