* 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
|
@ -309,7 +309,8 @@ Handles horizontal scrolling and cursor blinking
|
|||
x, y, and width are in pixels
|
||||
===================
|
||||
*/
|
||||
void Field_VariableSizeDraw( field_t *edit, int x, int y, int width, int size, qboolean showCursor ) {
|
||||
void Field_VariableSizeDraw( field_t *edit, int x, int y, int width, int size, qboolean showCursor,
|
||||
qboolean noColorEscape ) {
|
||||
int len;
|
||||
int drawLen;
|
||||
int prestep;
|
||||
|
@ -350,47 +351,45 @@ void Field_VariableSizeDraw( field_t *edit, int x, int y, int width, int size, q
|
|||
float color[4];
|
||||
|
||||
color[0] = color[1] = color[2] = color[3] = 1.0;
|
||||
SCR_DrawSmallStringExt( x, y, str, color, qfalse );
|
||||
SCR_DrawSmallStringExt( x, y, str, color, qfalse, noColorEscape );
|
||||
} else {
|
||||
// draw big string with drop shadow
|
||||
SCR_DrawBigString( x, y, str, 1.0 );
|
||||
SCR_DrawBigString( x, y, str, 1.0, noColorEscape );
|
||||
}
|
||||
|
||||
// draw the cursor
|
||||
if ( !showCursor ) {
|
||||
return;
|
||||
}
|
||||
if ( showCursor ) {
|
||||
if ( (int)( cls.realtime >> 8 ) & 1 ) {
|
||||
return; // off blink
|
||||
}
|
||||
|
||||
if ( (int)( cls.realtime >> 8 ) & 1 ) {
|
||||
return; // off blink
|
||||
}
|
||||
if ( key_overstrikeMode ) {
|
||||
cursorChar = 11;
|
||||
} else {
|
||||
cursorChar = 10;
|
||||
}
|
||||
|
||||
if ( key_overstrikeMode ) {
|
||||
cursorChar = 11;
|
||||
} else {
|
||||
cursorChar = 10;
|
||||
}
|
||||
i = drawLen - strlen( str );
|
||||
|
||||
i = drawLen - Q_PrintStrlen( str );
|
||||
|
||||
if ( size == SMALLCHAR_WIDTH ) {
|
||||
SCR_DrawSmallChar( x + ( edit->cursor - prestep - i ) * size, y, cursorChar );
|
||||
} else {
|
||||
str[0] = cursorChar;
|
||||
str[1] = 0;
|
||||
SCR_DrawBigString( x + ( edit->cursor - prestep - i ) * size, y, str, 1.0 );
|
||||
if ( size == SMALLCHAR_WIDTH ) {
|
||||
SCR_DrawSmallChar( x + ( edit->cursor - prestep - i ) * size, y, cursorChar );
|
||||
} else {
|
||||
str[0] = cursorChar;
|
||||
str[1] = 0;
|
||||
SCR_DrawBigString( x + ( edit->cursor - prestep - i ) * size, y, str, 1.0, qfalse );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Field_Draw( field_t *edit, int x, int y, int width, qboolean showCursor )
|
||||
void Field_Draw( field_t *edit, int x, int y, int width, qboolean showCursor, qboolean noColorEscape )
|
||||
{
|
||||
Field_VariableSizeDraw( edit, x, y, width, SMALLCHAR_WIDTH, showCursor );
|
||||
Field_VariableSizeDraw( edit, x, y, width, SMALLCHAR_WIDTH, showCursor, noColorEscape );
|
||||
}
|
||||
|
||||
void Field_BigDraw( field_t *edit, int x, int y, int width, qboolean showCursor )
|
||||
void Field_BigDraw( field_t *edit, int x, int y, int width, qboolean showCursor, qboolean noColorEscape )
|
||||
{
|
||||
Field_VariableSizeDraw( edit, x, y, width, BIGCHAR_WIDTH, showCursor );
|
||||
Field_VariableSizeDraw( edit, x, y, width, BIGCHAR_WIDTH, showCursor, noColorEscape );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue