1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

custom:: disable/enable all option, and don't srestart the game when customizing

This commit is contained in:
Zeno Rogue 2024-03-14 20:20:33 +01:00
parent 261800d765
commit 94bf06f7dc

View File

@ -884,9 +884,11 @@ EX void customize_land_list() {
if(custom_land_wandering[l] != 100) s += "^" + its(custom_land_wandering[l]) + " "; if(custom_land_wandering[l] != 100) s += "^" + its(custom_land_wandering[l]) + " ";
if(s != "") dialog::lastItem().value = s; if(s != "") dialog::lastItem().value = s;
dialog::add_action_confirmed([l] { dialog::add_action_confirmed([l] {
stop_game(); if(!use_custom_land_list) {
use_custom_land_list = true; stop_game();
start_game(); use_custom_land_list = true;
start_game();
}
pushScreen([l] { customize_land_in_list(l); }); pushScreen([l] { customize_land_in_list(l); });
}); });
} }
@ -900,6 +902,16 @@ EX void customize_land_list() {
start_game(); start_game();
}); });
if(use_custom_land_list) {
dialog::addItem("disable/enable all", 'D');
dialog::add_action([] {
int qty = 0;
for(int i=0; i<landtypes; i++) if(custom_land_list[i]) qty++;
for(int i=0; i<landtypes; i++) custom_land_list[i] = !qty;
});
}
else dialog::addBreak(100);
dialog::addHelp(); dialog::addHelp();
dialog::add_action([] { dialog::add_action([] {
gotoHelp(XLAT( gotoHelp(XLAT(