mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 20:33:52 +00:00
Process unlock list, unlock achievement categories.
This commit is contained in:
parent
fde874eedf
commit
7401a72ccf
@ -57,6 +57,23 @@ AchievementsMgr::AchievementsMgr()
|
|||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
c = it->unlocks;
|
||||||
|
if( c )
|
||||||
|
{
|
||||||
|
while( *c )
|
||||||
|
{
|
||||||
|
if( (*c)->unlockTime == 0 ) (*c)->unlockTime = it->doneTime;
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for( auto& v : m_map )
|
||||||
|
{
|
||||||
|
if( v.second.category->unlockTime == 0 && v.second.item->unlockTime > 0 )
|
||||||
|
{
|
||||||
|
v.second.category->unlockTime = v.second.item->unlockTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,19 +103,32 @@ void AchievementsMgr::Achieve( const char* id )
|
|||||||
{
|
{
|
||||||
auto it = m_map.find( id );
|
auto it = m_map.find( id );
|
||||||
assert( it != m_map.end() );
|
assert( it != m_map.end() );
|
||||||
if( it->second.item->unlockTime == 0 ) return;
|
auto& a = *it->second.item;
|
||||||
if( it->second.item->doneTime > 0 ) return;
|
|
||||||
|
if( a.unlockTime == 0 ) return;
|
||||||
|
if( a.doneTime > 0 ) return;
|
||||||
|
|
||||||
const auto t = uint64_t( time( nullptr ) );
|
const auto t = uint64_t( time( nullptr ) );
|
||||||
|
|
||||||
it->second.item->doneTime = uint64_t( t );
|
a.doneTime = uint64_t( t );
|
||||||
m_queue.push_back( it->second.item );
|
m_queue.push_back( &a );
|
||||||
|
|
||||||
auto c = it->second.item->items;
|
auto c = a.items;
|
||||||
if( c )
|
if( c )
|
||||||
{
|
{
|
||||||
while( *c ) (*c++)->unlockTime = t;
|
while( *c ) (*c++)->unlockTime = t;
|
||||||
}
|
}
|
||||||
|
c = a.unlocks;
|
||||||
|
if( c )
|
||||||
|
{
|
||||||
|
while( *c )
|
||||||
|
{
|
||||||
|
(*c)->unlockTime = t;
|
||||||
|
auto cit = m_map.find( (*c)->id );
|
||||||
|
if( cit->second.category->unlockTime == 0 ) cit->second.category->unlockTime = t;
|
||||||
|
c++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
data::AchievementCategory** AchievementsMgr::GetCategories() const
|
data::AchievementCategory** AchievementsMgr::GetCategories() const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user