Cheevos: Support logging in while disabled

This commit is contained in:
Connor McLaughlin
2021-02-28 19:00:37 +10:00
parent bc9ca302b8
commit 98be448140
5 changed files with 123 additions and 82 deletions

View File

@ -53,6 +53,7 @@ void AchievementSettingsWidget::updateEnableState()
const bool enabled = m_host_interface->GetBoolSettingValue("Cheevos", "Enabled", false);
m_ui.testMode->setEnabled(enabled);
m_ui.useFirstDiscFromPlaylist->setEnabled(enabled);
m_ui.richPresence->setEnabled(enabled);
}
void AchievementSettingsWidget::updateLoginState()
@ -80,7 +81,7 @@ void AchievementSettingsWidget::updateLoginState()
void AchievementSettingsWidget::onLoginLogoutPressed()
{
if (Cheevos::IsLoggedIn())
if (!m_host_interface->GetStringSettingValue("Cheevos", "Username").empty())
{
m_host_interface->executeOnEmulationThread([]() { Cheevos::Logout(); }, true);
updateLoginState();