From eebbf31bde9d3dd07368d84e1900e358a05d35a6 Mon Sep 17 00:00:00 2001 From: Ahrimdon Date: Mon, 11 Mar 2024 01:16:34 -0400 Subject: [PATCH] Refactor(branding.cpp): Remove branding functions, retain S1-MOD copyright override --- src/client/component/branding.cpp | 45 ++++--------------------------- 1 file changed, 5 insertions(+), 40 deletions(-) diff --git a/src/client/component/branding.cpp b/src/client/component/branding.cpp index 9d53c36..a9ffb02 100644 --- a/src/client/component/branding.cpp +++ b/src/client/component/branding.cpp @@ -1,30 +1,15 @@ #include #include "loader/component_loader.hpp" +#include "localized_strings.hpp" #include "game/game.hpp" -#include "localized_strings.hpp" -#include "scheduler.hpp" #include "dvars.hpp" - -#include #include - #include "version.hpp" +// Ahrimdon namespace branding { - namespace - { - utils::hook::detour ui_get_formatted_build_number_hook; - - const char* ui_get_formatted_build_number_stub() - { - const auto* const build_num = ui_get_formatted_build_number_hook.invoke(); - - return utils::string::va("%s (%s)", VERSION, build_num); - } - } - class component final : public component_interface { public: @@ -37,31 +22,11 @@ namespace branding if (game::environment::is_mp()) { - localized_strings::override("LUA_MENU_MULTIPLAYER_CAPS", "s1-mod: MULTIPLAYER\n"); + localized_strings::override("LUA_MENU_MULTIPLAYER_CAPS", "S1-MOD: MULTIPLAYER"); } - localized_strings::override("LUA_MENU_LEGAL_COPYRIGHT", "s1-mod: " VERSION); + localized_strings::override("LUA_MENU_LEGAL_COPYRIGHT", "S1-MOD"); - dvars::override::set_string("version", utils::string::va("s1-mod %s", VERSION)); - - ui_get_formatted_build_number_hook.create( - SELECT_VALUE(0x14035B3F0, 0x1404A8950), ui_get_formatted_build_number_stub); - - scheduler::loop([]() - { - const auto x = 4; - const auto y = 4; - const auto scale = 1.0f; - float color[4] = {0.666f, 0.666f, 0.666f, 0.666f}; - const auto* text = ""; - - auto* font = game::R_RegisterFont("fonts/consolefont"); - - if (!font) return; - - game::R_AddCmdDrawText(text, std::numeric_limits::max(), font, static_cast(x), - y + static_cast(font->pixelHeight) * scale, - scale, scale, 0.0f, color, 0); - }, scheduler::pipeline::renderer); + dvars::override::set_string("version", utils::string::va("S1-Mod %s", VERSION)); } }; }