Allow checking if achievements need attention.

This commit is contained in:
Bartosz Taudul 2024-06-07 23:31:43 +02:00
parent 139dc44a00
commit ba154e02db
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
2 changed files with 8 additions and 2 deletions

View File

@ -53,8 +53,14 @@ void AchievementsMgr::PopQueue()
m_queue.erase( m_queue.begin() ); 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; return false;
} }

View File

@ -63,7 +63,7 @@ public:
data::AchievementItem* GetNextQueue(); data::AchievementItem* GetNextQueue();
void PopQueue(); void PopQueue();
bool NeedsUpdates() const; bool NeedsAttention() const;
private: private:
void FillMap( data::AchievementItem** items, data::AchievementCategory* category ); void FillMap( data::AchievementItem** items, data::AchievementCategory* category );