diff --git a/cl_dll/hud.cpp b/cl_dll/hud.cpp index 8d06d504..d8371919 100644 --- a/cl_dll/hud.cpp +++ b/cl_dll/hud.cpp @@ -91,6 +91,7 @@ cvar_t *cl_righthand = nullptr; cvar_t *cl_viewrollangle; cvar_t *cl_viewrollspeed; cvar_t *cl_bob_angled; +cvar_t *hud_watermark; void ShutdownInput (void); @@ -500,6 +501,8 @@ void CHud :: Init( void ) cl_viewrollspeed = CVAR_CREATE ( "cl_viewrollspeed", "300", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); cl_bob_angled = CVAR_CREATE ( "cl_bob_angled", "0", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); + hud_watermark = CVAR_CREATE ( "hud_watermark", "1", FCVAR_CLIENTDLL | FCVAR_ARCHIVE ); + HOOK_MESSAGE( CheatCheck ); HOOK_MESSAGE( WhString ); HOOK_MESSAGE( SpikeCheck ); diff --git a/cl_dll/hud_settings.cpp b/cl_dll/hud_settings.cpp index e2cac159..21d6b0ab 100644 --- a/cl_dll/hud_settings.cpp +++ b/cl_dll/hud_settings.cpp @@ -49,36 +49,39 @@ int CHudSettings::Draw(float time) char str[32]; - sprintf(str, "AG version %s", ag_version); - gEngfuncs.pfnDrawString(x, (y += gHUD.m_scrinfo.iCharHeight), str, r, g, b); - - gEngfuncs.pfnDrawString(x, (y += gHUD.m_scrinfo.iCharHeight), gamemode, r, g, b); - - sprintf(str, "Time limit: %hhd", time_limit); - gEngfuncs.pfnDrawString(x, (y += gHUD.m_scrinfo.iCharHeight / 2 * 3), str, r, g, b); - - sprintf(str, "Frag limit: %hhd", frag_limit); - gEngfuncs.pfnDrawString(x, (y += gHUD.m_scrinfo.iCharHeight), str, r, g, b); + extern cvar_t* hud_watermark; + if (hud_watermark->value == 1) { + sprintf(str, "AG version %s", ag_version); + gEngfuncs.pfnDrawString(x, (y += gHUD.m_scrinfo.iCharHeight), str, r, g, b); - sprintf(str, "Friendly fire: %s", friendly_fire ? "On" : "Off"); - gEngfuncs.pfnDrawString(x, (y += gHUD.m_scrinfo.iCharHeight), str, r, g, b); + gEngfuncs.pfnDrawString(x, (y += gHUD.m_scrinfo.iCharHeight), gamemode, r, g, b); - sprintf(str, "Weaponstay: %s", weapon_stay ? "On" : "Off"); - gEngfuncs.pfnDrawString(x, (y += gHUD.m_scrinfo.iCharHeight), str, r, g, b); + sprintf(str, "Time limit: %hhd", time_limit); + gEngfuncs.pfnDrawString(x, (y += gHUD.m_scrinfo.iCharHeight / 2 * 3), str, r, g, b); - if (wallgauss[0]) { - sprintf(str, "Wallgauss: %sx (1)", wallgauss); + sprintf(str, "Frag limit: %hhd", frag_limit); gEngfuncs.pfnDrawString(x, (y += gHUD.m_scrinfo.iCharHeight), str, r, g, b); - } - if (headshot[0]) { - sprintf(str, "Headshot: %sx (3)", headshot); + sprintf(str, "Friendly fire: %s", friendly_fire ? "On" : "Off"); gEngfuncs.pfnDrawString(x, (y += gHUD.m_scrinfo.iCharHeight), str, r, g, b); - } - if (blast_radius[0]) { - sprintf(str, "Blast radius: %sx (1)", blast_radius); + sprintf(str, "Weaponstay: %s", weapon_stay ? "On" : "Off"); gEngfuncs.pfnDrawString(x, (y += gHUD.m_scrinfo.iCharHeight), str, r, g, b); + + if (wallgauss[0]) { + sprintf(str, "Wallgauss: %sx (1)", wallgauss); + gEngfuncs.pfnDrawString(x, (y += gHUD.m_scrinfo.iCharHeight), str, r, g, b); + } + + if (headshot[0]) { + sprintf(str, "Headshot: %sx (3)", headshot); + gEngfuncs.pfnDrawString(x, (y += gHUD.m_scrinfo.iCharHeight), str, r, g, b); + } + + if (blast_radius[0]) { + sprintf(str, "Blast radius: %sx (1)", blast_radius); + gEngfuncs.pfnDrawString(x, (y += gHUD.m_scrinfo.iCharHeight), str, r, g, b); + } } if (match_is_on) { diff --git a/cl_dll/hud_watermark.cpp b/cl_dll/hud_watermark.cpp index 34f95d74..f255f538 100644 --- a/cl_dll/hud_watermark.cpp +++ b/cl_dll/hud_watermark.cpp @@ -3,6 +3,8 @@ #include "parsemsg.h" #include "update_checker.h" +extern cvar_t* hud_watermark; + int CHudWatermark::Init() { m_iFlags = 0; @@ -22,9 +24,13 @@ int CHudWatermark::VidInit() int CHudWatermark::Draw(float time) { - if (refresh_draw_until || (draw_until > gHUD.m_flTime + 15.0f)) { + float duration = 15.0f; + if (hud_watermark->value != 1) + duration = 5.0f; + + if (refresh_draw_until || (draw_until > gHUD.m_flTime + duration)) { refresh_draw_until = false; - draw_until = gHUD.m_flTime + 15.0f; + draw_until = gHUD.m_flTime + duration; } if (gHUD.m_flTime >= draw_until) { @@ -35,8 +41,10 @@ int CHudWatermark::Draw(float time) int r, g, b; UnpackRGB(r, g, b, gHUD.m_iDefaultHUDColor); - gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight, "OpenAG client build " __DATE__, r, g, b); - gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight * 2, "j.mp/OpenAG", r, g, b); + if (hud_watermark->value != 0) { + gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight, "OpenAG client build " __DATE__, r, g, b); + gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight * 2, "j.mp/OpenAG", r, g, b); + } if (update_is_available) gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight / 2 * 7, "An update is available.", r, g, b);