start menu options no longer reset the graphical options -- there is a separate entry for that

This commit is contained in:
Zeno Rogue 2019-01-02 16:20:14 +01:00
parent df0578a1fe
commit 06cfd5e2d6
2 changed files with 26 additions and 11 deletions

View File

@ -380,18 +380,35 @@ bool have_current_settings() {
if(tactic::on) modecount += 10;
if(randomPatternsMode) modecount += 10;
if(geometry != gNormal) modecount += 10;
if(modecount > 1)
return true;
return false;
}
bool have_current_graph_settings() {
if(vid.xposition || vid.yposition || vid.alpha != 1 || vid.scale != 1)
return true;
if(pmodel != mdDisk || vid.monmode != DEFAULT_MONMODE || vid.wallmode != DEFAULT_WALLMODE)
return true;
if(firstland != laIce || multi::players != 1 || rug::rugged)
return true;
if(modecount > 1)
return true;
return false;
}
void reset_graph_settings() {
pmodel = mdDisk; vid.alpha = 1; vid.scale = 1;
vid.xposition = vid.yposition = 0;
#if CAP_RUG
if(rug::rugged) rug::close();
#endif
vid.monmode = DEFAULT_MONMODE;
vid.wallmode = DEFAULT_WALLMODE;
}
void resetModes(char leave) {
popAllGames();
if(shmup::on != (leave == rg::shmup)) stop_game_and_switch_mode(rg::shmup);
@ -416,14 +433,6 @@ void resetModes(char leave) {
set_geometry(gNormal);
set_variation(eVariation::bitruncated);
pmodel = mdDisk; vid.alpha = 1; vid.scale = 1;
vid.xposition = vid.yposition = 0;
#if CAP_RUG
if(rug::rugged) rug::close();
#endif
vid.monmode = DEFAULT_MONMODE;
vid.wallmode = DEFAULT_WALLMODE;
start_game();
}

View File

@ -697,7 +697,13 @@ void showStartMenu() {
dialog::addBreak(100);
dialog::addBigItem(XLAT1("use current/saved settings"), SDLK_ESCAPE);
}
if(have_current_graph_settings()) {
dialog::addBreak(100);
dialog::addBigItem(XLAT1("reset the graphics settings"), 'r');
dialog::add_action([] () { reset_graph_settings(); });
}
dialog::addBreak(100);
dialog::addBigItem(XLAT("main menu"), 'm');
dialog::addInfo(XLAT("more options"));