From bb1461ce6c5b2dd8ead3646022b41a5852877b74 Mon Sep 17 00:00:00 2001 From: lat9nq Date: Thu, 18 Jun 2020 15:17:02 -0400 Subject: [PATCH] configuration: boot a game using per-game settings Swaps values where needed to boot a game. --- src/yuzu/configuration/configure_dialog.cpp | 4 +--- src/yuzu/main.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp index 766c1aef69..98ba5b009f 100644 --- a/src/yuzu/configuration/configure_dialog.cpp +++ b/src/yuzu/configuration/configure_dialog.cpp @@ -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() {} diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 8a26b5b6bc..683dec8b11 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -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(); }