From 1136556a0db91fe52b8eb8348dc6eec36797bc3a Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 16 Nov 2023 13:24:09 +0100 Subject: [PATCH] fix: Don't treat unlocked achievements as invisible anymore --- .../source/content/views/view_achievements.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/builtin/source/content/views/view_achievements.cpp b/plugins/builtin/source/content/views/view_achievements.cpp index 676cb8cf2..274f8a966 100644 --- a/plugins/builtin/source/content/views/view_achievements.cpp +++ b/plugins/builtin/source/content/views/view_achievements.cpp @@ -21,6 +21,15 @@ namespace hex::plugin::builtin { this->m_achievementUnlockQueue.push_back(&achievement); }); + EventManager::subscribe(this, [this](const std::string &name) { + if (name == "Achievements") { + TaskManager::doLater([this] { + this->m_viewOpen = true; + this->getWindowOpenState() = true; + }); + } + }); + // Load settings this->m_showPopup = ContentRegistry::Settings::read("hex.builtin.setting.interface", "hex.builtin.setting.interface.achievement_popup", true); } @@ -164,7 +173,7 @@ namespace hex::plugin::builtin { // Calculate number of invisible achievements const auto invisibleCount = std::count_if(achievements.begin(), achievements.end(), [](const auto &entry) { const auto &[name, achievement] = entry; - return achievement->isInvisible(); + return achievement->isInvisible() && !achievement->isUnlocked(); }); // Calculate number of visible achievements