configuration: boot a game using per-game settings

Swaps values where needed to boot a game.
This commit is contained in:
lat9nq
2020-06-18 15:17:02 -04:00
parent e66c9a79b5
commit bb1461ce6c
2 changed files with 10 additions and 3 deletions

View File

@@ -30,9 +30,7 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry)
ui->selectorList->setCurrentRow(0);
}
ConfigureDialog::~ConfigureDialog() {
Settings::CopyValues(Settings::game_values, Settings::global_values);
}
ConfigureDialog::~ConfigureDialog() = default;
void ConfigureDialog::SetConfiguration() {}

View File

@@ -1039,6 +1039,13 @@ void GMainWindow::BootGame(const QString& filename) {
LOG_INFO(Frontend, "yuzu starting...");
StoreRecentFile(filename); // Put the filename on top of the list
// Swap settings to use game configuration if need be
Settings::SwapValues(Settings::ValuesSwapTarget::ToGame);
Config per_game_config(filename.toUtf8().constData(), false);
if (Settings::game_values.use_global_values) {
Settings::SwapValues(Settings::ValuesSwapTarget::ToGlobal);
}
if (UISettings::values.select_user_on_boot) {
SelectAndSetCurrentUser();
}
@@ -1818,6 +1825,8 @@ void GMainWindow::OnStopGame() {
return;
}
Settings::SwapValues(Settings::ValuesSwapTarget::ToGlobal);
ShutdownGame();
}