diff --git a/xbmc/cores/RetroPlayer/cheevos/Cheevos.cpp b/xbmc/cores/RetroPlayer/cheevos/Cheevos.cpp index 37463bccfbb71..8666b468f5669 100644 --- a/xbmc/cores/RetroPlayer/cheevos/Cheevos.cpp +++ b/xbmc/cores/RetroPlayer/cheevos/Cheevos.cpp @@ -23,9 +23,15 @@ using namespace RETRO; // API JSON Field names constexpr auto SUCCESS = "Success"; -constexpr auto GAME_ID = "GameID"; constexpr auto PATCH_DATA = "PatchData"; +constexpr auto GAME_ID = "GameID"; constexpr auto RICH_PRESENCE = "RichPresencePatch"; +constexpr auto GAME_TITLE = "Title"; +constexpr auto PUBLISHER = "Publisher"; +constexpr auto DEVELOPER = "Developer"; +constexpr auto GENRE = "Genre"; +constexpr auto CONSOLE_NAME = "ConsoleName"; +constexpr auto RELEASED = "Released"; constexpr int HASH_SIZE = 33; constexpr int RESPORNSE_SIZE = 64; @@ -110,6 +116,13 @@ bool CCheevos::LoadData() m_richPresenceScript = data[PATCH_DATA][RICH_PRESENCE].asString(); m_richPresenceLoaded = true; + m_title = data[PATCH_DATA][GAME_TITLE].asString(); + m_publisher = data[PATCH_DATA][PUBLISHER].asString(); + m_developer = data[PATCH_DATA][DEVELOPER].asString(); + m_genre = data[PATCH_DATA][GENRE].asString(); + m_consoleName = data[PATCH_DATA][CONSOLE_NAME].asString(); + m_released = data[PATCH_DATA][RELEASED].asString(); + return true; } diff --git a/xbmc/cores/RetroPlayer/cheevos/Cheevos.h b/xbmc/cores/RetroPlayer/cheevos/Cheevos.h index 461cd3e056c5c..e8f8337102392 100644 --- a/xbmc/cores/RetroPlayer/cheevos/Cheevos.h +++ b/xbmc/cores/RetroPlayer/cheevos/Cheevos.h @@ -30,6 +30,13 @@ class CCheevos void EnableRichPresence(); bool GetRichPresenceEvaluation(char* evaluation, size_t size); + std::string GetTitle() { return m_title; } + std::string GetPublisher() { return m_publisher; } + std::string GetDeveloper() { return m_developer; } + std::string GetGenre() { return m_genre; } + std::string GetConsoleName() { return m_consoleName; } + std::string GetReleased() { return m_released; } + private: bool LoadData(); @@ -41,6 +48,14 @@ class CCheevos unsigned m_gameID{}; bool m_richPresenceLoaded{}; + // Game metadata + std::string m_title; + std::string m_publisher; + std::string m_developer; + std::string m_genre; + std::string m_consoleName; + std::string m_released; + const std::map m_extensionToConsole = {{".a26", RC_CONSOLE_ATARI_2600}, {".a78", RC_CONSOLE_ATARI_7800}, {".agb", RC_CONSOLE_GAMEBOY_ADVANCE},