Merge pull request #12759 from LillyJadeKatrin/retroachievements-header-fix

Hide Achievement Dialog Header When Disabled
This commit is contained in:
Admiral H. Curtiss 2024-05-04 04:27:16 +02:00 committed by GitHub
commit f709071d41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -59,11 +59,12 @@ void AchievementHeaderWidget::UpdateData()
{ {
std::lock_guard lg{AchievementManager::GetInstance().GetLock()}; std::lock_guard lg{AchievementManager::GetInstance().GetLock()};
auto& instance = AchievementManager::GetInstance(); auto& instance = AchievementManager::GetInstance();
if (!instance.HasAPIToken()) if (!Config::Get(Config::RA_ENABLED) || !instance.HasAPIToken())
{ {
m_header_box->setVisible(false); m_header_box->setVisible(false);
return; return;
} }
m_header_box->setVisible(true);
QString user_name = QtUtils::FromStdString(instance.GetPlayerDisplayName()); QString user_name = QtUtils::FromStdString(instance.GetPlayerDisplayName());
QString game_name = QtUtils::FromStdString(instance.GetGameDisplayName()); QString game_name = QtUtils::FromStdString(instance.GetGameDisplayName());