From 5e8ae4fa8a588c127c1e47e80db3a257f0691357 Mon Sep 17 00:00:00 2001 From: Steveice10 <1269164+Steveice10@users.noreply.github.com> Date: Wed, 12 Jul 2023 18:54:11 -0700 Subject: [PATCH] qt: Fix per-game config loading for 3DSX/ELF. (#6691) Co-authored-by: Michael Theall --- .../configuration/configure_per_game.cpp | 3 ++- src/citra_qt/main.cpp | 18 ++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/citra_qt/configuration/configure_per_game.cpp b/src/citra_qt/configuration/configure_per_game.cpp index 4b9f73822..c422a74f9 100644 --- a/src/citra_qt/configuration/configure_per_game.cpp +++ b/src/citra_qt/configuration/configure_per_game.cpp @@ -27,7 +27,8 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const QString Core::System& system_) : QDialog(parent), ui(std::make_unique()), filename{file_name.toStdString()}, title_id{title_id_}, system{system_} { - const auto config_file_name = title_id == 0 ? filename : fmt::format("{:016X}", title_id); + const auto config_file_name = title_id == 0 ? std::string(FileUtil::GetFilename(filename)) + : fmt::format("{:016X}", title_id); game_config = std::make_unique(config_file_name, Config::ConfigType::PerGameConfig); audio_tab = std::make_unique(this); diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index d26e41a94..8452aea78 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -1171,20 +1171,18 @@ void GMainWindow::BootGame(const QString& filename) { movie.PrepareForPlayback(movie_playback_path.toStdString()); } - u64 title_id{0}; const std::string path = filename.toStdString(); const auto loader = Loader::GetLoader(path); - if (loader && loader->ReadProgramId(title_id) == Loader::ResultStatus::Success) { - // Load per game settings - const std::string name{FileUtil::GetFilename(filename.toStdString())}; - const std::string config_file_name = - title_id == 0 ? name : fmt::format("{:016X}", title_id); - Config per_game_config(config_file_name, Config::ConfigType::PerGameConfig); - system.ApplySettings(); + u64 title_id{0}; + loader->ReadProgramId(title_id); - LOG_INFO(Frontend, "Using per game config file for title id {}", config_file_name); - } + // Load per game settings + const std::string name{FileUtil::GetFilename(filename.toStdString())}; + const std::string config_file_name = title_id == 0 ? name : fmt::format("{:016X}", title_id); + LOG_INFO(Frontend, "Loading per game config file for title {}", config_file_name); + Config per_game_config(config_file_name, Config::ConfigType::PerGameConfig); + system.ApplySettings(); Settings::LogSettings();