From 0549dbf02d2b610e6bc9e5dc16c8034ec6be7f9a Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Wed, 29 Dec 2021 02:29:22 +0100 Subject: [PATCH] Alternate discord main menu image --- src/client/component/branding.cpp | 19 ++++++------------- src/client/component/discord.cpp | 3 ++- src/client/game/symbols.hpp | 1 + 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/client/component/branding.cpp b/src/client/component/branding.cpp index 3d44b5aa..b14dcf65 100644 --- a/src/client/component/branding.cpp +++ b/src/client/component/branding.cpp @@ -10,21 +10,14 @@ namespace branding { + float color[4] = {0.9f, 0.9f, 0.5f, 1.f}; + void draw() { - const auto x = 15.f; - const auto y = 15.f; - const auto scale = 1.0f; - float color[4] = { 0.9f, 0.9f, 0.5f, 1.f }; - const auto* text = "h2-mod"; - - auto* font = game::R_RegisterFont("fonts/defaultBold.otf", 22); - - if (!font) return; - - game::R_AddCmdDrawText(text, 0x7FFFFFFF, font, static_cast(x), - y + static_cast(font->pixelHeight) * scale, - scale, scale, 0.0f, color, 0); + const auto font = game::R_RegisterFont("fonts/defaultBold.otf", 22); + game::R_AddCmdDrawText("h2-mod", 0x7FFFFFFF, font, 15.f, + 15.f + static_cast(font->pixelHeight), + 1.f, 1.f, 0.f, color, 0); } class component final : public component_interface diff --git a/src/client/component/discord.cpp b/src/client/component/discord.cpp index 85eafccb..dff5d22e 100644 --- a/src/client/component/discord.cpp +++ b/src/client/component/discord.cpp @@ -28,7 +28,8 @@ namespace discord discord_presence.startTimestamp = 0; - discord_presence.largeImageKey = "h2"; + const auto background_index = static_cast(game::Sys_Milliseconds() / 300000) % 10; + discord_presence.largeImageKey = utils::string::va("bg_%i", background_index); } else { diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index d0423e25..74819b32 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -120,6 +120,7 @@ namespace game WEAK symbol Sys_ShowConsole{0x633080}; WEAK symbol Sys_IsDatabaseReady2{0x5A9FE0}; + WEAK symbol Sys_Milliseconds{0x650720}; WEAK symbol UI_SafeTranslateString{0x5A2930}; WEAK symbol UI_PlayLocalSoundAlias{0x606080};