From 184108905425b3fc453dfc210ae966a69668bac3 Mon Sep 17 00:00:00 2001 From: LillyJadeKatrin Date: Tue, 23 May 2023 08:51:54 -0400 Subject: [PATCH] Added Notification Popups for Game Start Added an OnScreenDisplay message to LoadGameByFilenameAsync to display a message when a player starts a game with achievements, notifying them of their current score. The score displayed is challenge points if the player is in challenge mode or challenge + casual if the player is in casual mode. A second message tells the player which mode they are in. To match RetroAchievements' website interface, the messages are blue for casual and gold for challenge. --- Source/Core/Core/AchievementManager.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/AchievementManager.cpp b/Source/Core/Core/AchievementManager.cpp index b6a1879642..10caf88387 100644 --- a/Source/Core/Core/AchievementManager.cpp +++ b/Source/Core/Core/AchievementManager.cpp @@ -156,6 +156,23 @@ void AchievementManager::LoadGameByFilenameAsync(const std::string& iso_path, std::lock_guard lg{m_lock}; LoadUnlockData([](ResponseType r_type) {}); ActivateDeactivateAchievements(); + PointSpread spread = TallyScore(); + if (hardcore_mode_enabled) + { + OSD::AddMessage(fmt::format("You have {}/{} achievements worth {}/{} points", + spread.hard_unlocks, spread.total_count, spread.hard_points, + spread.total_points), + OSD::Duration::VERY_LONG, OSD::Color::YELLOW); + OSD::AddMessage("Hardcore mode is ON", OSD::Duration::VERY_LONG, OSD::Color::YELLOW); + } + else + { + OSD::AddMessage(fmt::format("You have {}/{} achievements worth {}/{} points", + spread.hard_unlocks + spread.soft_unlocks, spread.total_count, + spread.hard_points + spread.soft_points, spread.total_points), + OSD::Duration::VERY_LONG, OSD::Color::CYAN); + OSD::AddMessage("Hardcore mode is OFF", OSD::Duration::VERY_LONG, OSD::Color::CYAN); + } } ActivateDeactivateLeaderboards(); ActivateDeactivateRichPresence(); @@ -591,7 +608,7 @@ AchievementManager::PointSpread AchievementManager::TallyScore() const spread.hard_points += points; } else if (entry.second.remote_unlock_status == UnlockStatus::UnlockType::SOFTCORE || - entry.second.session_unlock_count > 0) + entry.second.session_unlock_count > 0) { spread.soft_unlocks++; spread.soft_points += points;