From 601c211cd710609859887d28ece64bb32c9ee624 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Tue, 17 May 2022 12:05:51 +0200 Subject: [PATCH] Some branding stuff --- src/client/component/branding.cpp | 19 ++++++++++--------- src/client/game/symbols.hpp | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/client/component/branding.cpp b/src/client/component/branding.cpp index a95c5aa2..4618a9b0 100644 --- a/src/client/component/branding.cpp +++ b/src/client/component/branding.cpp @@ -34,7 +34,6 @@ namespace branding public: void post_unpack() override { - if (game::environment::is_dedi()) { return; @@ -42,24 +41,26 @@ namespace branding if (game::environment::is_mp()) { - localized_strings::override("LUA_MENU_MULTIPLAYER_CAPS", "H1-MOD: MULTIPLAYER\n"); - localized_strings::override("MENU_MULTIPLAYER_CAPS", "H1-MOD: MULTIPLAYER"); + //localized_strings::override("LUA_MENU_MULTIPLAYER_CAPS", "H1-MOD: MULTIPLAYER\n"); + //localized_strings::override("MENU_MULTIPLAYER_CAPS", "H1-MOD: MULTIPLAYER"); } - dvars::override::set_string("version", utils::string::va("H1-Mod %s", VERSION)); + //dvars::override::set_string("version", utils::string::va("H1-Mod %s", VERSION)); ui_get_formatted_build_number_hook.create( - SELECT_VALUE(0x1403B1C40, 0x1404E74C0), ui_get_formatted_build_number_stub); + SELECT_VALUE(0x1403B1C40, 0x1DF300_b), ui_get_formatted_build_number_stub); scheduler::loop([]() { const auto font = game::R_RegisterFont("fonts/fira_mono_bold.ttf", 20); - - game::R_AddCmdDrawText("H1-Mod: " VERSION, 0x7FFFFFFF, font, 10.f, - 5.f + static_cast(font->pixelHeight), 1.f, 1.f, 0.0f, color, 0); + if (font) + { + game::R_AddCmdDrawText("H1-Mod: " VERSION, 0x7FFFFFFF, font, 10.f, + 5.f + static_cast(font->pixelHeight), 1.f, 1.f, 0.0f, color, 0); + } }, scheduler::pipeline::renderer); } }; } -//REGISTER_COMPONENT(branding::component) +REGISTER_COMPONENT(branding::component) diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 283e7cb8..f6f58353 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -96,8 +96,8 @@ namespace game float* color, Material* material)> R_AddCmdDrawStretchPic{0x17E5C0, 0x2443A0}; WEAK symbol R_RegisterFont{ 0x4D4100, 0x67F630 }; // H1MP(1.15) WEAK symbol R_TextWidth{0x4D43B0, 0x5D94A0}; - WEAK symbol R_GetFontHeight{0x5EA360, 0x5D92C0}; - WEAK symbol R_DrawSomething{0x4D37B0, 0x5D8890}; + WEAK symbol R_GetFontHeight{0x5EA360, 0x67F710}; + WEAK symbol R_DrawSomething{0x4D37B0, 0x67ECE0}; WEAK symbol R_SyncRenderThread{0x4F8240, 0x5FF3A0}; WEAK symbol H1_AddBaseDrawTextCmd{ 0x4F3DC0,0x6A3080 }; // H1MP(1.15)