Updated GetGameDisplayName to use rc_client

This commit is contained in:
LillyJadeKatrin 2024-03-27 23:22:10 -04:00
parent 486a9d2318
commit 7b835a20ca
3 changed files with 5 additions and 5 deletions

View File

@ -398,7 +398,7 @@ void AchievementManager::FetchBadges()
void AchievementManager::DoFrame()
{
if (!m_is_game_loaded || !Core::IsCPUThread())
if (!IsGameLoaded() || !Core::IsCPUThread())
return;
if (m_framecount == 0x200)
{
@ -532,9 +532,9 @@ const AchievementManager::BadgeStatus& AchievementManager::GetPlayerBadge() cons
return m_player_badge;
}
std::string AchievementManager::GetGameDisplayName() const
std::string_view AchievementManager::GetGameDisplayName() const
{
return IsGameLoaded() ? m_game_data.title : "";
return IsGameLoaded() ? std::string_view(rc_client_get_game_info(m_client)->title) : "";
}
AchievementManager::PointSpread AchievementManager::TallyScore() const

View File

@ -133,7 +133,7 @@ public:
std::string_view GetPlayerDisplayName() const;
u32 GetPlayerScore() const;
const BadgeStatus& GetPlayerBadge() const;
std::string GetGameDisplayName() const;
std::string_view GetGameDisplayName() const;
PointSpread TallyScore() const;
rc_api_fetch_game_data_response_t* GetGameData();
const BadgeStatus& GetGameBadge() const;

View File

@ -78,7 +78,7 @@ void AchievementHeaderWidget::UpdateData()
AchievementManager::PointSpread point_spread = instance.TallyScore();
QString user_name = QtUtils::FromStdString(instance.GetPlayerDisplayName());
QString game_name = QString::fromStdString(instance.GetGameDisplayName());
QString game_name = QtUtils::FromStdString(instance.GetGameDisplayName());
AchievementManager::BadgeStatus player_badge = instance.GetPlayerBadge();
AchievementManager::BadgeStatus game_badge = instance.GetGameBadge();