mirror of
https://github.com/wolfpld/tracy.git
synced 2026-11-07 08:25:26 +00:00
Add visibility predicates to achievements.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user