Achievements: Add RA SVG icon variant

Can't be used for everything.
This commit is contained in:
Stenzek
2026-04-12 12:15:04 +10:00
parent 99acb8fb10
commit 9275e1ad77
6 changed files with 63 additions and 15 deletions
+44
View File
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 454.35999 245.10001"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs>
<linearGradient
id="a"
x1="217.45"
y1="974.96997"
x2="217.45"
y2="950.13"
gradientTransform="matrix(8.48,0,0,-8.33,-1738.48,8138.92)"
gradientUnits="userSpaceOnUse">
<stop
offset="0"
stop-color="#89b4ee" />
<stop
offset=".32"
stop-color="#1066dd" />
</linearGradient>
<linearGradient
id="b"
x1="245.24001"
y1="976.59003"
x2="245.24001"
y2="948.51001"
gradientTransform="matrix(8.48,0,0,-8.33,-1744.12,8138.92)"
gradientUnits="userSpaceOnUse">
<stop
offset="0"
stop-color="#e5cd83" />
<stop
offset=".32"
stop-color="#cc9a00" />
</linearGradient>
</defs>
<path
d="m 0.01,42.72 h 99.46 c 10.68,0 19.5,3.16 26.45,9.49 7.12,6.33 10.68,15.91 10.68,28.73 0,5.5 -0.93,10.66 -2.8,15.49 -1.87,4.66 -4.49,8.74 -7.89,12.24 -3.22,3.5 -7.12,6.25 -11.7,8.24 -4.58,2 -9.5,3 -14.75,3 h -8.39 l 72.5,125.17 h -36.38 l -50.37,-85.7 v 85.7 H 42.99 V 85.45 h 55.2 c 1.36,0 2.37,-0.5 3.05,-1.5 0.85,-1 1.27,-2.08 1.27,-3.25 0,-1.17 -0.42,-2.17 -1.27,-3 -0.68,-1 -1.7,-1.5 -3.05,-1.5 H 33.83 V 245.1 H 0 V 42.72 Z m 107.34,85.45 c 4.92,-0.33 9.67,-1.75 14.24,-4.25 4.75,-2.5 8.9,-5.83 12.46,-9.99 3.56,-4.16 6.44,-8.99 8.65,-14.49 2.2,-5.66 3.31,-11.83 3.31,-18.49 0,-6.83 -1.1,-13.16 -3.31,-18.99 -2.2,-5.83 -5.34,-10.83 -9.41,-14.99 -4.07,-4.16 -8.99,-7.41 -14.75,-9.74 -5.6,-2.33 -11.96,-3.5 -19.08,-3.5 H 0.01 V 0 h 99.46 c 11.19,0 21.71,2.08 31.54,6.25 9.83,4.17 18.4,9.91 25.69,17.24 7.29,7.33 12.97,15.91 17.04,25.73 4.24,9.83 6.36,20.4 6.36,31.73 q 0,21.48 -7.38,37.23 c -4.92,10.33 -11.62,18.66 -20.1,24.98 l 58,101.94 h -34.59 z"
style="fill:url(#a)" />
<path
d="M 306.31,215.87 H 411.88 L 347.27,39.73 c -0.51,-1.67 -2.03,-3.16 -4.58,-4.5 -2.55,-1.34 -5,-2 -7.38,-2 -2.71,0 -5.26,0.67 -7.63,2 -2.2,1.33 -3.56,2.83 -4.07,4.5 L 250.1,245.1 h -33.83 l 78.6,-217.87 c 1.19,-3.5 2.88,-6.83 5.09,-9.99 2.2,-3.33 4.92,-6.25 8.14,-8.74 3.39,-2.67 7.29,-4.75 11.7,-6.25 4.58,-1.5 9.75,-2.25 15.52,-2.25 5.77,0 10.85,0.75 15.26,2.25 4.41,1.5 8.22,3.58 11.45,6.25 3.39,2.5 6.19,5.41 8.39,8.74 2.2,3.16 3.99,6.5 5.34,9.99 l 78.6,217.87 H 306.31 Z m 0,-9 v -9.49 L 290.03,245.1 H 259.25 L 329.2,45.97 c 0.34,-1 1.1,-1.83 2.29,-2.5 1.36,-0.83 2.63,-1.25 3.82,-1.25 1.19,0 2.46,0.42 3.82,1.25 1.36,0.67 2.2,1.5 2.54,2.5 l 58,160.9 z m 29,-92.69 -20.35,62.96 h 41.46 z"
style="fill:url(#b)" />
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

+5 -4
View File
@@ -74,6 +74,7 @@ static constexpr const char* UNLOCK_SOUND_NAME = "sounds/achievements/unlock.wav
static constexpr const char* LBSUBMIT_SOUND_NAME = "sounds/achievements/lbsubmit.wav";
static constexpr const char* CACHE_SUBDIRECTORY_NAME = "achievement_images";
constexpr const char* const RA_LOGO_ICON_NAME = "images/ra-icon.webp";
constexpr const char* const RA_LOGO_SVG_ICON_NAME = "images/ra-icon.svg";
static constexpr float LOGIN_NOTIFICATION_TIME = 5.0f;
static constexpr float ACHIEVEMENT_SUMMARY_NOTIFICATION_TIME = 5.0f;
@@ -1537,14 +1538,14 @@ void Achievements::DisplayAchievementSummary()
if (rc_client_get_spectator_mode_enabled(s_state.client))
{
Host::AddIconOSDMessage(
OSDMessageType::Warning, "SpectatorOrEncoreMode", RA_LOGO_ICON_NAME,
OSDMessageType::Warning, "SpectatorOrEncoreMode", RA_LOGO_SVG_ICON_NAME,
TRANSLATE_STR("Achievements", "Spectator mode enabled."),
TRANSLATE_STR("Achievements", "All achievements are locked, and unlocks will not be recorded in your account."));
}
else if (rc_client_get_encore_mode_enabled(s_state.client))
{
Host::AddIconOSDMessage(
OSDMessageType::Warning, "SpectatorOrEncoreMode", RA_LOGO_ICON_NAME,
OSDMessageType::Warning, "SpectatorOrEncoreMode", RA_LOGO_SVG_ICON_NAME,
TRANSLATE_STR("Achievements", "Encore mode enabled."),
TRANSLATE_STR("Achievements",
"All achievements are locked, but unlocks will still be recorded in your account."));
@@ -1951,7 +1952,7 @@ void Achievements::HandleServerReconnectedEvent(const rc_client_event_t* event)
{
WARNING_LOG("Server reconnected.");
Host::AddIconOSDMessage(OSDMessageType::Warning, "AchievementsDisconnected", RA_LOGO_ICON_NAME,
Host::AddIconOSDMessage(OSDMessageType::Warning, "AchievementsDisconnected", RA_LOGO_SVG_ICON_NAME,
TRANSLATE_STR("Achievements", "Achievements Reconnected"),
TRANSLATE_STR("Achievements", "All pending unlock requests have completed."));
}
@@ -1985,7 +1986,7 @@ void Achievements::OnHardcoreModeChanged(bool enabled, bool display_message, boo
if (System::IsValid() && display_message)
{
Host::AddIconOSDMessage(OSDMessageType::Info, "AchievementsHardcoreModeChanged", RA_LOGO_ICON_NAME,
Host::AddIconOSDMessage(OSDMessageType::Info, "AchievementsHardcoreModeChanged", RA_LOGO_SVG_ICON_NAME,
enabled ? TRANSLATE_STR("Achievements", "Hardcore mode enabled.") :
TRANSLATE_STR("Achievements", "Hardcore mode disabled."),
enabled ? TRANSLATE_STR("Achievements", "Restrictions are now active.") :
+1
View File
@@ -200,6 +200,7 @@ u32 GetPendingUnlockCount();
/// The name of the RetroAchievements icon, which can be used in notifications.
extern const char* const RA_LOGO_ICON_NAME;
extern const char* const RA_LOGO_SVG_ICON_NAME;
} // namespace Achievements
+2 -2
View File
@@ -1499,7 +1499,7 @@ void FullscreenUI::OpenAchievementsWindow()
if (const auto lock = Achievements::GetLock(); !Achievements::IsActive() || !Achievements::HasAchievements())
{
Host::AddIconOSDMessage(OSDMessageType::Info, "AchievementsUnavailable", Achievements::RA_LOGO_ICON_NAME,
Host::AddIconOSDMessage(OSDMessageType::Info, "AchievementsUnavailable", Achievements::RA_LOGO_SVG_ICON_NAME,
TRANSLATE_STR("Achievements", "Achievements are not available."),
Achievements::IsActive() ?
TRANSLATE_STR("Achievements", "This game has no achievements.") :
@@ -2405,7 +2405,7 @@ void FullscreenUI::OpenLeaderboardsWindow()
if (const auto lock = Achievements::GetLock(); !Achievements::IsActive() || !Achievements::HasLeaderboards())
{
Host::AddIconOSDMessage(OSDMessageType::Info, "LeaderboardsUnavailable", Achievements::RA_LOGO_ICON_NAME,
Host::AddIconOSDMessage(OSDMessageType::Info, "LeaderboardsUnavailable", Achievements::RA_LOGO_SVG_ICON_NAME,
TRANSLATE_STR("Achievements", "Leaderboards are not available."),
Achievements::IsActive() ?
TRANSLATE_STR("Achievements", "This game has no leaderboards.") :
+10 -8
View File
@@ -5195,21 +5195,23 @@ void FullscreenUI::DrawAchievementsLoginWindow()
return;
}
const std::string_view ra_title = "RetroAchivements";
static constexpr std::string_view ra_title = "RetroAchivements";
const ImVec2 ra_title_size = UIStyle.Font->CalcTextSizeA(UIStyle.LargeFontSize, UIStyle.BoldFontWeight, FLT_MAX, 0.0f,
IMSTR_START_END(ra_title));
const float ra_title_spacing = LayoutScale(10.0f);
GPUTexture* ra_logo = GetCachedTexture("images/ra-icon.webp");
const ImVec2 ra_logo_size = ImVec2(UIStyle.LargeFontSize * 1.85f, UIStyle.LargeFontSize);
const ImVec2 ra_logo_imgsize = CenterImage(ra_logo_size, ra_logo).GetSize();
const ImVec2 ra_logo_size = ImVec2(UIStyle.LargeFontSize * 2.0f, UIStyle.LargeFontSize);
const ImRect ra_logo_rect = CenterImage(ra_logo_size, ImVec2(454.0f, 245.0f));
GPUTexture* const ra_logo =
GetCachedTexture(Achievements::RA_LOGO_SVG_ICON_NAME, static_cast<u32>(ra_logo_rect.GetWidth()),
static_cast<u32>(ra_logo_rect.GetHeight()));
const ImRect work_rect = ImGui::GetCurrentWindow()->WorkRect;
const float indent = (work_rect.GetWidth() - (ra_logo_size.x + ra_title_spacing + ra_title_size.x)) * 0.5f;
ImDrawList* const dl = ImGui::GetWindowDrawList();
const ImVec2 ra_logo_pos = work_rect.Min + ImVec2(indent, 0.0f);
dl->AddImage(ra_logo, ra_logo_pos, ra_logo_pos + ra_logo_imgsize);
dl->AddText(UIStyle.Font, UIStyle.LargeFontSize, UIStyle.BoldFontWeight,
ra_logo_pos + ImVec2(ra_logo_size.x + ra_title_spacing, 0.0f), ImGui::GetColorU32(ImGuiCol_Text),
IMSTR_START_END(ra_title));
dl->AddImage(ra_logo, ra_logo_pos + ra_logo_rect.Min, ra_logo_pos + ra_logo_rect.Max);
const ImVec2 title_pos = ra_logo_pos + ImVec2(ra_logo_size.x + ra_title_spacing, 0.0f);
RenderShadowedTextClipped(dl, UIStyle.Font, UIStyle.LargeFontSize, UIStyle.BoldFontWeight, title_pos,
title_pos + ra_title_size, ImGui::GetColorU32(ImGuiCol_Text), ra_title, &ra_title_size);
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ra_logo_size.y + LayoutScale(15.0f));
@@ -15,7 +15,7 @@ AchievementLoginDialog::AchievementLoginDialog(QWidget* parent, Achievements::Lo
: QDialog(parent), m_reason(reason)
{
m_ui.setupUi(this);
m_ui.iconLabel->setPixmap(QPixmap(QtHost::GetResourceQPath("images/ra-icon.webp", true)));
m_ui.iconLabel->setPixmap(QPixmap(QtHost::GetResourceQPath(Achievements::RA_LOGO_SVG_ICON_NAME, true)));
QFont title_font(m_ui.titleLabel->font());
title_font.setBold(true);
title_font.setPixelSize(20);