diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 9cf739ac37..5c339128df 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -223,6 +223,7 @@ void game_list_frame::LoadSettings() m_category_filters = m_gui_settings->GetGameListCategoryFilters(true); m_grid_category_filters = m_gui_settings->GetGameListCategoryFilters(false); m_draw_compat_status_to_grid = m_gui_settings->GetValue(gui::gl_draw_compat).toBool(); + m_prefer_game_data_icons = m_gui_settings->GetValue(gui::gl_pref_gd_icon).toBool(); m_show_custom_icons = m_gui_settings->GetValue(gui::gl_custom_icon).toBool(); m_play_hover_movies = m_gui_settings->GetValue(gui::gl_hover_gifs).toBool(); @@ -897,8 +898,8 @@ void game_list_frame::OnRefreshFinished() } } - // Let's fetch the game data icon if the path was empty for some reason - if (entry->info.icon_path.empty()) + // Let's fetch the game data icon if preferred or if the path was empty for some reason + if (m_prefer_game_data_icons || entry->info.icon_path.empty()) { if (std::string icon_path = other->info.path + "/" + localized_icon; fs::is_file(icon_path)) { @@ -909,6 +910,19 @@ void game_list_frame::OnRefreshFinished() entry->info.icon_path = std::move(icon_path); } } + + // Let's fetch the game data movie if preferred or if the path was empty + if (m_prefer_game_data_icons || entry->info.movie_path.empty()) + { + if (std::string movie_path = other->info.path + "/" + localized_movie; fs::is_file(movie_path)) + { + entry->info.movie_path = std::move(movie_path); + } + else if (std::string movie_path = other->info.path + "/ICON1.PAM"; fs::is_file(movie_path)) + { + entry->info.movie_path = std::move(movie_path); + } + } } } @@ -3001,6 +3015,16 @@ void game_list_frame::SetShowCompatibilityInGrid(bool show) m_gui_settings->SetValue(gui::gl_draw_compat, show); } +void game_list_frame::SetPreferGameDataIcons(bool enabled) +{ + if (m_prefer_game_data_icons != enabled) + { + m_prefer_game_data_icons = enabled; + m_gui_settings->SetValue(gui::gl_pref_gd_icon, enabled); + Refresh(true); + } +} + void game_list_frame::SetShowCustomIcons(bool show) { if (m_show_custom_icons != show) diff --git a/rpcs3/rpcs3qt/game_list_frame.h b/rpcs3/rpcs3qt/game_list_frame.h index 7282f1b745..5e4156f09d 100644 --- a/rpcs3/rpcs3qt/game_list_frame.h +++ b/rpcs3/rpcs3qt/game_list_frame.h @@ -73,6 +73,7 @@ public Q_SLOTS: void SetListMode(const bool& is_list); void SetSearchText(const QString& text); void SetShowCompatibilityInGrid(bool show); + void SetPreferGameDataIcons(bool enabled); void SetShowCustomIcons(bool show); void SetPlayHoverGifs(bool play); void FocusAndSelectFirstEntryIfNoneIs(); @@ -212,6 +213,7 @@ private: qreal m_margin_factor; qreal m_text_factor; bool m_draw_compat_status_to_grid = false; + bool m_prefer_game_data_icons = false; bool m_show_custom_icons = true; bool m_play_hover_movies = true; std::optional> m_refresh_funcs_manage_type{std::in_place}; diff --git a/rpcs3/rpcs3qt/gui_settings.h b/rpcs3/rpcs3qt/gui_settings.h index b3fab563cf..fbf66dceed 100644 --- a/rpcs3/rpcs3qt/gui_settings.h +++ b/rpcs3/rpcs3qt/gui_settings.h @@ -214,6 +214,7 @@ namespace gui const gui_save gl_show_hidden = gui_save(game_list, "show_hidden", false); const gui_save gl_hidden_list = gui_save(game_list, "hidden_list", QStringList()); const gui_save gl_draw_compat = gui_save(game_list, "draw_compat", false); + const gui_save gl_pref_gd_icon = gui_save(game_list, "pref_gd_icon", false); const gui_save gl_custom_icon = gui_save(game_list, "custom_icon", true); const gui_save gl_hover_gifs = gui_save(game_list, "hover_gifs", true); diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index 47c6a5be68..eecb3be62e 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -3380,6 +3380,7 @@ void main_window::CreateConnects() ResizeIcons(index); }); + connect(ui->actionPreferGameDataIcons, &QAction::triggered, m_game_list_frame, &game_list_frame::SetPreferGameDataIcons); connect(ui->showCustomIconsAct, &QAction::triggered, m_game_list_frame, &game_list_frame::SetShowCustomIcons); connect(ui->playHoverGifsAct, &QAction::triggered, m_game_list_frame, &game_list_frame::SetPlayHoverGifs); @@ -3679,6 +3680,7 @@ void main_window::ConfigureGuiFromSettings() m_game_list_frame->SetShowHidden(ui->showHiddenEntriesAct->isChecked()); // prevent GetValue in m_game_list_frame->LoadSettings ui->showCompatibilityInGridAct->setChecked(m_gui_settings->GetValue(gui::gl_draw_compat).toBool()); + ui->actionPreferGameDataIcons->setChecked(m_gui_settings->GetValue(gui::gl_pref_gd_icon).toBool()); ui->showCustomIconsAct->setChecked(m_gui_settings->GetValue(gui::gl_custom_icon).toBool()); ui->playHoverGifsAct->setChecked(m_gui_settings->GetValue(gui::gl_hover_gifs).toBool()); diff --git a/rpcs3/rpcs3qt/main_window.ui b/rpcs3/rpcs3qt/main_window.ui index 5bc38ff754..9cf59d35a0 100644 --- a/rpcs3/rpcs3qt/main_window.ui +++ b/rpcs3/rpcs3qt/main_window.ui @@ -35,7 +35,7 @@ true - QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks|QMainWindow::GroupedDragging + QMainWindow::DockOption::AllowNestedDocks|QMainWindow::DockOption::AllowTabbedDocks|QMainWindow::DockOption::AnimatedDocks|QMainWindow::DockOption::GroupedDragging @@ -344,6 +344,7 @@ + @@ -1415,6 +1416,14 @@ Savestates + + + true + + + Prefer Game Data Icons + +