Add visibility predicates to achievements.

This commit is contained in:
Bartosz Taudul
2026-11-02 00:59:04 +01:00
parent 41ea9b8b31
commit 2e9dfb8fdf
3 changed files with 4 additions and 0 deletions
+1
View File
@@ -533,6 +533,7 @@ static void DrawAchievements( tracy::data::AchievementItem** items )
while( *items )
{
auto& it = *items++;
if( it->visible && !it->visible() ) continue;
if( it->unlockTime > 0 )
{
if( it->doneTime > 0 ) ImGui::PushStyleColor( ImGuiCol_Text, GImGui->Style.Colors[ImGuiCol_TextDisabled] );
@@ -171,6 +171,7 @@ bool AchievementsMgr::NeedsAttention() const
for( auto& v : m_map )
{
auto& it = v.second.item;
if( it->visible && !it->visible() ) continue;
if( it->unlockTime > 0 && !it->hideNew ) return true;
if( it->doneTime > 0 && !it->hideCompleted ) return true;
}
@@ -189,6 +190,7 @@ bool AchievementsMgr::CategoryNeedsAttention( const char* id ) const
if( v.second.category == (*c) )
{
auto& it = v.second.item;
if( it->visible && !it->visible() ) continue;
if( it->unlockTime > 0 && !it->hideNew ) return true;
if( it->doneTime > 0 && !it->hideCompleted ) return true;
}
@@ -23,6 +23,7 @@ struct AchievementItem
std::string text;
AchievementItem** items;
AchievementItem** unlocks;
bool (*visible)();
bool keepOpen;
uint64_t unlockTime;
uint64_t doneTime;