diff --git a/Source/Core/Core/AchievementManager.cpp b/Source/Core/Core/AchievementManager.cpp index bf714c6a17..c974ae2e12 100644 --- a/Source/Core/Core/AchievementManager.cpp +++ b/Source/Core/Core/AchievementManager.cpp @@ -417,6 +417,18 @@ AchievementManager::PingRichPresence(const RichPresence& rich_presence) return r_type; } +void AchievementManager::HandleAchievementTriggeredEvent(const rc_runtime_event_t* runtime_event) +{ + auto it = m_unlock_map.find(runtime_event->id); + if (it == m_unlock_map.end()) + return; + it->second.session_unlock_count++; + m_queue.EmplaceItem([this, runtime_event] { AwardAchievement(runtime_event->id); }); + ActivateDeactivateAchievement(runtime_event->id, Config::Get(Config::RA_ACHIEVEMENTS_ENABLED), + Config::Get(Config::RA_UNOFFICIAL_ENABLED), + Config::Get(Config::RA_ENCORE_ENABLED)); +} + // Every RetroAchievements API call, with only a partial exception for fetch_image, follows // the same design pattern (here, X is the name of the call): // Create a specific rc_api_X_request_t struct and populate with the necessary values diff --git a/Source/Core/Core/AchievementManager.h b/Source/Core/Core/AchievementManager.h index 2412e74587..18be428163 100644 --- a/Source/Core/Core/AchievementManager.h +++ b/Source/Core/Core/AchievementManager.h @@ -69,6 +69,8 @@ private: ResponseType SubmitLeaderboard(AchievementId leaderboard_id, int value); ResponseType PingRichPresence(const RichPresence& rich_presence); + void HandleAchievementTriggeredEvent(const rc_runtime_event_t* runtime_event); + template ResponseType Request(RcRequest rc_request, RcResponse* rc_response, const std::function& init_request,