Cheevos: Add RAIntergration support

This commit is contained in:
Connor McLaughlin
2022-04-18 15:09:21 +10:00
parent 8b61fb8b58
commit 9a5ef2d0a2
17 changed files with 1997 additions and 22 deletions

View File

@ -4,6 +4,8 @@
#include <functional>
#include <optional>
#include <string>
#include <utility>
#include <vector>
class CDImage;
class StateWrapper;
@ -51,6 +53,25 @@ extern bool g_active;
extern bool g_challenge_mode;
extern u32 g_game_id;
// RAIntegration only exists for Windows, so no point checking it on other platforms.
#ifdef WITH_RAINTEGRATION
extern bool g_using_raintegration;
static ALWAYS_INLINE bool IsUsingRAIntegration()
{
return g_using_raintegration;
}
#else
static ALWAYS_INLINE bool IsUsingRAIntegration()
{
return false;
}
#endif
ALWAYS_INLINE bool IsActive()
{
return g_active;
@ -123,4 +144,15 @@ TinyString GetAchievementProgressText(const Achievement& achievement);
void UnlockAchievement(u32 achievement_id, bool add_notification = true);
void SubmitLeaderboard(u32 leaderboard_id, int value);
#ifdef WITH_RAINTEGRATION
void SwitchToRAIntegration();
namespace RAIntegration {
void MainWindowChanged(void* new_handle);
void GameChanged();
std::vector<std::pair<int, const char*>> GetMenuItems();
void ActivateMenuItem(int item);
} // namespace RAIntegration
#endif
} // namespace Cheevos