mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 06:39:46 -06:00
Refactor Leaderboard widget to allow partial updates
Similarly to the Progress widget (though without the separate object for each box, because each Leaderboard unit is just three text fields stacked vertically), AchievementLeaderboardWidget.UpdateData will now accept three options: destroy all and rebuild, update all, or update a set of rows. As part of this, AchievementManager::GetLeaderboardsInfo has been refactored to GetLeaderboardInfo to return a single leaderboard for the ID passed in.
This commit is contained in:
@ -6,6 +6,8 @@
|
||||
#ifdef USE_RETRO_ACHIEVEMENTS
|
||||
#include <QWidget>
|
||||
|
||||
#include "Core/AchievementManager.h"
|
||||
|
||||
class QGroupBox;
|
||||
class QGridLayout;
|
||||
|
||||
@ -14,11 +16,14 @@ class AchievementLeaderboardWidget final : public QWidget
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AchievementLeaderboardWidget(QWidget* parent);
|
||||
void UpdateData();
|
||||
void UpdateData(bool clean_all);
|
||||
void UpdateData(const std::set<AchievementManager::AchievementId>& update_ids);
|
||||
void UpdateRow(AchievementManager::AchievementId leaderboard_id);
|
||||
|
||||
private:
|
||||
QGroupBox* m_common_box;
|
||||
QGridLayout* m_common_layout;
|
||||
std::map<AchievementManager::AchievementId, int> m_leaderboard_order;
|
||||
};
|
||||
|
||||
#endif // USE_RETRO_ACHIEVEMENTS
|
||||
|
Reference in New Issue
Block a user