Hide Achievement Dialog Header When Disabled

If achievements were disabled but a player token is in settings, prior to this change the Achievement Manager dialog would show a box with no player name and score zero, which is unnecessary.
This commit is contained in:
LillyJadeKatrin 2024-05-03 21:35:01 -04:00
parent 57c890d4fc
commit 42ca39c6fe
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());