mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
Qt: Simplify hover movie code
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
This commit is contained in:
parent
58327ca23c
commit
ae83c28bc8
3 changed files with 15 additions and 24 deletions
|
@ -666,18 +666,20 @@ void game_list_frame::OnParsingFinished()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
game.has_hover_gif = fs::is_file(game_icon_path + game.info.serial + "/hover.gif");
|
if (std::string movie_path = game_icon_path + game.info.serial + "/hover.gif"; fs::is_file(movie_path))
|
||||||
|
|
||||||
if (!game.has_hover_gif && game.info.movie_path.empty())
|
|
||||||
{
|
{
|
||||||
if (std::string movie_path = sfo_dir + "/" + localized_movie; fs::is_file(movie_path))
|
game.info.movie_path = std::move(movie_path);
|
||||||
{
|
game.has_hover_gif = true;
|
||||||
game.info.movie_path = std::move(movie_path);
|
}
|
||||||
}
|
else if (std::string movie_path = sfo_dir + "/" + localized_movie; fs::is_file(movie_path))
|
||||||
else if (std::string movie_path = sfo_dir + "/ICON1.PAM"; fs::is_file(movie_path))
|
{
|
||||||
{
|
game.info.movie_path = std::move(movie_path);
|
||||||
game.info.movie_path = std::move(movie_path);
|
game.has_hover_pam = true;
|
||||||
}
|
}
|
||||||
|
else if (std::string movie_path = sfo_dir + "/ICON1.PAM"; fs::is_file(movie_path))
|
||||||
|
{
|
||||||
|
game.info.movie_path = std::move(movie_path);
|
||||||
|
game.has_hover_pam = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString serial = QString::fromStdString(game.info.serial);
|
const QString serial = QString::fromStdString(game.info.serial);
|
||||||
|
@ -735,7 +737,6 @@ void game_list_frame::OnParsingFinished()
|
||||||
game.compat = m_game_compat->GetCompatibility(game.info.serial);
|
game.compat = m_game_compat->GetCompatibility(game.info.serial);
|
||||||
game.has_custom_config = fs::is_file(rpcs3::utils::get_custom_config_path(game.info.serial));
|
game.has_custom_config = fs::is_file(rpcs3::utils::get_custom_config_path(game.info.serial));
|
||||||
game.has_custom_pad_config = fs::is_file(rpcs3::utils::get_custom_input_config_path(game.info.serial));
|
game.has_custom_pad_config = fs::is_file(rpcs3::utils::get_custom_input_config_path(game.info.serial));
|
||||||
game.has_hover_pam = !game.info.movie_path.empty();
|
|
||||||
|
|
||||||
m_games.push(std::make_shared<gui_game_info>(std::move(game)));
|
m_games.push(std::make_shared<gui_game_info>(std::move(game)));
|
||||||
};
|
};
|
||||||
|
|
|
@ -48,7 +48,6 @@ void game_list_grid::populate(
|
||||||
{
|
{
|
||||||
clear_list();
|
clear_list();
|
||||||
|
|
||||||
const QString game_icon_path = play_hover_movies ? QString::fromStdString(fs::get_config_dir() + "/Icons/game_icons/") : "";
|
|
||||||
game_list_grid_item* selected_item = nullptr;
|
game_list_grid_item* selected_item = nullptr;
|
||||||
|
|
||||||
blockSignals(true);
|
blockSignals(true);
|
||||||
|
@ -109,11 +108,7 @@ void game_list_grid::populate(
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (play_hover_movies && game->has_hover_gif)
|
if (play_hover_movies && (game->has_hover_gif || game->has_hover_pam))
|
||||||
{
|
|
||||||
item->set_movie_path(game_icon_path % serial % "/hover.gif");
|
|
||||||
}
|
|
||||||
else if (play_hover_movies && game->has_hover_pam)
|
|
||||||
{
|
{
|
||||||
item->set_movie_path(QString::fromStdString(game->info.movie_path));
|
item->set_movie_path(QString::fromStdString(game->info.movie_path));
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,7 +216,6 @@ void game_list_table::populate(
|
||||||
const QLocale locale{};
|
const QLocale locale{};
|
||||||
const Localized localized;
|
const Localized localized;
|
||||||
|
|
||||||
const QString game_icon_path = play_hover_movies ? QString::fromStdString(fs::get_config_dir() + "/Icons/game_icons/") : "";
|
|
||||||
const std::string dev_flash = g_cfg_vfs.get_dev_flash();
|
const std::string dev_flash = g_cfg_vfs.get_dev_flash();
|
||||||
|
|
||||||
int row = 0;
|
int row = 0;
|
||||||
|
@ -292,11 +291,7 @@ void game_list_table::populate(
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (play_hover_movies && game->has_hover_gif)
|
if (play_hover_movies && (game->has_hover_gif || game->has_hover_pam))
|
||||||
{
|
|
||||||
icon_item->set_movie_path(game_icon_path % serial % "/hover.gif");
|
|
||||||
}
|
|
||||||
else if (play_hover_movies && game->has_hover_pam)
|
|
||||||
{
|
{
|
||||||
icon_item->set_movie_path(QString::fromStdString(game->info.movie_path));
|
icon_item->set_movie_path(QString::fromStdString(game->info.movie_path));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue