mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 19:58:53 +00:00
Add Rich Presence to Achievement Dialog Header
This refactors the Rich Presence generation to store to a member field that can be exposed to the UI to display the Rich Presence in the achievement header. It still updates at its original rate of once per two minutes, but calls an update on the dialog when that ticks.
This commit is contained in:
parent
900439ea0d
commit
38bd04c439
3 changed files with 24 additions and 15 deletions
|
@ -20,6 +20,7 @@
|
|||
#include <rcheevos/include/rc_runtime.h>
|
||||
|
||||
#include "Core/AchievementManager.h"
|
||||
#include "Core/Config/AchievementSettings.h"
|
||||
#include "Core/Core.h"
|
||||
|
||||
#include "DolphinQt/QtUtils/ModalMessageBox.h"
|
||||
|
@ -101,11 +102,9 @@ void AchievementHeaderWidget::UpdateData()
|
|||
m_game_progress_soft->setValue(point_spread.hard_unlocks);
|
||||
m_game_progress_soft->setRange(0, point_spread.total_count);
|
||||
m_game_progress_soft->setValue(point_spread.hard_unlocks + point_spread.soft_unlocks);
|
||||
// TODO: RP needs a minor refactor to work here, will be a future PR
|
||||
// m_rich_presence->setText(QString::fromStdString(AchievementManager::GetInstance()->GenerateRichPresence()));
|
||||
// m_rich_presence->setVisible(Config::Get(Config::RA_RICH_PRESENCE_ENABLED));
|
||||
m_rich_presence->setText(QString{});
|
||||
m_rich_presence->setVisible(false);
|
||||
m_rich_presence->setText(
|
||||
QString::fromUtf8(AchievementManager::GetInstance()->GetRichPresence().data()));
|
||||
m_rich_presence->setVisible(Config::Get(Config::RA_RICH_PRESENCE_ENABLED));
|
||||
|
||||
m_user_box->setVisible(false);
|
||||
m_game_box->setVisible(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue