Improve the "No game loaded" RA popup

This commit is contained in:
Henrik Rydgård
2025-06-01 11:47:07 +02:00
parent 55ffd4c419
commit e0a98ea54c
2 changed files with 13 additions and 2 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ public:
void SetValue(const std::string &key, const u8 *value, unsigned int size, int max_size);
int GetValueInt(std::string_view key) const;
std::string GetValueString(std::string_view key) const;
std::string GetValueString(std::string_view key) const; // Common keys: "TITLE", "DISC_VERSION"
bool HasKey(std::string_view key) const;
const u8 *GetValueData(std::string_view key, unsigned int *size) const;
+12 -1
View File
@@ -959,9 +959,20 @@ void identify_and_load_callback(int result, const char *error_message, rc_client
break;
}
case RC_NO_GAME_LOADED:
{
GameRegion region = DetectGameRegionFromID(g_paramSFO.GetDiscID());
auto ga = GetI18NCategory(I18NCat::GAME);
std::string_view regionStr = ga->T(GameRegionToString(region));
std::string title(g_paramSFO.GetValueString("TITLE"));
if (region != GameRegion::OTHER) {
title += " (";
title += regionStr;
title += ")";
}
// The current game does not support achievements.
g_OSD.Show(OSDType::MESSAGE_INFO, ac->T("RetroAchievements are not available for this game"), "", g_RAImageID, 3.0f);
g_OSD.Show(OSDType::MESSAGE_INFO, title, ac->T("RetroAchievements are not available for this game"), g_RAImageID, 3.0f);
break;
}
case RC_NO_RESPONSE:
// We lost the internet connection at some point and can't report achievements.
ShowNotLoggedInMessage();