mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 16:31:28 +12:00
Qt: Display "Reboot With Custom/Global config" on running game
This commit is contained in:
parent
c9e35926f5
commit
232c6c3aaf
2 changed files with 12 additions and 6 deletions
|
@ -34,7 +34,7 @@ void XAudio2Backend::Pause()
|
||||||
|
|
||||||
void XAudio2Backend::Open(u32 /* num_buffers */)
|
void XAudio2Backend::Open(u32 /* num_buffers */)
|
||||||
{
|
{
|
||||||
if (lib.get() == nullptr)
|
if (!lib)
|
||||||
{
|
{
|
||||||
void* hmodule;
|
void* hmodule;
|
||||||
|
|
||||||
|
|
|
@ -838,7 +838,7 @@ void game_list_frame::doubleClickedSlot(QTableWidgetItem *item)
|
||||||
game = GetGameInfoFromItem(item);
|
game = GetGameInfoFromItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (game.get() == nullptr)
|
if (!game)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -865,7 +865,7 @@ void game_list_frame::ShowContextMenu(const QPoint &pos)
|
||||||
}
|
}
|
||||||
|
|
||||||
game_info gameinfo = GetGameInfoFromItem(item);
|
game_info gameinfo = GetGameInfoFromItem(item);
|
||||||
if (gameinfo.get() == nullptr)
|
if (!gameinfo)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -879,12 +879,16 @@ void game_list_frame::ShowContextMenu(const QPoint &pos)
|
||||||
|
|
||||||
// Make Actions
|
// Make Actions
|
||||||
QMenu myMenu;
|
QMenu myMenu;
|
||||||
QAction* boot = new QAction(gameinfo->hasCustomConfig ? tr("&Boot with global configuration") : tr("&Boot"));
|
|
||||||
|
const bool is_current_running_game = (Emu.IsRunning() || Emu.IsPaused()) && currGame.serial == Emu.GetTitleID();
|
||||||
|
|
||||||
|
QAction* boot = new QAction(gameinfo->hasCustomConfig ? tr(is_current_running_game ? "&Reboot with global configuration" : "&Boot with global configuration") : tr("&Boot"));
|
||||||
QFont f = boot->font();
|
QFont f = boot->font();
|
||||||
f.setBold(true);
|
f.setBold(true);
|
||||||
|
|
||||||
if (gameinfo->hasCustomConfig)
|
if (gameinfo->hasCustomConfig)
|
||||||
{
|
{
|
||||||
QAction* boot_custom = myMenu.addAction(tr("&Boot with custom configuration"));
|
QAction* boot_custom = myMenu.addAction(tr(is_current_running_game ? "&Reboot with custom configuration" : "&Boot with custom configuration"));
|
||||||
boot_custom->setFont(f);
|
boot_custom->setFont(f);
|
||||||
connect(boot_custom, &QAction::triggered, [=]
|
connect(boot_custom, &QAction::triggered, [=]
|
||||||
{
|
{
|
||||||
|
@ -896,8 +900,10 @@ void game_list_frame::ShowContextMenu(const QPoint &pos)
|
||||||
{
|
{
|
||||||
boot->setFont(f);
|
boot->setFont(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
myMenu.addAction(boot);
|
myMenu.addAction(boot);
|
||||||
myMenu.addSeparator();
|
myMenu.addSeparator();
|
||||||
|
|
||||||
QAction* configure = myMenu.addAction(gameinfo->hasCustomConfig ? tr("&Change Custom Configuration") : tr("&Create Custom Configuration"));
|
QAction* configure = myMenu.addAction(gameinfo->hasCustomConfig ? tr("&Change Custom Configuration") : tr("&Create Custom Configuration"));
|
||||||
QAction* pad_configure = myMenu.addAction(gameinfo->hasCustomPadConfig ? tr("&Change Custom Gamepad Configuration") : tr("&Create Custom Gamepad Configuration"));
|
QAction* pad_configure = myMenu.addAction(gameinfo->hasCustomPadConfig ? tr("&Change Custom Gamepad Configuration") : tr("&Create Custom Gamepad Configuration"));
|
||||||
QAction* createPPUCache = myMenu.addAction(tr("&Create PPU Cache"));
|
QAction* createPPUCache = myMenu.addAction(tr("&Create PPU Cache"));
|
||||||
|
@ -1852,7 +1858,7 @@ bool game_list_frame::eventFilter(QObject *object, QEvent *event)
|
||||||
|
|
||||||
game_info gameinfo = GetGameInfoFromItem(item);
|
game_info gameinfo = GetGameInfoFromItem(item);
|
||||||
|
|
||||||
if (gameinfo.get() == nullptr)
|
if (!gameinfo)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
LOG_NOTICE(LOADER, "Booting from gamelist by pressing %s...", keyEvent->key() == Qt::Key_Enter ? "Enter" : "Return");
|
LOG_NOTICE(LOADER, "Booting from gamelist by pressing %s...", keyEvent->key() == Qt::Key_Enter ? "Enter" : "Return");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue