diff --git a/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.cpp b/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.cpp
index 807f321bff..62f6a1e0cb 100644
--- a/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.cpp
+++ b/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.cpp
@@ -13,9 +13,11 @@
#include "Core/Config/AchievementSettings.h"
#include "Core/Config/FreeLookSettings.h"
#include "Core/Config/MainSettings.h"
+#include "Core/Config/UISettings.h"
#include "Core/Core.h"
#include "Core/Movie.h"
#include "Core/System.h"
+#include "UICommon/DiscordPresence.h"
#include "DolphinQt/Config/ControllerInterface/ControllerInterfaceWindow.h"
#include "DolphinQt/Config/ToolTipControls/ToolTipCheckBox.h"
@@ -94,6 +96,10 @@ void AchievementSettingsWidget::CreateLayout()
"submitted to the server.
If this is on at game launch, it will not be turned off "
"until game close, because a RetroAchievements session will not be created.
If "
"this is off at game launch, it can be toggled freely while the game is running."));
+ m_common_discord_presence_enabled_input = new ToolTipCheckBox(tr("Enable Discord Presence"));
+ m_common_discord_presence_enabled_input->SetDescription(
+ tr("Use RetroAchievements rich presence in your Discord status.
Show Current Game on "
+ "Discord must be enabled."));
m_common_progress_enabled_input = new ToolTipCheckBox(tr("Enable Progress Notifications"));
m_common_progress_enabled_input->SetDescription(
tr("Enable progress notifications on achievements.
Displays a brief popup message "
@@ -119,6 +125,9 @@ void AchievementSettingsWidget::CreateLayout()
m_common_layout->addWidget(m_common_encore_enabled_input);
m_common_layout->addWidget(m_common_spectator_enabled_input);
m_common_layout->addWidget(new QLabel(tr("Display Settings")));
+#ifdef USE_DISCORD_PRESENCE
+ m_common_layout->addWidget(m_common_discord_presence_enabled_input);
+#endif // USE_DISCORD_PRESENCE
m_common_layout->addWidget(m_common_progress_enabled_input);
m_common_layout->addWidget(m_common_badges_enabled_input);
@@ -140,6 +149,8 @@ void AchievementSettingsWidget::ConnectWidgets()
&AchievementSettingsWidget::ToggleEncore);
connect(m_common_spectator_enabled_input, &QCheckBox::toggled, this,
&AchievementSettingsWidget::ToggleSpectator);
+ connect(m_common_discord_presence_enabled_input, &QCheckBox::toggled, this,
+ &AchievementSettingsWidget::ToggleDiscordPresence);
connect(m_common_progress_enabled_input, &QCheckBox::toggled, this,
&AchievementSettingsWidget::ToggleProgress);
connect(m_common_badges_enabled_input, &QCheckBox::toggled, this,
@@ -195,6 +206,11 @@ void AchievementSettingsWidget::LoadSettings()
->setChecked(Config::Get(Config::RA_SPECTATOR_ENABLED));
SignalBlocking(m_common_spectator_enabled_input)->setEnabled(enabled);
+ SignalBlocking(m_common_discord_presence_enabled_input)
+ ->setChecked(Config::Get(Config::RA_DISCORD_PRESENCE_ENABLED));
+ SignalBlocking(m_common_discord_presence_enabled_input)
+ ->setEnabled(enabled && Config::Get(Config::MAIN_USE_DISCORD_PRESENCE));
+
SignalBlocking(m_common_progress_enabled_input)
->setChecked(Config::Get(Config::RA_PROGRESS_ENABLED));
SignalBlocking(m_common_progress_enabled_input)->setEnabled(enabled);
@@ -215,6 +231,8 @@ void AchievementSettingsWidget::SaveSettings()
Config::SetBaseOrCurrent(Config::RA_ENCORE_ENABLED, m_common_encore_enabled_input->isChecked());
Config::SetBaseOrCurrent(Config::RA_SPECTATOR_ENABLED,
m_common_spectator_enabled_input->isChecked());
+ Config::SetBaseOrCurrent(Config::RA_DISCORD_PRESENCE_ENABLED,
+ m_common_discord_presence_enabled_input->isChecked());
Config::SetBaseOrCurrent(Config::RA_PROGRESS_ENABLED,
m_common_progress_enabled_input->isChecked());
Config::SetBaseOrCurrent(Config::RA_BADGES_ENABLED, m_common_badges_enabled_input->isChecked());
@@ -279,6 +297,12 @@ void AchievementSettingsWidget::ToggleSpectator()
AchievementManager::GetInstance().SetSpectatorMode();
}
+void AchievementSettingsWidget::ToggleDiscordPresence()
+{
+ SaveSettings();
+ Discord::UpdateDiscordPresence();
+}
+
void AchievementSettingsWidget::ToggleProgress()
{
SaveSettings();
diff --git a/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.h b/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.h
index 68ba658b8f..b8e848c2d1 100644
--- a/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.h
+++ b/Source/Core/DolphinQt/Achievements/AchievementSettingsWidget.h
@@ -36,6 +36,7 @@ private:
void ToggleUnofficial();
void ToggleEncore();
void ToggleSpectator();
+ void ToggleDiscordPresence();
void ToggleProgress();
void ToggleBadges();
@@ -53,6 +54,7 @@ private:
ToolTipCheckBox* m_common_unofficial_enabled_input;
ToolTipCheckBox* m_common_encore_enabled_input;
ToolTipCheckBox* m_common_spectator_enabled_input;
+ ToolTipCheckBox* m_common_discord_presence_enabled_input;
ToolTipCheckBox* m_common_progress_enabled_input;
ToolTipCheckBox* m_common_badges_enabled_input;
};
diff --git a/Source/Core/DolphinQt/Settings/GeneralPane.cpp b/Source/Core/DolphinQt/Settings/GeneralPane.cpp
index 114a5846a8..fcc4a79ebf 100644
--- a/Source/Core/DolphinQt/Settings/GeneralPane.cpp
+++ b/Source/Core/DolphinQt/Settings/GeneralPane.cpp
@@ -351,6 +351,9 @@ void GeneralPane::OnSaveConfig()
#ifdef USE_DISCORD_PRESENCE
Discord::SetDiscordPresenceEnabled(m_checkbox_discord_presence->isChecked());
+#ifdef USE_RETRO_ACHIEVEMENTS
+ emit Settings::Instance().ConfigChanged();
+#endif // USE_RETRO_ACHIEVEMENTS
#endif
#if defined(USE_ANALYTICS) && USE_ANALYTICS