From 75c2360aeacefddddd83cb585f69f9a822a614e7 Mon Sep 17 00:00:00 2001 From: LillyJadeKatrin Date: Wed, 19 Jun 2024 22:12:30 -0400 Subject: [PATCH] Split AchievementBox UpdateData AchievementBox now has UpdateData and UpdateProgress, which is called from UpdateData, but may be called elsewhere to update just the progress measurement of the achievement. --- Source/Core/DolphinQt/Achievements/AchievementBox.cpp | 5 +++++ Source/Core/DolphinQt/Achievements/AchievementBox.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Source/Core/DolphinQt/Achievements/AchievementBox.cpp b/Source/Core/DolphinQt/Achievements/AchievementBox.cpp index a14936171d..d4d92e9965 100644 --- a/Source/Core/DolphinQt/Achievements/AchievementBox.cpp +++ b/Source/Core/DolphinQt/Achievements/AchievementBox.cpp @@ -87,6 +87,11 @@ void AchievementBox::UpdateData() m_status->setText(tr("Locked")); } + UpdateProgress(); +} + +void AchievementBox::UpdateProgress() +{ if (m_achievement->measured_percent > 0.000) { m_progress_bar->setRange(0, 100); diff --git a/Source/Core/DolphinQt/Achievements/AchievementBox.h b/Source/Core/DolphinQt/Achievements/AchievementBox.h index 596893b148..92b1e75878 100644 --- a/Source/Core/DolphinQt/Achievements/AchievementBox.h +++ b/Source/Core/DolphinQt/Achievements/AchievementBox.h @@ -20,6 +20,7 @@ class AchievementBox final : public QGroupBox public: explicit AchievementBox(QWidget* parent, rc_client_achievement_t* achievement); void UpdateData(); + void UpdateProgress(); private: QLabel* m_badge;