mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-12 19:19:03 +00:00
Add UpdateCallback to AchievementManager
AchievementManager now has a SetUpdateCallback method for providing a single universal callback for anytime something important changes in the achievement state, such as logging in/out, game load/close, or events such as achievement unlocks. AchievementsWindow sets this callback in its own init to its UpdateData method so that the AchievementsWindow gets updated when one of these changes takes place.
This commit is contained in:
parent
582042de1f
commit
fbaeaf305b
4 changed files with 34 additions and 3 deletions
|
@ -11,6 +11,7 @@
|
|||
#include "DolphinQt/Achievements/AchievementHeaderWidget.h"
|
||||
#include "DolphinQt/Achievements/AchievementProgressWidget.h"
|
||||
#include "DolphinQt/Achievements/AchievementSettingsWidget.h"
|
||||
#include "DolphinQt/QtUtils/QueueOnObject.h"
|
||||
#include "DolphinQt/QtUtils/WrapInScrollArea.h"
|
||||
|
||||
AchievementsWindow::AchievementsWindow(QWidget* parent) : QDialog(parent)
|
||||
|
@ -20,6 +21,8 @@ AchievementsWindow::AchievementsWindow(QWidget* parent) : QDialog(parent)
|
|||
|
||||
CreateMainLayout();
|
||||
ConnectWidgets();
|
||||
AchievementManager::GetInstance()->SetUpdateCallback(
|
||||
[this] { QueueOnObject(this, &AchievementsWindow::UpdateData); });
|
||||
}
|
||||
|
||||
void AchievementsWindow::showEvent(QShowEvent* event)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue