Add Spectator Mode to achievement settings

Spectator Mode is a new mode added by rc_client that allows for achievement and leaderboard functionality, but does not submit this data to the site, partially allowing for offline achievements. It effectively replaces the former settings for disabling achievements, leaderboards, and RP, which are now always active internally as long as the client is active.
This commit is contained in:
LillyJadeKatrin
2024-04-03 16:58:22 -04:00
parent fd0de1b01f
commit d8ef3ee6c5
6 changed files with 34 additions and 0 deletions

View File

@ -111,6 +111,7 @@ void AchievementManager::LoadGame(const std::string& file_path, const DiscIO::Vo
}
rc_client_set_unofficial_enabled(m_client, Config::Get(Config::RA_UNOFFICIAL_ENABLED));
rc_client_set_encore_mode_enabled(m_client, Config::Get(Config::RA_ENCORE_ENABLED));
rc_client_set_spectator_mode_enabled(m_client, Config::Get(Config::RA_SPECTATOR_ENABLED));
if (volume)
{
std::lock_guard lg{m_lock};
@ -256,6 +257,11 @@ bool AchievementManager::IsHardcoreModeActive() const
return rc_client_is_processing_required(m_client);
}
void AchievementManager::SetSpectatorMode()
{
rc_client_set_spectator_mode_enabled(m_client, Config::Get(Config::RA_SPECTATOR_ENABLED));
}
std::string_view AchievementManager::GetPlayerDisplayName() const
{
if (!HasAPIToken())