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
1 changed files with 15 additions and 3 deletions

View File

@ -884,9 +884,11 @@ EX void customize_land_list() {
if(custom_land_wandering[l] != 100) s += "^" + its(custom_land_wandering[l]) + " ";
if(s != "") dialog::lastItem().value = s;
dialog::add_action_confirmed([l] {
stop_game();
use_custom_land_list = true;
start_game();
if(!use_custom_land_list) {
stop_game();
use_custom_land_list = true;
start_game();
}
pushScreen([l] { customize_land_in_list(l); });
});
}
@ -900,6 +902,16 @@ EX void customize_land_list() {
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::add_action([] {
gotoHelp(XLAT(