From d63a9a6d753c853946634291dcf9080d4aa81ef6 Mon Sep 17 00:00:00 2001 From: Skull <86374920+skkuull@users.noreply.github.com> Date: Sun, 26 Jun 2022 20:43:07 +0300 Subject: [PATCH] hide h1-mod branding via dvar --- src/client/component/branding.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/client/component/branding.cpp b/src/client/component/branding.cpp index cbbcb0eb..9f637670 100644 --- a/src/client/component/branding.cpp +++ b/src/client/component/branding.cpp @@ -7,7 +7,7 @@ #include "version.hpp" #include "game/game.hpp" -#include "dvars.hpp" +#include "game/dvars.hpp" #include #include @@ -18,6 +18,7 @@ namespace branding { namespace { + game::dvar_t* cg_showversion; utils::hook::detour ui_get_formatted_build_number_hook; float color[4] = {0.666f, 0.666f, 0.666f, 0.666f}; @@ -31,7 +32,7 @@ namespace branding void draw_branding() { const auto font = game::R_RegisterFont("fonts/fira_mono_bold.ttf", 20); - if (font) + if (font && cg_showversion->current.enabled) { #ifdef DEBUG game::R_AddCmdDrawText("H1-Mod: " VERSION " (" __DATE__ " " __TIME__ ")", 0x7FFFFFFF, font, 10.f, @@ -65,6 +66,8 @@ namespace branding localized_strings::override("MENU_MULTIPLAYER_CAPS", "H1-MOD: MULTIPLAYER"); } + cg_showversion = dvars::register_bool("cg_showversion", true, game::DvarFlags::DVAR_FLAG_SAVED, "Show/Hide H1-Mod Branding"); + ui_get_formatted_build_number_hook.create( SELECT_VALUE(0x406EC0_b, 0x1DF300_b), ui_get_formatted_build_number_stub); }