1
0
mirror of synced 2025-01-29 19:17:28 +01:00

impr: Store achievement progress immediately when unlocking one

This commit is contained in:
WerWolv 2023-10-20 13:34:45 +02:00
parent d91334abcd
commit c46e445a04
2 changed files with 6 additions and 2 deletions

View File

@ -128,6 +128,8 @@ namespace hex {
if (achievement->isUnlocked())
EventManager::post<EventAchievementUnlocked>(*achievement);
return;
}
}

View File

@ -201,9 +201,11 @@ namespace hex::plugin::builtin {
EventManager::subscribe<EventImHexStartupFinished>(AchievementManager::loadProgress);
EventManager::subscribe<EventImHexClosing>(AchievementManager::storeProgress);
EventManager::subscribe<EventAchievementUnlocked>([](const Achievement &) {
AchievementManager::storeProgress();
});
// Clear temporary achievements when last provider is closed
// Clear temporary achievements when the last provider is closed
EventManager::subscribe<EventProviderChanged>([](hex::prv::Provider *oldProvider, hex::prv::Provider *newProvider) {
hex::unused(oldProvider);
if (newProvider == nullptr) {