racing:: not available in bounded words (disabled in menu, changing geometry disables racing

This commit is contained in:
Zeno Rogue 2018-12-04 23:07:56 +01:00
parent 9f3eaf7011
commit 8225593756
2 changed files with 17 additions and 9 deletions

View File

@ -693,15 +693,19 @@ struct race_configurer {
dialog::add_action([this] () { new_track = "OFFICIAL"; });
dialog::addItem("play a random track", 'r');
dialog::add_action([this] () { new_track = random_track_name(); });
dialog::addItem(XLAT("select the track and start!"), 's');
dialog::add_action([this] () {
if(race_ghosts[{new_track, modecode()}].empty())
read_ghosts(new_track, modecode());
else
println(hlog, "known ghosts: ", isize(race_ghosts[{new_track, modecode()}]));
pushScreen([this] () { track_chooser(new_track); });
});
if(bounded)
dialog::addInfo("Racing available only in unbounded worlds.", 0xFF0000);
else {
dialog::addItem(XLAT("select the track and start!"), 's');
dialog::add_action([this] () {
if(race_ghosts[{new_track, modecode()}].empty())
read_ghosts(new_track, modecode());
else
println(hlog, "known ghosts: ", isize(race_ghosts[{new_track, modecode()}]));
pushScreen([this] () { track_chooser(new_track); });
});
}
dialog::addBreak(100);

View File

@ -1159,6 +1159,9 @@ void set_geometry(eGeometry target) {
geometry = target;
if(chaosmode && bounded) chaosmode = false;
#if CAP_RACING
if(bounded) racing::on = false;
#endif
if(euclid6) variation = eVariation::bitruncated;
if(IRREGULAR) variation = eVariation::bitruncated;
if(GOLDBERG && gp::param == gp::loc(1,1) && S3 == 3) {
@ -1253,6 +1256,7 @@ void switch_game_mode(char switchWhat) {
inv::on = false;
chaosmode = false;
princess::challenge = false;
if(bounded) set_geometry(gNormal);
break;
#endif