Skip to content

Commit 044ddaa

Browse files
committed
Draw update reminder, but only for 5 seconds, if watermark is off
1 parent 004cdc1 commit 044ddaa

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

cl_dll/hud_watermark.cpp

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include "parsemsg.h"
44
#include "update_checker.h"
55

6+
extern cvar_t* hud_watermark;
7+
68
int CHudWatermark::Init()
79
{
810
m_iFlags = 0;
@@ -22,9 +24,20 @@ int CHudWatermark::VidInit()
2224

2325
int CHudWatermark::Draw(float time)
2426
{
25-
if (refresh_draw_until || (draw_until > gHUD.m_flTime + 15.0f)) {
27+
if (hud_watermark->value != 0)
28+
{
29+
30+
if (refresh_draw_until || (draw_until > gHUD.m_flTime + 15.0f)) {
2631
refresh_draw_until = false;
2732
draw_until = gHUD.m_flTime + 15.0f;
33+
}
34+
}
35+
else
36+
{
37+
if (refresh_draw_until || (draw_until > gHUD.m_flTime + 5.0f)) {
38+
refresh_draw_until = false;
39+
draw_until = gHUD.m_flTime + 5.0f;
40+
}
2841
}
2942

3043
if (gHUD.m_flTime >= draw_until) {
@@ -35,14 +48,13 @@ int CHudWatermark::Draw(float time)
3548
int r, g, b;
3649
UnpackRGB(r, g, b, gHUD.m_iDefaultHUDColor);
3750

38-
extern cvar_t* hud_watermark;
39-
if (hud_watermark->value == 1)
51+
if (hud_watermark->value != 0)
4052
{
4153
gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight, "OpenAG client build " __DATE__, r, g, b);
4254
gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight * 2, "j.mp/OpenAG", r, g, b);
43-
44-
if (update_is_available)
45-
gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight / 2 * 7, "An update is available.", r, g, b);
4655
}
56+
57+
if (update_is_available)
58+
gEngfuncs.pfnDrawString(ScreenWidth / 20, gHUD.m_scrinfo.iCharHeight / 2 * 7, "An update is available.", r, g, b);
4759
return 0;
4860
}

0 commit comments

Comments
 (0)