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); ui->selectorList->setCurrentRow(0);
} }
ConfigureDialog::~ConfigureDialog() { ConfigureDialog::~ConfigureDialog() = default;
Settings::CopyValues(Settings::game_values, Settings::global_values);
}
void ConfigureDialog::SetConfiguration() {} void ConfigureDialog::SetConfiguration() {}

View File

@@ -1039,6 +1039,13 @@ void GMainWindow::BootGame(const QString& filename) {
LOG_INFO(Frontend, "yuzu starting..."); LOG_INFO(Frontend, "yuzu starting...");
StoreRecentFile(filename); // Put the filename on top of the list 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) { if (UISettings::values.select_user_on_boot) {
SelectAndSetCurrentUser(); SelectAndSetCurrentUser();
} }
@@ -1818,6 +1825,8 @@ void GMainWindow::OnStopGame() {
return; return;
} }
Settings::SwapValues(Settings::ValuesSwapTarget::ToGlobal);
ShutdownGame(); ShutdownGame();
} }