From ba154e02dbf7579fdea485cae57143a4a05e1fce Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 7 Jun 2024 23:31:43 +0200 Subject: [PATCH] Allow checking if achievements need attention. --- profiler/src/profiler/TracyAchievements.cpp | 8 +++++++- profiler/src/profiler/TracyAchievements.hpp | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/profiler/src/profiler/TracyAchievements.cpp b/profiler/src/profiler/TracyAchievements.cpp index 7129ca97..94c97122 100644 --- a/profiler/src/profiler/TracyAchievements.cpp +++ b/profiler/src/profiler/TracyAchievements.cpp @@ -53,8 +53,14 @@ void AchievementsMgr::PopQueue() m_queue.erase( m_queue.begin() ); } -bool AchievementsMgr::NeedsUpdates() const +bool AchievementsMgr::NeedsAttention() const { + for( auto& v : m_map ) + { + auto& it = v.second.item; + if( it->unlockTime > 0 && !it->hideNew ) return true; + if( it->doneTime > 0 && !it->hideCompleted ) return true; + } return false; } diff --git a/profiler/src/profiler/TracyAchievements.hpp b/profiler/src/profiler/TracyAchievements.hpp index 90aef461..a348cbc9 100644 --- a/profiler/src/profiler/TracyAchievements.hpp +++ b/profiler/src/profiler/TracyAchievements.hpp @@ -63,7 +63,7 @@ public: data::AchievementItem* GetNextQueue(); void PopQueue(); - bool NeedsUpdates() const; + bool NeedsAttention() const; private: void FillMap( data::AchievementItem** items, data::AchievementCategory* category );