Skip to content

Commit

Permalink
Add hud_watermark command
Browse files Browse the repository at this point in the history
  • Loading branch information
sabianroberts committed Oct 28, 2024
1 parent d5df24d commit 6a7daff
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 27 deletions.
2 changes: 2 additions & 0 deletions cl_dll/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ extern cvar_t *sensitivity;
cvar_t *cl_lw = NULL;
cvar_t *cl_righthand = nullptr;
cvar_t* cl_viewmodel_lag_enabled;
cvar_t* hud_watermark;

void ShutdownInput (void);

Expand Down Expand Up @@ -629,6 +630,7 @@ void CHud :: Init( void )
m_pSpriteList = NULL;

CVAR_CREATE("cl_music_enabled", "1", FCVAR_ARCHIVE | FCVAR_CLIENTDLL | FCVAR_USERINFO );
hud_watermark = CVAR_CREATE("hud_watermark", "1", FCVAR_ARCHIVE);

// Version Info command. Runs PrintVersion() which reads info from versioninfo.h
gEngfuncs.pfnAddCommand("version_aura", PrintVersion);
Expand Down
48 changes: 26 additions & 22 deletions cl_dll/hud_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,36 +49,40 @@ int CHudSettings::Draw(float time)

char str[32];

sprintf(str, "Aura %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, "Aura %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) {
Expand Down
14 changes: 9 additions & 5 deletions cl_dll/hud_watermark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,16 @@ int CHudWatermark::Draw(float time)

sprintf(displayString, "Half-Life: Zombies Ate My Neighbours Multiplayer %s", zamnhlmpVersion);

gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight, "Aura client build " __DATE__, r, g, b);
gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight * 2, displayString, r, g, b);
gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight * 3, season, r, g, b);
extern cvar_t* hud_watermark;
if (hud_watermark->value == 1)
{
gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight, "Aura client build " __DATE__, r, g, b);
gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight * 2, displayString, r, g, b);
gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight * 3, season, r, g, b);

if (update_is_available)
gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight / 2 * 7, " ", r, g, b);
if (update_is_available)
gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight / 2 * 7, " ", r, g, b);
}

return 0;
}

0 comments on commit 6a7daff

Please sign in to comment.