hide h1-mod branding via dvar
This commit is contained in:
parent
8a8f57e84c
commit
c5601ccb0b
@ -7,7 +7,7 @@
|
|||||||
#include "version.hpp"
|
#include "version.hpp"
|
||||||
|
|
||||||
#include "game/game.hpp"
|
#include "game/game.hpp"
|
||||||
#include "dvars.hpp"
|
#include "game/dvars.hpp"
|
||||||
|
|
||||||
#include <utils/hook.hpp>
|
#include <utils/hook.hpp>
|
||||||
#include <utils/string.hpp>
|
#include <utils/string.hpp>
|
||||||
@ -18,6 +18,7 @@ namespace branding
|
|||||||
{
|
{
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
game::dvar_t* cg_showversion;
|
||||||
utils::hook::detour ui_get_formatted_build_number_hook;
|
utils::hook::detour ui_get_formatted_build_number_hook;
|
||||||
|
|
||||||
float color[4] = {0.666f, 0.666f, 0.666f, 0.666f};
|
float color[4] = {0.666f, 0.666f, 0.666f, 0.666f};
|
||||||
@ -31,7 +32,7 @@ namespace branding
|
|||||||
void draw_branding()
|
void draw_branding()
|
||||||
{
|
{
|
||||||
const auto font = game::R_RegisterFont("fonts/fira_mono_bold.ttf", 20);
|
const auto font = game::R_RegisterFont("fonts/fira_mono_bold.ttf", 20);
|
||||||
if (font)
|
if (font && cg_showversion->current.enabled)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
game::R_AddCmdDrawText("H1-Mod: " VERSION " (" __DATE__ " " __TIME__ ")", 0x7FFFFFFF, font, 10.f,
|
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");
|
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(
|
ui_get_formatted_build_number_hook.create(
|
||||||
SELECT_VALUE(0x406EC0_b, 0x1DF300_b), ui_get_formatted_build_number_stub);
|
SELECT_VALUE(0x406EC0_b, 0x1DF300_b), ui_get_formatted_build_number_stub);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user