Qt: Fix double-clicking psexes/psfs in game list

This commit is contained in:
Connor McLaughlin
2021-03-16 01:00:47 +10:00
parent 299ba60b8d
commit a0086851ce
4 changed files with 28 additions and 25 deletions

View File

@ -706,6 +706,20 @@ bool CommonHostInterface::SaveState(bool global, s32 slot)
return true;
}
bool CommonHostInterface::CanResumeSystemFromFile(const char* filename)
{
if (GetBoolSettingValue("Main", "SaveStateOnExit", true) && !IsCheevosChallengeModeActive())
{
const GameListEntry* entry = m_game_list->GetEntryForPath(filename);
if (entry)
return !entry->code.empty();
else
return !System::GetGameCodeForPath(filename, true).empty();
}
return false;
}
bool CommonHostInterface::ResumeSystemFromState(const char* filename, bool boot_on_failure)
{
SystemBootParameters boot_params;

View File

@ -180,6 +180,9 @@ public:
/// Saves the current emulation state to a file. Specifying a slot of -1 saves the "resume" save state.
bool SaveState(bool global, s32 slot);
/// Returns true if the specified file/disc image is resumable.
bool CanResumeSystemFromFile(const char* filename);
/// Loads the resume save state for the given game. Optionally boots the game anyway if loading fails.
bool ResumeSystemFromState(const char* filename, bool boot_on_failure);