Added Notification Popups for No Achievement Data

Added OnScreenDisplay messages to LoadGameByFilenameAsync to notify the player when any of the potential failures occur.
This commit is contained in:
LillyJadeKatrin 2023-05-23 20:47:38 -04:00
parent b0eb4ccb80
commit 22af13f9e0
1 changed files with 9 additions and 0 deletions

View File

@ -126,6 +126,8 @@ void AchievementManager::LoadGameByFilenameAsync(const std::string& iso_path,
if (resolve_hash_response != ResponseType::SUCCESS || m_game_id == 0) if (resolve_hash_response != ResponseType::SUCCESS || m_game_id == 0)
{ {
callback(resolve_hash_response); callback(resolve_hash_response);
OSD::AddMessage("No RetroAchievements data found for this game.", OSD::Duration::VERY_LONG,
OSD::Color::RED);
return; return;
} }
@ -133,11 +135,18 @@ void AchievementManager::LoadGameByFilenameAsync(const std::string& iso_path,
if (start_session_response != ResponseType::SUCCESS) if (start_session_response != ResponseType::SUCCESS)
{ {
callback(start_session_response); callback(start_session_response);
OSD::AddMessage("Failed to connect to RetroAchievements server.", OSD::Duration::VERY_LONG,
OSD::Color::RED);
return; return;
} }
const auto fetch_game_data_response = FetchGameData(); const auto fetch_game_data_response = FetchGameData();
m_is_game_loaded = fetch_game_data_response == ResponseType::SUCCESS; m_is_game_loaded = fetch_game_data_response == ResponseType::SUCCESS;
if (!m_is_game_loaded)
{
OSD::AddMessage("Unable to retrieve data from RetroAchievements server.",
OSD::Duration::VERY_LONG, OSD::Color::RED);
}
// Claim the lock, then queue the fetch unlock data calls, then initialize the unlock map in // Claim the lock, then queue the fetch unlock data calls, then initialize the unlock map in
// ActivateDeactiveAchievements. This allows the calls to process while initializing the // ActivateDeactiveAchievements. This allows the calls to process while initializing the