mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 08:51:28 +12:00
Qt: always use last boot path for game boot actions
The actual path caused the GUI to try to run elfs directly after booting a game from a loader.
This commit is contained in:
parent
11487cd591
commit
404d08ef6d
3 changed files with 19 additions and 8 deletions
|
@ -731,18 +731,23 @@ game_boot_result Emulator::GetElfPathFromDir(std::string& elf_path, const std::s
|
||||||
|
|
||||||
game_boot_result Emulator::BootGame(const std::string& path, const std::string& title_id, bool direct, cfg_mode config_mode, const std::string& config_path)
|
game_boot_result Emulator::BootGame(const std::string& path, const std::string& title_id, bool direct, cfg_mode config_mode, const std::string& config_path)
|
||||||
{
|
{
|
||||||
auto save_args = std::make_tuple(m_path, argv, envp, data, disc, klic, hdd1, m_config_mode, m_config_path);
|
auto save_args = std::make_tuple(m_path, m_path_original, argv, envp, data, disc, klic, hdd1, m_config_mode, m_config_path);
|
||||||
|
|
||||||
auto restore_on_no_boot = [&](game_boot_result result)
|
auto restore_on_no_boot = [&](game_boot_result result)
|
||||||
{
|
{
|
||||||
if (IsStopped() || result != game_boot_result::no_errors)
|
if (IsStopped() || result != game_boot_result::no_errors)
|
||||||
{
|
{
|
||||||
std::tie(m_path, argv, envp, data, disc, klic, hdd1, m_config_mode, m_config_path) = std::move(save_args);
|
std::tie(m_path, m_path_original, argv, envp, data, disc, klic, hdd1, m_config_mode, m_config_path) = std::move(save_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (m_path_original.empty() || config_mode != cfg_mode::continuous)
|
||||||
|
{
|
||||||
|
m_path_original = m_path;
|
||||||
|
}
|
||||||
|
|
||||||
m_path_old = m_path;
|
m_path_old = m_path;
|
||||||
|
|
||||||
m_config_mode = config_mode;
|
m_config_mode = config_mode;
|
||||||
|
|
|
@ -122,6 +122,7 @@ class Emulator final
|
||||||
std::string m_config_path;
|
std::string m_config_path;
|
||||||
std::string m_path;
|
std::string m_path;
|
||||||
std::string m_path_old;
|
std::string m_path_old;
|
||||||
|
std::string m_path_original;
|
||||||
std::string m_title_id;
|
std::string m_title_id;
|
||||||
std::string m_title;
|
std::string m_title;
|
||||||
std::string m_app_version;
|
std::string m_app_version;
|
||||||
|
@ -235,6 +236,11 @@ public:
|
||||||
return m_path;
|
return m_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::string& GetLastBoot() const
|
||||||
|
{
|
||||||
|
return m_path_original;
|
||||||
|
}
|
||||||
|
|
||||||
const std::string& GetTitleID() const
|
const std::string& GetTitleID() const
|
||||||
{
|
{
|
||||||
return m_title_id;
|
return m_title_id;
|
||||||
|
|
|
@ -259,7 +259,7 @@ QString main_window::GetCurrentTitle()
|
||||||
QString title = qstr(Emu.GetTitleAndTitleID());
|
QString title = qstr(Emu.GetTitleAndTitleID());
|
||||||
if (title.isEmpty())
|
if (title.isEmpty())
|
||||||
{
|
{
|
||||||
title = qstr(Emu.GetBoot());
|
title = qstr(Emu.GetLastBoot());
|
||||||
}
|
}
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
@ -383,7 +383,7 @@ void main_window::OnPlayOrPause()
|
||||||
gui_log.notice("Booting from OnPlayOrPause...");
|
gui_log.notice("Booting from OnPlayOrPause...");
|
||||||
Boot(m_selected_game->info.path, m_selected_game->info.serial);
|
Boot(m_selected_game->info.path, m_selected_game->info.serial);
|
||||||
}
|
}
|
||||||
else if (const auto path = Emu.GetBoot(); !path.empty())
|
else if (const std::string path = Emu.GetLastBoot(); !path.empty())
|
||||||
{
|
{
|
||||||
if (const auto error = Emu.Load(); error != game_boot_result::no_errors)
|
if (const auto error = Emu.Load(); error != game_boot_result::no_errors)
|
||||||
{
|
{
|
||||||
|
@ -1971,7 +1971,7 @@ void main_window::BootRecentAction(const QAction* act)
|
||||||
if (contains_path)
|
if (contains_path)
|
||||||
{
|
{
|
||||||
// clear menu of actions
|
// clear menu of actions
|
||||||
for (auto action : m_recent_game_acts)
|
for (QAction* action : m_recent_game_acts)
|
||||||
{
|
{
|
||||||
ui->bootRecentMenu->removeAction(action);
|
ui->bootRecentMenu->removeAction(action);
|
||||||
}
|
}
|
||||||
|
@ -2062,7 +2062,7 @@ void main_window::AddRecentAction(const q_string_pair& entry)
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear menu of actions
|
// clear menu of actions
|
||||||
for (auto action : m_recent_game_acts)
|
for (QAction* action : m_recent_game_acts)
|
||||||
{
|
{
|
||||||
ui->bootRecentMenu->removeAction(action);
|
ui->bootRecentMenu->removeAction(action);
|
||||||
}
|
}
|
||||||
|
@ -2915,7 +2915,7 @@ void main_window::CreateDockWindows()
|
||||||
|
|
||||||
ui->toolbar_start->setIcon(m_icon_play);
|
ui->toolbar_start->setIcon(m_icon_play);
|
||||||
}
|
}
|
||||||
else if (const auto& path = Emu.GetBoot(); !path.empty()) // Restartable games
|
else if (const std::string& path = Emu.GetLastBoot(); !path.empty()) // Restartable games
|
||||||
{
|
{
|
||||||
tooltip = tr("Restart %0").arg(GetCurrentTitle());
|
tooltip = tr("Restart %0").arg(GetCurrentTitle());
|
||||||
|
|
||||||
|
@ -2979,7 +2979,7 @@ void main_window::ConfigureGuiFromSettings()
|
||||||
m_rg_entries = m_gui_settings->Var2List(m_gui_settings->GetValue(gui::rg_entries));
|
m_rg_entries = m_gui_settings->Var2List(m_gui_settings->GetValue(gui::rg_entries));
|
||||||
|
|
||||||
// clear recent games menu of actions
|
// clear recent games menu of actions
|
||||||
for (auto act : m_recent_game_acts)
|
for (QAction* act : m_recent_game_acts)
|
||||||
{
|
{
|
||||||
ui->bootRecentMenu->removeAction(act);
|
ui->bootRecentMenu->removeAction(act);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue