diff options
-rw-r--r-- | src/video_core/shader/async_shaders.cpp | 4 | ||||
-rw-r--r-- | src/yuzu/game_list.cpp | 2 | ||||
-rw-r--r-- | src/yuzu/game_list_worker.cpp | 2 | ||||
-rw-r--r-- | src/yuzu/main.cpp | 55 | ||||
-rw-r--r-- | src/yuzu/main.h | 2 | ||||
-rw-r--r-- | src/yuzu/main.ui | 9 | ||||
-rw-r--r-- | src/yuzu/uisettings.h | 8 |
7 files changed, 54 insertions, 28 deletions
diff --git a/src/video_core/shader/async_shaders.cpp b/src/video_core/shader/async_shaders.cpp index 6c19eaf07..f815584f7 100644 --- a/src/video_core/shader/async_shaders.cpp +++ b/src/video_core/shader/async_shaders.cpp @@ -42,8 +42,8 @@ void AsyncShaders::AllocateWorkers() { // Create workers for (std::size_t i = 0; i < num_workers; i++) { context_list.push_back(emu_window.CreateSharedContext()); - worker_threads.push_back(std::move( - std::thread(&AsyncShaders::ShaderCompilerThread, this, context_list[i].get()))); + worker_threads.push_back( + std::thread(&AsyncShaders::ShaderCompilerThread, this, context_list[i].get())); } } diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 62acc3720..967ef4a21 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp @@ -406,7 +406,7 @@ bool GameList::isEmpty() const { type == GameListItemType::SysNandDir)) { item_model->invisibleRootItem()->removeRow(child->row()); i--; - }; + } } return !item_model->invisibleRootItem()->hasChildren(); } diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp index 643ca6491..c9a395222 100644 --- a/src/yuzu/game_list_worker.cpp +++ b/src/yuzu/game_list_worker.cpp @@ -374,7 +374,7 @@ void GameListWorker::run() { ScanFileSystem(ScanTarget::PopulateGameList, game_dir.path.toStdString(), game_dir.deep_scan ? 256 : 0, game_list_dir); } - }; + } emit Finished(watch_list); } diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 592993c36..3ef59fbad 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -894,6 +894,8 @@ void GMainWindow::ConnectMenuEvents() { connect(ui.action_Open_FAQ, &QAction::triggered, this, &GMainWindow::OnOpenFAQ); connect(ui.action_Restart, &QAction::triggered, this, [this] { BootGame(QString(game_path)); }); connect(ui.action_Configure, &QAction::triggered, this, &GMainWindow::OnConfigure); + connect(ui.action_Configure_Current_Game, &QAction::triggered, this, + &GMainWindow::OnConfigurePerGame); // View connect(ui.action_Single_Window_Mode, &QAction::triggered, this, @@ -1167,6 +1169,7 @@ void GMainWindow::ShutdownGame() { ui.action_Pause->setEnabled(false); ui.action_Stop->setEnabled(false); ui.action_Restart->setEnabled(false); + ui.action_Configure_Current_Game->setEnabled(false); ui.action_Report_Compatibility->setEnabled(false); ui.action_Load_Amiibo->setEnabled(false); ui.action_Capture_Screenshot->setEnabled(false); @@ -1718,26 +1721,7 @@ void GMainWindow::OnGameListOpenPerGameProperties(const std::string& file) { return; } - ConfigurePerGame dialog(this, title_id); - dialog.LoadFromFile(v_file); - auto result = dialog.exec(); - if (result == QDialog::Accepted) { - dialog.ApplyConfiguration(); - - const auto reload = UISettings::values.is_game_list_reload_pending.exchange(false); - if (reload) { - game_list->PopulateAsync(UISettings::values.game_dirs); - } - - // Do not cause the global config to write local settings into the config file - Settings::RestoreGlobalState(); - - if (!Core::System::GetInstance().IsPoweredOn()) { - config->Save(); - } - } else { - Settings::RestoreGlobalState(); - } + OpenPerGameConfiguration(title_id, file); } void GMainWindow::OnMenuLoadFile() { @@ -2066,6 +2050,7 @@ void GMainWindow::OnStartGame() { ui.action_Pause->setEnabled(true); ui.action_Stop->setEnabled(true); ui.action_Restart->setEnabled(true); + ui.action_Configure_Current_Game->setEnabled(true); ui.action_Report_Compatibility->setEnabled(true); discord_rpc->Update(); @@ -2255,6 +2240,36 @@ void GMainWindow::OnConfigure() { UpdateStatusButtons(); } +void GMainWindow::OnConfigurePerGame() { + const u64 title_id = Core::System::GetInstance().CurrentProcess()->GetTitleID(); + OpenPerGameConfiguration(title_id, game_path.toStdString()); +} + +void GMainWindow::OpenPerGameConfiguration(u64 title_id, const std::string& file_name) { + const auto v_file = Core::GetGameFileFromPath(vfs, file_name); + + ConfigurePerGame dialog(this, title_id); + dialog.LoadFromFile(v_file); + auto result = dialog.exec(); + if (result == QDialog::Accepted) { + dialog.ApplyConfiguration(); + + const auto reload = UISettings::values.is_game_list_reload_pending.exchange(false); + if (reload) { + game_list->PopulateAsync(UISettings::values.game_dirs); + } + + // Do not cause the global config to write local settings into the config file + Settings::RestoreGlobalState(); + + if (!Core::System::GetInstance().IsPoweredOn()) { + config->Save(); + } + } else { + Settings::RestoreGlobalState(); + } +} + void GMainWindow::OnLoadAmiibo() { const QString extensions{QStringLiteral("*.bin")}; const QString file_filter = tr("Amiibo File (%1);; All Files (*.*)").arg(extensions); diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 73a44a3bf..64c33830d 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -216,6 +216,7 @@ private slots: void OnMenuInstallToNAND(); void OnMenuRecentFile(); void OnConfigure(); + void OnConfigurePerGame(); void OnLoadAmiibo(); void OnOpenYuzuFolder(); void OnAbout(); @@ -249,6 +250,7 @@ private: void ShowMouseCursor(); void OpenURL(const QUrl& url); void LoadTranslation(); + void OpenPerGameConfiguration(u64 title_id, const std::string& file_name); Ui::MainWindow ui; diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index c3a1d715e..87ea985d8 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui @@ -81,6 +81,7 @@ <addaction name="action_Restart"/> <addaction name="separator"/> <addaction name="action_Configure"/> + <addaction name="action_Configure_Current_Game"/> </widget> <widget class="QMenu" name="menu_View"> <property name="title"> @@ -287,6 +288,14 @@ <string>Capture Screenshot</string> </property> </action> + <action name="action_Configure_Current_Game"> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="text"> + <string>Configure Current Game..</string> + </property> + </action> </widget> <resources/> <connections/> diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h index bbfeafc55..2d2e82f15 100644 --- a/src/yuzu/uisettings.h +++ b/src/yuzu/uisettings.h @@ -29,14 +29,14 @@ extern const Themes themes; struct GameDir { QString path; - bool deep_scan; - bool expanded; + bool deep_scan = false; + bool expanded = false; bool operator==(const GameDir& rhs) const { return path == rhs.path; - }; + } bool operator!=(const GameDir& rhs) const { return !operator==(rhs); - }; + } }; struct Values { |