Achievements: Show primed/challenge-in-progress achievements

This commit is contained in:
Connor McLaughlin
2022-09-21 22:02:54 +10:00
parent a55ca69b87
commit cba4bb4ab2
6 changed files with 143 additions and 28 deletions

View File

@ -9,7 +9,8 @@ namespace Achievements {
#ifdef WITH_CHEEVOS
// Implemented in Host.
extern bool Reset();
extern bool ConfirmSystemReset();
extern void ResetRuntime();
extern bool DoState(StateWrapper& sw);
extern void GameChanged(const std::string& path, CDImage* image);
@ -28,10 +29,11 @@ extern bool ChallengeModeActive();
#else
// Make noops when compiling without cheevos.
static inline bool Reset()
static inline bool ConfirmSystemReset()
{
return true;
}
static inline void ResetRuntime() {}
static inline bool DoState(StateWrapper& sw)
{
return true;

View File

@ -898,6 +898,11 @@ void System::ResetSystem()
if (!IsValid())
return;
#ifdef WITH_CHEEVOS
if (!Achievements::ConfirmSystemReset())
return;
#endif
InternalReset();
ResetPerformanceCounters();
ResetThrottler();
@ -1650,7 +1655,7 @@ bool System::DoState(StateWrapper& sw, HostDisplayTexture** host_texture, bool u
{
#ifdef WITH_CHEEVOS
// loading an old state without cheevos, so reset the runtime
Achievements::Reset();
Achievements::ResetRuntime();
#endif
}
}
@ -1686,7 +1691,7 @@ void System::InternalReset()
ResetPerformanceCounters();
#ifdef WITH_CHEEVOS
Achievements::Reset();
Achievements::ResetRuntime();
#endif
g_gpu->ResetGraphicsAPIState();