* Don't apply colour escape chars on input fields
This commit is contained in:
parent
d86f72f75e
commit
da29118ae0
5 changed files with 46 additions and 48 deletions
|
@ -196,7 +196,8 @@ to a fixed color.
|
|||
Coordinates are at 640 by 480 virtual resolution
|
||||
==================
|
||||
*/
|
||||
void SCR_DrawStringExt( int x, int y, float size, const char *string, float *setColor, qboolean forceColor ) {
|
||||
void SCR_DrawStringExt( int x, int y, float size, const char *string, float *setColor, qboolean forceColor,
|
||||
qboolean noColorEscape ) {
|
||||
vec4_t color;
|
||||
const char *s;
|
||||
int xx;
|
||||
|
@ -208,7 +209,7 @@ void SCR_DrawStringExt( int x, int y, float size, const char *string, float *set
|
|||
s = string;
|
||||
xx = x;
|
||||
while ( *s ) {
|
||||
if ( Q_IsColorString( s ) ) {
|
||||
if ( !noColorEscape && Q_IsColorString( s ) ) {
|
||||
s += 2;
|
||||
continue;
|
||||
}
|
||||
|
@ -223,7 +224,7 @@ void SCR_DrawStringExt( int x, int y, float size, const char *string, float *set
|
|||
xx = x;
|
||||
re.SetColor( setColor );
|
||||
while ( *s ) {
|
||||
if ( Q_IsColorString( s ) ) {
|
||||
if ( !noColorEscape && Q_IsColorString( s ) ) {
|
||||
if ( !forceColor ) {
|
||||
Com_Memcpy( color, g_color_table[ColorIndex(*(s+1))], sizeof( color ) );
|
||||
color[3] = setColor[3];
|
||||
|
@ -240,16 +241,16 @@ void SCR_DrawStringExt( int x, int y, float size, const char *string, float *set
|
|||
}
|
||||
|
||||
|
||||
void SCR_DrawBigString( int x, int y, const char *s, float alpha ) {
|
||||
void SCR_DrawBigString( int x, int y, const char *s, float alpha, qboolean noColorEscape ) {
|
||||
float color[4];
|
||||
|
||||
color[0] = color[1] = color[2] = 1.0;
|
||||
color[3] = alpha;
|
||||
SCR_DrawStringExt( x, y, BIGCHAR_WIDTH, s, color, qfalse );
|
||||
SCR_DrawStringExt( x, y, BIGCHAR_WIDTH, s, color, qfalse, noColorEscape );
|
||||
}
|
||||
|
||||
void SCR_DrawBigStringColor( int x, int y, const char *s, vec4_t color ) {
|
||||
SCR_DrawStringExt( x, y, BIGCHAR_WIDTH, s, color, qtrue );
|
||||
void SCR_DrawBigStringColor( int x, int y, const char *s, vec4_t color, qboolean noColorEscape ) {
|
||||
SCR_DrawStringExt( x, y, BIGCHAR_WIDTH, s, color, qtrue, noColorEscape );
|
||||
}
|
||||
|
||||
|
||||
|
@ -259,11 +260,10 @@ SCR_DrawSmallString[Color]
|
|||
|
||||
Draws a multi-colored string with a drop shadow, optionally forcing
|
||||
to a fixed color.
|
||||
|
||||
Coordinates are at 640 by 480 virtual resolution
|
||||
==================
|
||||
*/
|
||||
void SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor, qboolean forceColor ) {
|
||||
void SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor, qboolean forceColor,
|
||||
qboolean noColorEscape ) {
|
||||
vec4_t color;
|
||||
const char *s;
|
||||
int xx;
|
||||
|
@ -273,7 +273,7 @@ void SCR_DrawSmallStringExt( int x, int y, const char *string, float *setColor,
|
|||
xx = x;
|
||||
re.SetColor( setColor );
|
||||
while ( *s ) {
|
||||
if ( Q_IsColorString( s ) ) {
|
||||
if ( !noColorEscape && Q_IsColorString( s ) ) {
|
||||
if ( !forceColor ) {
|
||||
Com_Memcpy( color, g_color_table[ColorIndex(*(s+1))], sizeof( color ) );
|
||||
color[3] = setColor[3];
|
||||
|
@ -339,7 +339,7 @@ void SCR_DrawDemoRecording( void ) {
|
|||
pos = FS_FTell( clc.demofile );
|
||||
sprintf( string, "RECORDING %s: %ik", clc.demoName, pos / 1024 );
|
||||
|
||||
SCR_DrawStringExt( 320 - strlen( string ) * 4, 20, 8, string, g_color_table[7], qtrue );
|
||||
SCR_DrawStringExt( 320 - strlen( string ) * 4, 20, 8, string, g_color_table[7], qtrue, qfalse );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue