mirror of https://github.com/PCSX2/pcsx2.git
first time wizard "overwrite": obey default console sources
this is actually not a FTW issue but rather a console sources issue. the console log sources are not c++ classes and therefore don't get initialized other than when [attempting to] loading them from the ini file (where if the ini doesn't exist then they get their default values). however, during first time wizard, when choosing "overwrite", the console sources are saved without ever getting loaded and so end up without the default values applied (so all sources as disabled). this patch makes sure that if we're saving the conlog sources before ever attempting to load them, they'll get saved with the correct default values.
This commit is contained in:
parent
ce8626150e
commit
2c3b3eafbe
|
@ -350,6 +350,13 @@ static const bool ConLogDefaults[] =
|
|||
false
|
||||
};
|
||||
|
||||
// Typically on startup (or during first time wizard when choosing "import"), the
|
||||
// settings are loaded from ini and if the ini doesn't exist then from ConLogDefaults,
|
||||
// but during first time wizard when choosing "overwrite", the first action is "save",
|
||||
// which ends up saving before applying ConLogDefaults, therefore all conlog sources
|
||||
// are saved as disabled. ConLogInitialized is used to detect and avoid this issue.
|
||||
static bool ConLogInitialized = false;
|
||||
|
||||
void ConLog_LoadSaveSettings( IniInterface& ini )
|
||||
{
|
||||
ScopedIniGroup path(ini, L"ConsoleLogSources");
|
||||
|
@ -361,9 +368,14 @@ void ConLog_LoadSaveSettings( IniInterface& ini )
|
|||
{
|
||||
if (ConsoleLogSource* log = ConLogSources[i])
|
||||
{
|
||||
// IsSaving() is for clarity only, since log->Enabled initial value is ignored when loading.
|
||||
if (ini.IsSaving() && !ConLogInitialized)
|
||||
log->Enabled = ConLogDefaults[i];
|
||||
ini.Entry( log->GetCategory() + L"." + log->GetShortName(), log->Enabled, ConLogDefaults[i] );
|
||||
}
|
||||
}
|
||||
|
||||
ConLogInitialized = true;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue