Add Cheevos::GetAchievementProgressText

Measured achievements formatting is now up to rcheevos,
not DuckStation
This commit is contained in:
Silent
2022-01-07 16:44:45 +01:00
parent 9c91af6dfa
commit 9414f68f51
3 changed files with 12 additions and 3 deletions

View File

@ -4,7 +4,6 @@
#include "common/log.h"
#include "common/md5_digest.h"
#include "common/platform.h"
#include "common/string.h"
#include "common/string_util.h"
#include "common/timestamp.h"
#include "common_host_interface.h"
@ -1377,6 +1376,15 @@ std::pair<u32, u32> GetAchievementProgress(const Achievement& achievement)
return result;
}
TinyString GetAchievementProgressText(const Achievement& achievement)
{
TinyString result;
rc_runtime_format_achievement_measured(&s_rcheevos_runtime, achievement.id, result.GetWriteableCharArray(),
result.GetWritableBufferSize());
result.UpdateSize();
return result;
}
void CheevosEventHandler(const rc_runtime_event_t* runtime_event)
{
static const char* events[] = {"RC_RUNTIME_EVENT_ACHIEVEMENT_ACTIVATED", "RC_RUNTIME_EVENT_ACHIEVEMENT_PAUSED",