Browse Source

engine: client: add cvar scr_drawversion to hide engine version in screenshots (sorry, Uncle Mike!)

pull/4/head
Alibek Omarov 12 months ago
parent
commit
7e71e20714
  1. 33
      engine/client/console.c

33
engine/client/console.c

@ -29,7 +29,7 @@ static CVAR_DEFINE_AUTO( con_charset, "cp1251", FCVAR_ARCHIVE, "console font cha @@ -29,7 +29,7 @@ static CVAR_DEFINE_AUTO( con_charset, "cp1251", FCVAR_ARCHIVE, "console font cha
static CVAR_DEFINE_AUTO( con_fontscale, "1.0", FCVAR_ARCHIVE, "scale font texture" );
static CVAR_DEFINE_AUTO( con_fontnum, "-1", FCVAR_ARCHIVE, "console font number (0, 1 or 2), -1 for autoselect" );
static CVAR_DEFINE_AUTO( con_color, "240 180 24", FCVAR_ARCHIVE, "set a custom console color" );
static CVAR_DEFINE_AUTO( scr_drawversion, "1", FCVAR_ARCHIVE, "draw version in menu or screenshots, doesn't affect console" );
static int g_codepage = 0;
static qboolean g_utf8 = false;
@ -841,6 +841,7 @@ void Con_Init( void ) @@ -841,6 +841,7 @@ void Con_Init( void )
Cvar_RegisterVariable( &con_fontscale );
Cvar_RegisterVariable( &con_fontnum );
Cvar_RegisterVariable( &con_color );
Cvar_RegisterVariable( &scr_drawversion );
// init the console buffer
con.bufsize = CON_TEXTSIZE;
@ -2047,26 +2048,30 @@ void Con_DrawVersion( void ) @@ -2047,26 +2048,30 @@ void Con_DrawVersion( void )
byte *color = g_color_table[7];
int stringLen, charH = 0;
int start, height = refState.height;
qboolean draw_version = false;
string curbuild;
switch( cls.scrshot_action )
if( !scr_drawversion.value || CL_IsDevOverviewMode() == 2 || net_graph.value )
return;
if( cls.key_dest == key_menu )
{
case scrshot_normal:
case scrshot_snapshot:
draw_version = true;
break;
Q_snprintf( curbuild, sizeof( curbuild ),
"v%i/" XASH_VERSION " (%s-%s build %i)", PROTOCOL_VERSION, Q_buildos(), Q_buildarch(), Q_buildnum( ));
}
else
{
qboolean draw_version;
if( host.force_draw_version_time > host.realtime )
draw_version = true;
draw_version = cls.scrshot_action == scrshot_normal
|| cls.scrshot_action == scrshot_snapshot
|| host.force_draw_version_time > host.realtime;
if(( cls.key_dest != key_menu && !draw_version ) || CL_IsDevOverviewMode() == 2 || net_graph.value )
return;
if( !draw_version )
return;
if( draw_version )
Q_snprintf( curbuild, MAX_STRING, XASH_ENGINE_NAME " v%i/" XASH_VERSION " (%s-%s build %i)", PROTOCOL_VERSION, Q_buildos(), Q_buildarch(), Q_buildnum( ));
else Q_snprintf( curbuild, MAX_STRING, "v%i/" XASH_VERSION " (%s-%s build %i)", PROTOCOL_VERSION, Q_buildos(), Q_buildarch(), Q_buildnum( ));
Q_snprintf( curbuild, sizeof( curbuild ),
XASH_ENGINE_NAME " v%i/" XASH_VERSION " (%s-%s build %i)", PROTOCOL_VERSION, Q_buildos(), Q_buildarch(), Q_buildnum( ));
}
Con_DrawStringLen( curbuild, &stringLen, &charH );
start = refState.width - stringLen * 1.05f;

Loading…
Cancel
Save