Achievements: Fix incorrect fallback message

This commit is contained in:
Stenzek 2023-12-15 23:54:25 +10:00
parent f84f19664b
commit fb0ad26de8
No known key found for this signature in database
1 changed files with 16 additions and 9 deletions

View File

@ -1542,8 +1542,8 @@ std::string Achievements::GetAchievementBadgePath(const rc_client_achievement_t*
if (achievement->badge_name[0] == 0)
return path;
path = Path::Combine(s_image_directory, TinyString::from_format("achievement_{}_{}_{}.png", s_game_id, achievement->id,
s_achievement_state_strings[state]));
path = Path::Combine(s_image_directory, TinyString::from_format("achievement_{}_{}_{}.png", s_game_id,
achievement->id, s_achievement_state_strings[state]));
if (download_if_missing && !FileSystem::FileExists(path.c_str()))
{
@ -1792,6 +1792,7 @@ bool Achievements::ConfirmHardcoreModeDisable(const char* trigger)
void Achievements::ConfirmHardcoreModeDisableAsync(const char* trigger, std::function<void(bool)> callback)
{
#ifndef __ANDROID__
#ifdef ENABLE_RAINTEGRATION
if (IsUsingRAIntegration())
{
@ -1803,7 +1804,7 @@ void Achievements::ConfirmHardcoreModeDisableAsync(const char* trigger, std::fun
if (!FullscreenUI::Initialize())
{
Host::AddOSDMessage(fmt::format(TRANSLATE_FS("Cannot {} while hardcode mode is active.", trigger)),
Host::AddOSDMessage(fmt::format(TRANSLATE_FS("Achievements", "Cannot {} while hardcode mode is active."), trigger),
Host::OSD_WARNING_DURATION);
callback(false);
return;
@ -1825,6 +1826,11 @@ void Achievements::ConfirmHardcoreModeDisableAsync(const char* trigger, std::fun
trigger),
std::move(real_callback), fmt::format(ICON_FA_CHECK " {}", TRANSLATE_SV("Achievements", "Yes")),
fmt::format(ICON_FA_TIMES " {}", TRANSLATE_SV("Achievements", "No")));
#else
Host::AddOSDMessage(fmt::format(TRANSLATE_FS("Achievements", "Cannot {} while hardcode mode is active."), trigger),
Host::OSD_WARNING_DURATION);
callback(false);
#endif
}
void Achievements::ClearUIState()
@ -2335,7 +2341,8 @@ void Achievements::DrawAchievement(const rc_client_achievement_t* cheevo)
SmallString text;
const float midpoint = bb.Min.y + g_large_font->FontSize + spacing;
text.format((cheevo->points != 1) ? TRANSLATE_FS("Achievements", "{} points") : TRANSLATE_FS("Achievements", "{} point"),
text.format((cheevo->points != 1) ? TRANSLATE_FS("Achievements", "{} points") :
TRANSLATE_FS("Achievements", "{} point"),
cheevo->points);
const ImVec2 points_template_size(
g_medium_font->CalcTextSizeA(g_medium_font->FontSize, FLT_MAX, 0.0f, TRANSLATE("Achievements", "XXX points")));