mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 15:31:17 +01:00
fbaeaf305b
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.
37 lines
789 B
C++
37 lines
789 B
C++
// Copyright 2023 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#ifdef USE_RETRO_ACHIEVEMENTS
|
|
#include <QDialog>
|
|
|
|
#include "Core/AchievementManager.h"
|
|
#include "DolphinQt/QtUtils/QueueOnObject.h"
|
|
|
|
class AchievementHeaderWidget;
|
|
class AchievementProgressWidget;
|
|
class QDialogButtonBox;
|
|
class QTabWidget;
|
|
class UpdateCallback;
|
|
|
|
class AchievementsWindow : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit AchievementsWindow(QWidget* parent);
|
|
void UpdateData();
|
|
|
|
private:
|
|
void CreateMainLayout();
|
|
void showEvent(QShowEvent* event);
|
|
void ConnectWidgets();
|
|
|
|
AchievementHeaderWidget* m_header_widget;
|
|
QTabWidget* m_tab_widget;
|
|
AchievementProgressWidget* m_progress_widget;
|
|
QDialogButtonBox* m_button_box;
|
|
};
|
|
|
|
#endif // USE_RETRO_ACHIEVEMENTS
|