diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index eb72097a40..1433750ae7 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -12,6 +12,7 @@ #include "gui_settings.h" #include "game_list.h" #include "game_list_grid.h" +#include "patch_manager_dialog.h" #include "Emu/Memory/vm.h" #include "Emu/System.h" @@ -916,6 +917,7 @@ void game_list_frame::ShowContextMenu(const QPoint &pos) QAction* pad_configure = menu.addAction(gameinfo->hasCustomPadConfig ? tr("&Change Custom Gamepad Configuration") : tr("&Create Custom Gamepad Configuration")); + QAction* configure_patches = menu.addAction(tr("&Configure Game Patches")); QAction* create_ppu_cache = menu.addAction(tr("&Create PPU Cache")); menu.addSeparator(); QAction* rename_title = menu.addAction(tr("&Rename In Game List")); @@ -1095,6 +1097,19 @@ void game_list_frame::ShowContextMenu(const QPoint &pos) } } }); + connect(configure_patches, &QAction::triggered, [this, current_game, gameinfo]() + { + std::unordered_map> games; + for (const auto& game : m_game_data) + { + if (game) + { + games[game->info.serial].insert(game_list_frame::GetGameVersion(game)); + } + } + patch_manager_dialog patch_manager(m_gui_settings, games, current_game.serial, this); + patch_manager.exec(); + }); connect(open_game_folder, &QAction::triggered, [current_game]() { gui::utils::open_dir(current_game.path); diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 08e3b670ca..d96d736b32 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -1649,7 +1649,7 @@ void main_window::CreateConnects() } } } - patch_manager_dialog patch_manager(m_gui_settings, games, this); + patch_manager_dialog patch_manager(m_gui_settings, games, "", this); patch_manager.exec(); }); diff --git a/rpcs3/rpcs3qt/patch_manager_dialog.cpp b/rpcs3/rpcs3qt/patch_manager_dialog.cpp index 1b16b05cea..3bc838aa72 100644 --- a/rpcs3/rpcs3qt/patch_manager_dialog.cpp +++ b/rpcs3/rpcs3qt/patch_manager_dialog.cpp @@ -52,7 +52,7 @@ enum node_level : int patch_level }; -patch_manager_dialog::patch_manager_dialog(std::shared_ptr gui_settings, std::unordered_map> games, QWidget* parent) +patch_manager_dialog::patch_manager_dialog(std::shared_ptr gui_settings, std::unordered_map> games, const std::string& search_term, QWidget* parent) : QDialog(parent) , m_gui_settings(gui_settings) , m_owned_games(std::move(games)) @@ -68,6 +68,7 @@ patch_manager_dialog::patch_manager_dialog(std::shared_ptr gui_set m_show_owned_games_only = m_gui_settings->GetValue(gui::pm_show_owned).toBool(); // Initialize gui controls + ui->patch_filter->setText(QString::fromStdString(search_term)); ui->cb_enable_legacy_patches->setChecked(m_legacy_patches_enabled); ui->cb_owned_games_only->setChecked(m_show_owned_games_only); diff --git a/rpcs3/rpcs3qt/patch_manager_dialog.h b/rpcs3/rpcs3qt/patch_manager_dialog.h index c98032af37..d24a723c65 100644 --- a/rpcs3/rpcs3qt/patch_manager_dialog.h +++ b/rpcs3/rpcs3qt/patch_manager_dialog.h @@ -36,7 +36,7 @@ class patch_manager_dialog : public QDialog const QString tr_all_versions = tr("All versions"); public: - explicit patch_manager_dialog(std::shared_ptr gui_settings, std::unordered_map> games, QWidget* parent = nullptr); + explicit patch_manager_dialog(std::shared_ptr gui_settings, std::unordered_map> games, const std::string& search_term, QWidget* parent = nullptr); ~patch_manager_dialog(); int exec() override;