Skip to content

Commit e012d97

Browse files
committed
Achievements: Use RA icon for some notifications
1 parent ce37f0e commit e012d97

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

src/core/achievements.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ static constexpr const char* INFO_SOUND_NAME = "sounds/achievements/message.wav"
6868
static constexpr const char* UNLOCK_SOUND_NAME = "sounds/achievements/unlock.wav";
6969
static constexpr const char* LBSUBMIT_SOUND_NAME = "sounds/achievements/lbsubmit.wav";
7070
static constexpr const char* CACHE_SUBDIRECTORY_NAME = "achievement_images";
71+
constexpr const char* const RA_LOGO_ICON_NAME = "images/ra-icon.webp";
7172

7273
static constexpr float LOGIN_NOTIFICATION_TIME = 5.0f;
7374
static constexpr float ACHIEVEMENT_SUMMARY_NOTIFICATION_TIME = 5.0f;
@@ -1663,7 +1664,7 @@ void Achievements::HandleServerReconnectedEvent(const rc_client_event_t* event)
16631664
{
16641665
WARNING_LOG("Server reconnected.");
16651666

1666-
Host::AddIconOSDMessage(OSDMessageType::Warning, "AchievementsDisconnected", ICON_EMOJI_INFORMATION,
1667+
Host::AddIconOSDMessage(OSDMessageType::Warning, "AchievementsDisconnected", RA_LOGO_ICON_NAME,
16671668
TRANSLATE_STR("Achievements", "Achievements Reconnected"),
16681669
TRANSLATE_STR("Achievements", "All pending unlock requests have completed."));
16691670
}
@@ -1697,7 +1698,7 @@ void Achievements::OnHardcoreModeChanged(bool enabled, bool display_message, boo
16971698

16981699
if (System::IsValid() && display_message)
16991700
{
1700-
Host::AddIconOSDMessage(OSDMessageType::Info, "AchievementsHardcoreModeChanged", ICON_EMOJI_TROPHY,
1701+
Host::AddIconOSDMessage(OSDMessageType::Info, "AchievementsHardcoreModeChanged", RA_LOGO_ICON_NAME,
17011702
enabled ? TRANSLATE_STR("Achievements", "Hardcore Mode Enabled") :
17021703
TRANSLATE_STR("Achievements", "Hardcore Mode Disabled"),
17031704
enabled ? TRANSLATE_STR("Achievements", "Restrictions are now active.") :

src/core/achievements.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ u32 GetPauseThrottleFrames();
191191
/// Draws ImGui overlays when not paused.
192192
void DrawGameOverlays();
193193

194+
/// The name of the RetroAchievements icon, which can be used in notifications.
195+
extern const char* const RA_LOGO_ICON_NAME;
196+
194197
} // namespace Achievements
195198

196199
/// Functions implemented in the frontend.

src/core/fullscreenui_achievements.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -528,10 +528,11 @@ void FullscreenUI::OpenAchievementsWindow()
528528
const auto lock = Achievements::GetLock();
529529
if (!Achievements::IsActive() || !Achievements::HasAchievements())
530530
{
531-
Host::AddIconOSDMessage(OSDMessageType::Info, "AchievementsUnavailable", ICON_EMOJI_INFORMATION,
532-
TRANSLATE_STR("Achievements", "Achievements Unavailable"),
533-
Achievements::IsActive() ? TRANSLATE_STR("Achievements", "This game has no achievements.") :
534-
TRANSLATE_STR("Achievements", "Achievements are not enabled."));
531+
Host::AddIconOSDMessage(OSDMessageType::Info, "AchievementsUnavailable", Achievements::RA_LOGO_ICON_NAME,
532+
TRANSLATE_STR("Achievements", "Achievements are not available."),
533+
Achievements::IsActive() ?
534+
TRANSLATE_STR("Achievements", "This game has no achievements.") :
535+
TRANSLATE_STR("Achievements", "Achievements are disabled in settings."));
535536
return;
536537
}
537538

@@ -1006,10 +1007,11 @@ void FullscreenUI::OpenLeaderboardsWindow()
10061007
const auto lock = Achievements::GetLock();
10071008
if (!Achievements::IsActive() || !Achievements::HasLeaderboards())
10081009
{
1009-
Host::AddIconOSDMessage(OSDMessageType::Info, "LeaderboardsUnavailable", ICON_EMOJI_INFORMATION,
1010-
TRANSLATE_STR("Achievements", "Leaderboards Unavailable"),
1011-
Achievements::IsActive() ? TRANSLATE_STR("Achievements", "This game has no leaderboards.") :
1012-
TRANSLATE_STR("Achievements", "Achievements are not enabled."));
1010+
Host::AddIconOSDMessage(OSDMessageType::Info, "LeaderboardsUnavailable", Achievements::RA_LOGO_ICON_NAME,
1011+
TRANSLATE_STR("Achievements", "Leaderboards are not available."),
1012+
Achievements::IsActive() ?
1013+
TRANSLATE_STR("Achievements", "This game has no leaderboards.") :
1014+
TRANSLATE_STR("Achievements", "Achievements are disabled in settings."));
10131015
return;
10141016
}
10151017

0 commit comments

Comments
 (0)