Skip to content

Commit 28a3f2a

Browse files
committed
Don't reset mods when pressing Restore Defaults
It doesn't make sense now that they're a separate menu anyways
1 parent aeb2a8c commit 28a3f2a

3 files changed

Lines changed: 11 additions & 14 deletions

File tree

‎src/Engine/Options.cpp‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,19 +330,23 @@ static void _setDefaultMods()
330330

331331
/**
332332
* Resets the options back to their defaults.
333+
* @param includeMods Reset mods to default as well.
333334
*/
334-
void resetDefault()
335+
void resetDefault(bool includeMods)
335336
{
336337
for (std::vector<OptionInfo>::iterator i = _info.begin(); i != _info.end(); ++i)
337338
{
338339
i->reset();
339340
}
340341
backupDisplay();
341342

342-
mods.clear();
343-
if (!_dataList.empty())
343+
if (includeMods)
344344
{
345-
_setDefaultMods();
345+
mods.clear();
346+
if (!_dataList.empty())
347+
{
348+
_setDefaultMods();
349+
}
346350
}
347351
}
348352

@@ -532,7 +536,7 @@ bool init(int argc, char *argv[])
532536
if (showHelp(argc, argv))
533537
return false;
534538
create();
535-
resetDefault();
539+
resetDefault(true);
536540
loadArgs(argc, argv);
537541
setFolders();
538542
_setDefaultMods();

‎src/Engine/Options.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ namespace Options
6868
/// Creates the options info.
6969
void create();
7070
/// Restores default options.
71-
void resetDefault();
71+
void resetDefault(bool includeMods);
7272
/// Initializes the options settings.
7373
bool init(int argc, char *argv[]);
7474
/// Loads options from YAML.

‎src/Menu/OptionsDefaultsState.cpp‎

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,8 @@ OptionsDefaultsState::~OptionsDefaultsState()
9191
*/
9292
void OptionsDefaultsState::btnYesClick(Action *action)
9393
{
94-
std::vector< std::pair<std::string, bool> > prevMods(Options::mods);
95-
Options::resetDefault();
94+
Options::resetDefault(false);
9695
_game->loadLanguages();
97-
98-
if (_origin == OPT_MENU && prevMods != Options::mods)
99-
{
100-
Options::reload = true;
101-
}
102-
10396
_game->popState();
10497
_state->btnOkClick(action);
10598
}

0 commit comments

Comments
 (0)