mirror of
https://github.com/dolphin-emu/dolphin
synced 2024-11-24 14:24:11 -05:00
d2069e888d
AchievementProgressWidget maintains in memory a map of AchievementBox pointers so that UpdateData can operate on them individually. UpdateData is overhauled for three options: UpdateData(true) will destroy the entire list and re-create it from scratch as before, to be used if the game or player changes/closes/logs out. UpdateData(false) will loop through the map and call UpdateData on every achievement box, to be used for certain settings changes such as enabling badges or disabling hardcore mode. UpdateData(set<IDs>) will call UpdateData on only the IDs in the set, to be used when achievements are unlocked.
36 lines
831 B
C++
36 lines
831 B
C++
// Copyright 2023 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#ifdef USE_RETRO_ACHIEVEMENTS
|
|
#include <QWidget>
|
|
|
|
#include "Common/CommonTypes.h"
|
|
#include "Core/AchievementManager.h"
|
|
|
|
class AchievementBox;
|
|
class QCheckBox;
|
|
class QGroupBox;
|
|
class QLineEdit;
|
|
class QPushButton;
|
|
class QVBoxLayout;
|
|
|
|
struct rc_api_achievement_definition_t;
|
|
|
|
class AchievementProgressWidget final : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit AchievementProgressWidget(QWidget* parent);
|
|
void UpdateData(bool clean_all);
|
|
void UpdateData(const std::set<AchievementManager::AchievementId>& update_ids);
|
|
|
|
private:
|
|
QGroupBox* m_common_box;
|
|
QVBoxLayout* m_common_layout;
|
|
std::map<AchievementManager::AchievementId, std::shared_ptr<AchievementBox>> m_achievement_boxes;
|
|
};
|
|
|
|
#endif // USE_RETRO_ACHIEVEMENTS
|