mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-26 06:45:08 +00:00
engine: client: add cvar scr_drawversion to hide engine version in screenshots (sorry, Uncle Mike!)
This commit is contained in:
parent
cee6862924
commit
7e71e20714
@ -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_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_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( 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 int g_codepage = 0;
|
||||||
static qboolean g_utf8 = false;
|
static qboolean g_utf8 = false;
|
||||||
@ -841,6 +841,7 @@ void Con_Init( void )
|
|||||||
Cvar_RegisterVariable( &con_fontscale );
|
Cvar_RegisterVariable( &con_fontscale );
|
||||||
Cvar_RegisterVariable( &con_fontnum );
|
Cvar_RegisterVariable( &con_fontnum );
|
||||||
Cvar_RegisterVariable( &con_color );
|
Cvar_RegisterVariable( &con_color );
|
||||||
|
Cvar_RegisterVariable( &scr_drawversion );
|
||||||
|
|
||||||
// init the console buffer
|
// init the console buffer
|
||||||
con.bufsize = CON_TEXTSIZE;
|
con.bufsize = CON_TEXTSIZE;
|
||||||
@ -2047,26 +2048,30 @@ void Con_DrawVersion( void )
|
|||||||
byte *color = g_color_table[7];
|
byte *color = g_color_table[7];
|
||||||
int stringLen, charH = 0;
|
int stringLen, charH = 0;
|
||||||
int start, height = refState.height;
|
int start, height = refState.height;
|
||||||
qboolean draw_version = false;
|
|
||||||
string curbuild;
|
string curbuild;
|
||||||
|
|
||||||
switch( cls.scrshot_action )
|
if( !scr_drawversion.value || CL_IsDevOverviewMode() == 2 || net_graph.value )
|
||||||
{
|
|
||||||
case scrshot_normal:
|
|
||||||
case scrshot_snapshot:
|
|
||||||
draw_version = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( host.force_draw_version_time > host.realtime )
|
|
||||||
draw_version = true;
|
|
||||||
|
|
||||||
if(( cls.key_dest != key_menu && !draw_version ) || CL_IsDevOverviewMode() == 2 || net_graph.value )
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( draw_version )
|
if( cls.key_dest == key_menu )
|
||||||
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 ),
|
||||||
|
"v%i/" XASH_VERSION " (%s-%s build %i)", PROTOCOL_VERSION, Q_buildos(), Q_buildarch(), Q_buildnum( ));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qboolean draw_version;
|
||||||
|
|
||||||
|
draw_version = cls.scrshot_action == scrshot_normal
|
||||||
|
|| cls.scrshot_action == scrshot_snapshot
|
||||||
|
|| host.force_draw_version_time > host.realtime;
|
||||||
|
|
||||||
|
if( !draw_version )
|
||||||
|
return;
|
||||||
|
|
||||||
|
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 );
|
Con_DrawStringLen( curbuild, &stringLen, &charH );
|
||||||
start = refState.width - stringLen * 1.05f;
|
start = refState.width - stringLen * 1.05f;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user