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

@ -113,6 +113,11 @@ bool CommonHostInterface::Initialize()
CreateImGuiContext();
#ifdef WITH_CHEEVOS
#ifdef WITH_RAINTEGRATION
if (GetBoolSettingValue("Cheevos", "UseRAIntegration", false))
Cheevos::SwitchToRAIntegration();
#endif
UpdateCheevosActive();
#endif
@ -3287,6 +3292,10 @@ void CommonHostInterface::SetDefaultSettings(SettingsInterface& si)
si.SetBoolValue("Cheevos", "UseFirstDiscFromPlaylist", true);
si.DeleteValue("Cheevos", "Username");
si.DeleteValue("Cheevos", "Token");
#ifdef WITH_RAINTEGRATION
si.SetBoolValue("Cheevos", "UseRAIntegration", false);
#endif
#endif
}
@ -4377,6 +4386,11 @@ void CommonHostInterface::UpdateCheevosActive()
const bool cheevos_rich_presence = GetBoolSettingValue("Cheevos", "RichPresence", true);
const bool cheevos_hardcore = GetBoolSettingValue("Cheevos", "ChallengeMode", false);
#ifdef WITH_RAINTEGRATION
if (Cheevos::IsUsingRAIntegration())
return;
#endif
if (cheevos_enabled != Cheevos::IsActive() || cheevos_test_mode != Cheevos::IsTestModeActive() ||
cheevos_unofficial_test_mode != Cheevos::IsUnofficialTestModeActive() ||
cheevos_use_first_disc_from_playlist != Cheevos::IsUsingFirstDiscFromPlaylist() ||

View File

@ -2328,6 +2328,17 @@ void DrawSettingsWindow()
case SettingsPage::AchievementsSetings:
{
#ifdef WITH_RAINTEGRATION
if (Cheevos::IsUsingRAIntegration())
{
BeginMenuButtons();
ActiveButton(ICON_FA_BAN " RAIntegration is being used instead of the built-in cheevos implementation.",
false, false, ImGuiFullscreen::LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY);
EndMenuButtons();
break;
}
#endif
#ifdef WITH_CHEEVOS
BeginMenuButtons();