diff options
author | Tim Angus <tim@ngus.net> | 2007-11-08 00:05:14 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2007-11-08 00:05:14 +0000 |
commit | 74c8d33a2b830a47c31272bcf16cbbfd404ce0e8 (patch) | |
tree | e57fc261700a619fbf9a09a589706a5165653221 | |
parent | c6a9027b7cf0d35401cae346b67ca95c5f55b4a1 (diff) |
* Merge and move text paint functions into ui_shared.c
* Add aspectBias to indicate alignment on non-4:3 video modes
* Add "reset <item>" script command to reset an item
* Compensate for aspect ratio in lots and lots and lots of places
* Release edit field focus when tabbing away
* Fix infinite loop bug in text wrapping code when rect is very narrow
* Mung .menu scripts to line things up correctly on non-4:3 ratios
48 files changed, 1589 insertions, 1632 deletions
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c index ec50146e..56d25c9c 100644 --- a/src/cgame/cg_draw.c +++ b/src/cgame/cg_draw.c @@ -28,8 +28,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "cg_local.h" #include "../ui/ui_shared.h" -// used for scoreboard -extern displayContextDef_t cgDC; menuDef_t *menuScoreboard = NULL; int drawTeamOverlayModificationCount = -1; @@ -37,107 +35,6 @@ int drawTeamOverlayModificationCount = -1; int sortedTeamPlayers[ TEAM_MAXOVERLAY ]; int numSortedTeamPlayers; -//TA UI -float CG_Text_Width( const char *text, float scale, int limit ) -{ - int count,len; - float out; - glyphInfo_t *glyph; - float useScale; - const char *s = text; - fontInfo_t *font = &cgDC.Assets.textFont; - - if( scale <= cg_smallFont.value ) - font = &cgDC.Assets.smallFont; - else if( scale > cg_bigFont.value ) - font = &cgDC.Assets.bigFont; - - useScale = scale * font->glyphScale; - out = 0; - - if( text ) - { - len = strlen( text ); - if( limit > 0 && len > limit ) - len = limit; - - count = 0; - while( s && *s && count < len ) - { - if( Q_IsColorString( s ) ) - { - s += 2; - continue; - } - else - { - glyph = &font->glyphs[ (int)*s ]; - out += glyph->xSkip; - s++; - count++; - } - } - } - - return out * useScale; -} - -float CG_Text_Height( const char *text, float scale, int limit ) -{ - int len, count; - float max; - glyphInfo_t *glyph; - float useScale; - const char *s = text; - fontInfo_t *font = &cgDC.Assets.textFont; - - if( scale <= cg_smallFont.value ) - font = &cgDC.Assets.smallFont; - else if( scale > cg_bigFont.value ) - font = &cgDC.Assets.bigFont; - - useScale = scale * font->glyphScale; - max = 0; - - if( text ) - { - len = strlen( text ); - if( limit > 0 && len > limit ) - len = limit; - - count = 0; - while( s && *s && count < len ) - { - if( Q_IsColorString( s ) ) - { - s += 2; - continue; - } - else - { - glyph = &font->glyphs[ (int)*s ]; - if( max < glyph->height ) - max = glyph->height; - - s++; - count++; - } - } - } - - return max * useScale; -} - -float CG_Text_EmWidth( float scale ) -{ - return CG_Text_Width( "M", scale, 0 ); -} - -float CG_Text_EmHeight( float scale ) -{ - return CG_Text_Height( "M", scale, 0 ); -} - static void CG_AlignText( rectDef_t *rect, const char *text, float scale, float w, float h, int align, int valign, @@ -147,22 +44,22 @@ static void CG_AlignText( rectDef_t *rect, const char *text, float scale, if( scale > 0.0f ) { - w = CG_Text_Width( text, scale, 0 ); - h = CG_Text_Height( text, scale, 0 ); + w = UI_Text_Width( text, scale, 0 ); + h = UI_Text_Height( text, scale, 0 ); } switch( align ) { default: - case ITEM_ALIGN_LEFT: + case ALIGN_LEFT: tx = 0.0f; break; - case ITEM_ALIGN_RIGHT: + case ALIGN_RIGHT: tx = rect->w - w; break; - case ITEM_ALIGN_CENTER: + case ALIGN_CENTER: tx = ( rect->w - w ) / 2.0f; break; } @@ -170,15 +67,15 @@ static void CG_AlignText( rectDef_t *rect, const char *text, float scale, switch( valign ) { default: - case ITEM_VALIGN_BOTTOM: + case VALIGN_BOTTOM: ty = rect->h; break; - case ITEM_VALIGN_TOP: + case VALIGN_TOP: ty = h; break; - case ITEM_VALIGN_CENTER: + case VALIGN_CENTER: ty = h + ( ( rect->h - h ) / 2.0f ); break; } @@ -190,156 +87,6 @@ static void CG_AlignText( rectDef_t *rect, const char *text, float scale, *y = rect->y + ty; } -void CG_Text_PaintChar( float x, float y, float width, float height, float scale, - float s, float t, float s2, float t2, qhandle_t hShader ) -{ - float w, h; - w = width * scale; - h = height * scale; - CG_AdjustFrom640( &x, &y, &w, &h ); - trap_R_DrawStretchPic( x, y, w, h, s, t, s2, t2, hShader ); -} - -void CG_Text_Paint( float x, float y, float scale, vec4_t color, const char *text, - float adjust, int limit, int style ) -{ - int len, count; - vec4_t newColor; - glyphInfo_t *glyph; - float useScale; - fontInfo_t *font = &cgDC.Assets.textFont; - - if( scale <= cg_smallFont.value ) - font = &cgDC.Assets.smallFont; - else if( scale > cg_bigFont.value ) - font = &cgDC.Assets.bigFont; - - useScale = scale * font->glyphScale; - if( text ) - { - - const char *s = text; - - trap_R_SetColor( color ); - memcpy( &newColor[ 0 ], &color[ 0 ], sizeof( vec4_t ) ); - len = strlen( text ); - - if( limit > 0 && len > limit ) - len = limit; - - count = 0; - while( s && *s && count < len ) - { - glyph = &font->glyphs[ (int)*s ]; - - if( Q_IsColorString( s ) ) - { - memcpy( newColor, g_color_table[ ColorIndex( *( s + 1 ) ) ], sizeof( newColor ) ); - newColor[ 3 ] = color[ 3 ]; - trap_R_SetColor( newColor ); - s += 2; - continue; - } - else - { - float yadj = useScale * glyph->top; - if( style == ITEM_TEXTSTYLE_SHADOWED || - style == ITEM_TEXTSTYLE_SHADOWEDMORE ) - { - int ofs = style == ITEM_TEXTSTYLE_SHADOWED ? 1 : 2; - colorBlack[ 3 ] = newColor[ 3 ]; - trap_R_SetColor( colorBlack ); - CG_Text_PaintChar( x + ofs, y - yadj + ofs, - glyph->imageWidth, - glyph->imageHeight, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph ); - - colorBlack[ 3 ] = 1.0; - trap_R_SetColor( newColor ); - } - else if( style == ITEM_TEXTSTYLE_NEON ) - { - vec4_t glow, outer, inner, white; - - glow[ 0 ] = newColor[ 0 ] * 0.5; - glow[ 1 ] = newColor[ 1 ] * 0.5; - glow[ 2 ] = newColor[ 2 ] * 0.5; - glow[ 3 ] = newColor[ 3 ] * 0.2; - - outer[ 0 ] = newColor[ 0 ]; - outer[ 1 ] = newColor[ 1 ]; - outer[ 2 ] = newColor[ 2 ]; - outer[ 3 ] = newColor[ 3 ]; - - inner[ 0 ] = newColor[ 0 ] * 1.5 > 1.0f ? 1.0f : newColor[ 0 ] * 1.5; - inner[ 1 ] = newColor[ 1 ] * 1.5 > 1.0f ? 1.0f : newColor[ 1 ] * 1.5; - inner[ 2 ] = newColor[ 2 ] * 1.5 > 1.0f ? 1.0f : newColor[ 2 ] * 1.5; - inner[ 3 ] = newColor[ 3 ]; - - white[ 0 ] = white[ 1 ] = white[ 2 ] = white[ 3 ] = 1.0f; - - trap_R_SetColor( glow ); - CG_Text_PaintChar( x - 3, y - yadj - 3, - glyph->imageWidth + 6, - glyph->imageHeight + 6, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph ); - - trap_R_SetColor( outer ); - CG_Text_PaintChar( x - 1, y - yadj - 1, - glyph->imageWidth + 2, - glyph->imageHeight + 2, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph ); - - trap_R_SetColor( inner ); - CG_Text_PaintChar( x - 0.5, y - yadj - 0.5, - glyph->imageWidth + 1, - glyph->imageHeight + 1, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph ); - - trap_R_SetColor( white ); - } - - - CG_Text_PaintChar( x, y - yadj, - glyph->imageWidth, - glyph->imageHeight, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph ); - - x += ( glyph->xSkip * useScale ) + adjust; - s++; - count++; - } - } - - trap_R_SetColor( NULL ); - } -} - /* ============== CG_DrawFieldPadded @@ -358,7 +105,7 @@ static void CG_DrawFieldPadded( int x, int y, int width, int cw, int ch, int val charWidth = CHAR_WIDTH; if( !( charHeight = ch ) ) - charWidth = CHAR_HEIGHT; + charHeight = CHAR_HEIGHT; if( width < 1 ) return; @@ -395,7 +142,7 @@ static void CG_DrawFieldPadded( int x, int y, int width, int cw, int ch, int val orgL = l; - x += 2; + x += ( 2.0f * cgDC.aspectScale ); ptr = num; while( *ptr && l ) @@ -438,7 +185,7 @@ void CG_DrawField( float x, float y, int width, float cw, float ch, int value ) charWidth = CHAR_WIDTH; if( !( charHeight = ch ) ) - charWidth = CHAR_HEIGHT; + charHeight = CHAR_HEIGHT; if( width < 1 ) return; @@ -473,7 +220,7 @@ void CG_DrawField( float x, float y, int width, float cw, float ch, int value ) if( l > width ) l = width; - x += 2 + charWidth * ( width - l ); + x += ( 2.0f * cgDC.aspectScale ) + charWidth * ( width - l ); ptr = num; while( *ptr && l ) @@ -516,7 +263,7 @@ static void CG_DrawProgressBar( rectDef_t *rect, vec4_t color, float scale, trap_R_SetColor( color ); //draw rim and bar - if( align == ITEM_ALIGN_RIGHT ) + if( align == ALIGN_RIGHT ) { CG_DrawPic( rect->x, rect->y, rimWidth, rect->h, cgs.media.whiteShader ); CG_DrawPic( rect->x + rimWidth, rect->y, @@ -542,9 +289,9 @@ static void CG_DrawProgressBar( rectDef_t *rect, vec4_t color, float scale, if( scale > 0.0 ) { Com_sprintf( textBuffer, sizeof( textBuffer ), "%d%%", (int)( progress * 100 ) ); - CG_AlignText( rect, textBuffer, scale, 0.0f, 0.0f, textalign, ITEM_VALIGN_CENTER, &tx, &ty ); + CG_AlignText( rect, textBuffer, scale, 0.0f, 0.0f, textalign, VALIGN_CENTER, &tx, &ty ); - CG_Text_Paint( tx, ty, scale, color, textBuffer, 0, 0, textStyle ); + UI_Text_Paint( tx, ty, scale, color, textBuffer, 0, 0, textStyle ); } } @@ -1172,10 +919,10 @@ static void CG_DrawProgressLabel( rectDef_t *rect, float text_x, float text_y, v CG_AlignText( rect, s, scale, 0.0f, 0.0f, textalign, textvalign, &tx, &ty ); if( fraction < 1.0f ) - CG_Text_Paint( text_x + tx, text_y + ty, scale, white, + UI_Text_Paint( text_x + tx, text_y + ty, scale, white, s, 0, 0, ITEM_TEXTSTYLE_NORMAL ); else - CG_Text_Paint( text_x + tx, text_y + ty, scale, color, + UI_Text_Paint( text_x + tx, text_y + ty, scale, color, s, 0, 0, ITEM_TEXTSTYLE_NEON ); } @@ -1392,82 +1139,12 @@ static void CG_DrawKiller( rectDef_t *rect, float scale, vec4_t color, if( cg.killerName[ 0 ] ) { int x = rect->x + rect->w / 2; - CG_Text_Paint( x - CG_Text_Width( CG_GetKillerText( ), scale, 0 ) / 2, + UI_Text_Paint( x - UI_Text_Width( CG_GetKillerText( ), scale, 0 ) / 2, rect->y + rect->h, scale, color, CG_GetKillerText( ), 0, 0, textStyle ); } } -static void CG_Text_Paint_Limit( float *maxX, float x, float y, float scale, - vec4_t color, const char* text, float adjust, int limit ) -{ - int len, count; - vec4_t newColor; - glyphInfo_t *glyph; - - if( text ) - { - const char *s = text; - float max = *maxX; - float useScale; - fontInfo_t *font = &cgDC.Assets.textFont; - - if( scale <= cg_smallFont.value ) - font = &cgDC.Assets.smallFont; - else if( scale > cg_bigFont.value ) - font = &cgDC.Assets.bigFont; - - useScale = scale * font->glyphScale; - trap_R_SetColor( color ); - len = strlen( text ); - - if( limit > 0 && len > limit ) - len = limit; - - count = 0; - - while( s && *s && count < len ) - { - glyph = &font->glyphs[ (int)*s ]; - - if( Q_IsColorString( s ) ) - { - memcpy( newColor, g_color_table[ ColorIndex( *(s+1) ) ], sizeof( newColor ) ); - newColor[ 3 ] = color[ 3 ]; - trap_R_SetColor( newColor ); - s += 2; - continue; - } - else - { - float yadj = useScale * glyph->top; - - if( CG_Text_Width( s, useScale, 1 ) + x > max ) - { - *maxX = 0; - break; - } - - CG_Text_PaintChar( x, y - yadj, - glyph->imageWidth, - glyph->imageHeight, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph ); - x += ( glyph->xSkip * useScale ) + adjust; - *maxX = x; - count++; - s++; - } - } - - trap_R_SetColor( NULL ); - } -} - static void CG_DrawTeamSpectators( rectDef_t *rect, float scale, int textvalign, vec4_t color, qhandle_t shader ) { float y; @@ -1503,7 +1180,7 @@ static void CG_DrawTeamSpectators( rectDef_t *rect, float scale, int textvalign, cg.spectatorOffset += 2; else { - cg.spectatorPaintX += CG_Text_Width( &cg.spectatorList[ cg.spectatorOffset ], scale, 1 ) - 1; + cg.spectatorPaintX += UI_Text_Width( &cg.spectatorList[ cg.spectatorOffset ], scale, 1 ) - 1; cg.spectatorOffset++; } } @@ -1529,16 +1206,16 @@ static void CG_DrawTeamSpectators( rectDef_t *rect, float scale, int textvalign, } maxX = rect->x + rect->w - 2; - CG_AlignText( rect, NULL, 0.0f, 0.0f, CG_Text_EmHeight( scale ), - ITEM_ALIGN_LEFT, textvalign, NULL, &y ); + CG_AlignText( rect, NULL, 0.0f, 0.0f, UI_Text_EmHeight( scale ), + ALIGN_LEFT, textvalign, NULL, &y ); - CG_Text_Paint_Limit( &maxX, cg.spectatorPaintX, y, scale, color, + UI_Text_Paint_Limit( &maxX, cg.spectatorPaintX, y, scale, color, &cg.spectatorList[ cg.spectatorOffset ], 0, 0 ); if( cg.spectatorPaintX2 >= 0 ) { float maxX2 = rect->x + rect->w - 2; - CG_Text_Paint_Limit( &maxX2, cg.spectatorPaintX2, y, scale, + UI_Text_Paint_Limit( &maxX2, cg.spectatorPaintX2, y, scale, color, cg.spectatorList, 0, cg.spectatorOffset ); } @@ -1590,17 +1267,17 @@ static void CG_DrawTeamLabel( rectDef_t *rect, pTeam_t team, float text_x, float switch( textalign ) { default: - case ITEM_ALIGN_LEFT: + case ALIGN_LEFT: s = va( "%s %s", t, stage ); break; - case ITEM_ALIGN_RIGHT: + case ALIGN_RIGHT: s = va( "%s %s", stage, t ); break; } CG_AlignText( rect, s, scale, 0.0f, 0.0f, textalign, textvalign, &tx, &ty ); - CG_Text_Paint( text_x + tx, text_y + ty, scale, color, s, 0, 0, textStyle ); + UI_Text_Paint( text_x + tx, text_y + ty, scale, color, s, 0, 0, textStyle ); } /* @@ -1650,7 +1327,7 @@ static void CG_DrawStageReport( rectDef_t *rect, float text_x, float text_y, CG_AlignText( rect, s, scale, 0.0f, 0.0f, textalign, textvalign, &tx, &ty ); - CG_Text_Paint( text_x + tx, text_y + ty, scale, color, s, 0, 0, textStyle ); + UI_Text_Paint( text_x + tx, text_y + ty, scale, color, s, 0, 0, textStyle ); } /* @@ -1702,10 +1379,10 @@ static void CG_DrawFPS( rectDef_t *rect, float text_x, float text_y, fps = 1000 * FPS_FRAMES / total; s = va( "%d", fps ); - w = CG_Text_Width( "0", scale, 0 ); - h = CG_Text_Height( "0", scale, 0 ); + w = UI_Text_Width( "0", scale, 0 ); + h = UI_Text_Height( "0", scale, 0 ); strLength = CG_DrawStrlen( s ); - totalWidth = CG_Text_Width( FPS_STRING, scale, 0 ) + w * strLength; + totalWidth = UI_Text_Width( FPS_STRING, scale, 0 ) + w * strLength; CG_AlignText( rect, s, 0.0f, totalWidth, h, textalign, textvalign, &tx, &ty ); @@ -1718,10 +1395,10 @@ static void CG_DrawFPS( rectDef_t *rect, float text_x, float text_y, c[ 0 ] = s[ i ]; c[ 1 ] = '\0'; - CG_Text_Paint( text_x + tx + i * w, text_y + ty, scale, color, c, 0, 0, textStyle ); + UI_Text_Paint( text_x + tx + i * w, text_y + ty, scale, color, c, 0, 0, textStyle ); } - CG_Text_Paint( text_x + tx + i * w, text_y + ty, scale, color, FPS_STRING, 0, 0, textStyle ); + UI_Text_Paint( text_x + tx + i * w, text_y + ty, scale, color, FPS_STRING, 0, 0, textStyle ); } else { @@ -1811,8 +1488,8 @@ static void CG_DrawTimer( rectDef_t *rect, float text_x, float text_y, seconds -= tens * 10; s = va( "%d:%d%d", mins, tens, seconds ); - w = CG_Text_Width( "0", scale, 0 ); - h = CG_Text_Height( "0", scale, 0 ); + w = UI_Text_Width( "0", scale, 0 ); + h = UI_Text_Height( "0", scale, 0 ); strLength = CG_DrawStrlen( s ); totalWidth = w * strLength; @@ -1825,7 +1502,7 @@ static void CG_DrawTimer( rectDef_t *rect, float text_x, float text_y, c[ 0 ] = s[ i ]; c[ 1 ] = '\0'; - CG_Text_Paint( text_x + tx + i * w, text_y + ty, scale, color, c, 0, 0, textStyle ); + UI_Text_Paint( text_x + tx + i * w, text_y + ty, scale, color, c, 0, 0, textStyle ); } } @@ -1872,8 +1549,8 @@ static void CG_DrawClock( rectDef_t *rect, float text_x, float text_y, s = va( "%d%s%02d%s", h, ( qt.tm_sec % 2 ) ? ":" : " ", qt.tm_min, pm ); } - w = CG_Text_Width( "0", scale, 0 ); - h = CG_Text_Height( "0", scale, 0 ); + w = UI_Text_Width( "0", scale, 0 ); + h = UI_Text_Height( "0", scale, 0 ); strLength = CG_DrawStrlen( s ); totalWidth = w * strLength; @@ -1886,7 +1563,7 @@ static void CG_DrawClock( rectDef_t *rect, float text_x, float text_y, c[ 0 ] = s[ i ]; c[ 1 ] = '\0'; - CG_Text_Paint( text_x + tx + i * w, text_y + ty, scale, color, c, 0, 0, textStyle ); + UI_Text_Paint( text_x + tx + i * w, text_y + ty, scale, color, c, 0, 0, textStyle ); } } @@ -1910,7 +1587,7 @@ static void CG_DrawSnapshot( rectDef_t *rect, float text_x, float text_y, CG_AlignText( rect, s, scale, 0.0f, 0.0f, textalign, textvalign, &tx, &ty ); - CG_Text_Paint( text_x + tx, text_y + ty, scale, color, s, 0, 0, textStyle ); + UI_Text_Paint( text_x + tx, text_y + ty, scale, color, s, 0, 0, textStyle ); } /* @@ -2021,8 +1698,8 @@ static void CG_DrawDisconnect( void ) // also add text in center of screen s = "Connection Interrupted"; - w = CG_Text_Width( s, 0.7f, 0 ); - CG_Text_Paint( 320 - w / 2, 100, 0.7f, color, s, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); + w = UI_Text_Width( s, 0.7f, 0 ); + UI_Text_Paint( 320 - w / 2, 100, 0.7f, color, s, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); // blink the icon if( ( cg.time >> 9 ) & 1 ) @@ -2175,18 +1852,18 @@ static void CG_DrawLagometer( rectDef_t *rect, float text_x, float text_y, trap_R_SetColor( NULL ); if( cg_nopredict.integer || cg_synchronousClients.integer ) - CG_Text_Paint( ax, ay, 0.5, white, "snc", 0, 0, ITEM_TEXTSTYLE_NORMAL ); + UI_Text_Paint( ax, ay, 0.5, white, "snc", 0, 0, ITEM_TEXTSTYLE_NORMAL ); else { char *s; s = va( "%d", cg.ping ); - ax = rect->x + ( rect->w / 2.0f ) - ( CG_Text_Width( s, scale, 0 ) / 2.0f ) + text_x; - ay = rect->y + ( rect->h / 2.0f ) + ( CG_Text_Height( s, scale, 0 ) / 2.0f ) + text_y; + ax = rect->x + ( rect->w / 2.0f ) - ( UI_Text_Width( s, scale, 0 ) / 2.0f ) + text_x; + ay = rect->y + ( rect->h / 2.0f ) + ( UI_Text_Height( s, scale, 0 ) / 2.0f ) + text_y; Vector4Copy( textColor, adjustedColor ); adjustedColor[ 3 ] = 0.5f; - CG_Text_Paint( ax, ay, scale, adjustedColor, s, 0, 0, ITEM_TEXTSTYLE_NORMAL ); + UI_Text_Paint( ax, ay, scale, adjustedColor, s, 0, 0, ITEM_TEXTSTYLE_NORMAL ); } CG_DrawDisconnect( ); @@ -2311,6 +1988,8 @@ static void CG_DrawCrosshair( void ) w = h = wi->crossHairSize; + w *= cgDC.aspectScale; + x = cg_crosshairX.integer; y = cg_crosshairY.integer; CG_AdjustFrom640( &x, &y, &w, &h ); @@ -2397,9 +2076,9 @@ static void CG_DrawCrosshairNames( rectDef_t *rect, float scale, int textStyle ) } name = cgs.clientinfo[ cg.crosshairClientNum ].name; - w = CG_Text_Width( name, scale, 0 ); + w = UI_Text_Width( name, scale, 0 ); x = rect->x + rect->w / 2; - CG_Text_Paint( x - w / 2, rect->y + rect->h, scale, color, name, 0, 0, textStyle ); + UI_Text_Paint( x - w / 2, rect->y + rect->h, scale, color, name, 0, 0, textStyle ); trap_R_SetColor( NULL ); } @@ -2842,10 +2521,10 @@ static void CG_DrawCenterString( void ) linebuffer[ l ] = 0; - w = CG_Text_Width( linebuffer, 0.5, 0 ); - h = CG_Text_Height( linebuffer, 0.5, 0 ); + w = UI_Text_Width( linebuffer, 0.5, 0 ); + h = UI_Text_Height( linebuffer, 0.5, 0 ); x = ( SCREEN_WIDTH - w ) / 2; - CG_Text_Paint( x, y + h, 0.5, color, linebuffer, 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE ); + UI_Text_Paint( x, y + h, 0.5, color, linebuffer, 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE ); y += h + 6; while( *start && ( *start != '\n' ) ) @@ -2898,7 +2577,7 @@ static void CG_DrawVote( void ) Q_strncpyz( nokey, CG_KeyBinding( "vote no" ), sizeof( nokey ) ); s = va( "VOTE(%i): \"%s\" [%s]Yes:%i [%s]No:%i", sec, cgs.voteString, yeskey, cgs.voteYes, nokey, cgs.voteNo ); - CG_Text_Paint( 8, 340, 0.3f, white, s, 0, 0, ITEM_TEXTSTYLE_NORMAL ); + UI_Text_Paint( 8, 340, 0.3f, white, s, 0, 0, ITEM_TEXTSTYLE_NORMAL ); } /* @@ -2942,7 +2621,7 @@ static void CG_DrawTeamVote( void ) yeskey, cgs.teamVoteYes[cs_offset], nokey, cgs.teamVoteNo[ cs_offset ] ); - CG_Text_Paint( 8, 360, 0.3f, white, s, 0, 0, ITEM_TEXTSTYLE_NORMAL ); + UI_Text_Paint( 8, 360, 0.3f, white, s, 0, 0, ITEM_TEXTSTYLE_NORMAL ); } @@ -3031,8 +2710,8 @@ static qboolean CG_DrawFollow( void ) strcpy( buffer, FOLLOWING_STRING ); strcat( buffer, cgs.clientinfo[ cg.snap->ps.clientNum ].name ); - w = CG_Text_Width( buffer, 0.7f, 0 ); - CG_Text_Paint( 320 - w / 2, 400, 0.7f, color, buffer, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); + w = UI_Text_Width( buffer, 0.7f, 0 ); + UI_Text_Paint( 320 - w / 2, 400, 0.7f, color, buffer, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); return qtrue; } @@ -3059,8 +2738,8 @@ static qboolean CG_DrawQueue( void ) Com_sprintf( buffer, MAX_STRING_CHARS, "You are in position %d of the spawn queue.", cg.snap->ps.persistant[ PERS_QUEUEPOS ] + 1 ); - w = CG_Text_Width( buffer, 0.7f, 0 ); - CG_Text_Paint( 320 - w / 2, 360, 0.7f, color, buffer, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); + w = UI_Text_Width( buffer, 0.7f, 0 ); + UI_Text_Paint( 320 - w / 2, 360, 0.7f, color, buffer, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); if( cg.snap->ps.stats[ STAT_PTEAM ] == PTE_ALIENS ) { @@ -3079,8 +2758,8 @@ static qboolean CG_DrawQueue( void ) cgs.numHumanSpawns ); } - w = CG_Text_Width( buffer, 0.7f, 0 ); - CG_Text_Paint( 320 - w / 2, 400, 0.7f, color, buffer, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); + w = UI_Text_Width( buffer, 0.7f, 0 ); + UI_Text_Paint( 320 - w / 2, 400, 0.7f, color, buffer, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); return qtrue; } @@ -3121,8 +2800,8 @@ static void CG_Draw2D( void ) if( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) { - w = CG_Text_Width( SPECTATOR_STRING, 0.7f, 0 ); - CG_Text_Paint( 320 - w / 2, 440, 0.7f, color, SPECTATOR_STRING, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); + w = UI_Text_Width( SPECTATOR_STRING, 0.7f, 0 ); + UI_Text_Paint( 320 - w / 2, 440, 0.7f, color, SPECTATOR_STRING, 0, 0, ITEM_TEXTSTYLE_SHADOWED ); } else menu = Menus_FindByName( BG_FindHudNameForClass( cg.predictedPlayerState.stats[ STAT_PCLASS ] ) ); diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h index 012a29ed..f70afc85 100644 --- a/src/cgame/cg_local.h +++ b/src/cgame/cg_local.h @@ -1375,6 +1375,7 @@ typedef struct extern cgs_t cgs; extern cg_t cg; extern centity_t cg_entities[ MAX_GENTITIES ]; +extern displayContextDef_t cgDC; extern weaponInfo_t cg_weapons[ 32 ]; extern upgradeInfo_t cg_upgrades[ 32 ]; @@ -1589,11 +1590,6 @@ void CG_OwnerDraw( float x, float y, float w, float h, float text_x, int align, int textalign, int textvalign, float special, float scale, vec4_t color, qhandle_t shader, int textStyle ); -void CG_Text_Paint( float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style ); -float CG_Text_Width( const char *text, float scale, int limit ); -float CG_Text_Height( const char *text, float scale, int limit ); -float CG_Text_EmWidth( float scale ); -float CG_Text_EmHeight( float scale ); float CG_GetValue(int ownerDraw); void CG_RunMenuScript(char **args); void CG_SetPrintString( int type, const char *p ); diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index 618762e3..b3452371 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -1594,7 +1594,7 @@ static float CG_Cvar_Get( const char *cvar ) void CG_Text_PaintWithCursor( float x, float y, float scale, vec4_t color, const char *text, int cursorPos, char cursor, int limit, int style ) { - CG_Text_Paint( x, y, scale, color, text, 0, limit, style ); + UI_Text_Paint( x, y, scale, color, text, 0, limit, style ); } static int CG_OwnerDrawWidth( int ownerDraw, float scale ) @@ -1602,7 +1602,7 @@ static int CG_OwnerDrawWidth( int ownerDraw, float scale ) switch( ownerDraw ) { case CG_KILLER: - return CG_Text_Width( CG_GetKillerText( ), scale, 0 ); + return UI_Text_Width( CG_GetKillerText( ), scale, 0 ); break; } @@ -1646,15 +1646,15 @@ void CG_LoadHudMenu( void ) char buff[ 1024 ]; const char *hudSet; + cgDC.aspectScale = ( ( 640.0f * cgs.glconfig.vidHeight ) / + ( 480.0f * cgs.glconfig.vidWidth ) ); + cgDC.xscale = cgs.glconfig.vidWidth / 640.0f; + cgDC.yscale = cgs.glconfig.vidHeight / 480.0f; + cgDC.registerShaderNoMip = &trap_R_RegisterShaderNoMip; cgDC.setColor = &trap_R_SetColor; cgDC.drawHandlePic = &CG_DrawPic; cgDC.drawStretchPic = &trap_R_DrawStretchPic; - cgDC.drawText = &CG_Text_Paint; - cgDC.textWidth = &CG_Text_Width; - cgDC.textHeight = &CG_Text_Height; - cgDC.textEmWidth = &CG_Text_EmWidth; - cgDC.textEmHeight = &CG_Text_EmHeight; cgDC.registerModel = &trap_R_RegisterModel; cgDC.modelBounds = &trap_R_ModelBounds; cgDC.fillRect = &CG_FillRect; @@ -1673,7 +1673,6 @@ void CG_LoadHudMenu( void ) cgDC.setCVar = trap_Cvar_Set; cgDC.getCVarString = trap_Cvar_VariableStringBuffer; cgDC.getCVarValue = CG_Cvar_Get; - cgDC.drawTextWithCursor = &CG_Text_PaintWithCursor; cgDC.setOverstrikeMode = &trap_Key_SetOverstrikeMode; cgDC.getOverstrikeMode = &trap_Key_GetOverstrikeMode; cgDC.startLocalSound = &trap_S_StartLocalSound; @@ -1748,6 +1747,11 @@ void CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum ) cgs.processedSnapshotNum = serverMessageNum; cgs.serverCommandSequence = serverCommandSequence; + // get the rendering configuration from the client system + trap_GetGlconfig( &cgs.glconfig ); + cgs.screenXScale = cgs.glconfig.vidWidth / 640.0f; + cgs.screenYScale = cgs.glconfig.vidHeight / 480.0f; + // load a few needed things before we do any screen updates cgs.media.whiteShader = trap_R_RegisterShader( "white" ); cgs.media.charsetShader = trap_R_RegisterShader( "gfx/2d/bigchars" ); @@ -1775,11 +1779,6 @@ void CG_Init( int serverMessageNum, int serverCommandSequence, int clientNum ) // old servers - // get the rendering configuration from the client system - trap_GetGlconfig( &cgs.glconfig ); - cgs.screenXScale = cgs.glconfig.vidWidth / 640.0; - cgs.screenYScale = cgs.glconfig.vidHeight / 480.0; - // get the gamestate from the client system trap_GetGameState( &cgs.gameState ); diff --git a/src/cgame/cg_scanner.c b/src/cgame/cg_scanner.c index f9175ede..067ca7fb 100644 --- a/src/cgame/cg_scanner.c +++ b/src/cgame/cg_scanner.c @@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "cg_local.h" -static entityPos_t entityPositions; +static entityPos_t entityPositions; #define HUMAN_SCANNER_UPDATE_PERIOD 700 @@ -104,8 +104,8 @@ void CG_UpdateEntityPositions( void ) } } -#define STALKWIDTH 2.0f -#define BLIPX 16.0f +#define STALKWIDTH (2.0f * cgDC.aspectScale) +#define BLIPX (16.0f * cgDC.aspectScale) #define BLIPY 8.0f #define FAR_ALPHA 0.8f #define NEAR_ALPHA 1.2f @@ -162,7 +162,7 @@ static void CG_DrawBlips( rectDef_t *rect, vec3_t origin, vec4_t colour ) trap_R_SetColor( NULL ); } -#define BLIPX2 24.0f +#define BLIPX2 (24.0f * cgDC.aspectScale) #define BLIPY2 24.0f /* diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c index 613cddb2..fc8dc058 100644 --- a/src/cgame/cg_weapons.c +++ b/src/cgame/cg_weapons.c @@ -1140,11 +1140,12 @@ CG_DrawItemSelect void CG_DrawItemSelect( rectDef_t *rect, vec4_t color ) { int i; - int x = rect->x; - int y = rect->y; - int width = rect->w; - int height = rect->h; - int iconsize; + float x = rect->x; + float y = rect->y; + float width = rect->w; + float height = rect->h; + float iconWidth; + float iconHeight; int items[ 64 ]; int numItems = 0, selectedItem = 0; int length; @@ -1177,14 +1178,16 @@ void CG_DrawItemSelect( rectDef_t *rect, vec4_t color ) if( height > width ) { vertical = qtrue; - iconsize = width; - length = height / width; + iconWidth = width * cgDC.aspectScale; + iconHeight = width; + length = height / ( width * cgDC.aspectScale ); } else if( height <= width ) { vertical = qfalse; - iconsize = height; - length = width / height; + iconWidth = height * cgDC.aspectScale; + iconHeight = height; + length = width / ( height * cgDC.aspectScale ); } selectWindow = length / 2; @@ -1248,17 +1251,17 @@ void CG_DrawItemSelect( rectDef_t *rect, vec4_t color ) trap_R_SetColor( color ); if( items[ item ] <= 32 ) - CG_DrawPic( x, y, iconsize, iconsize, cg_weapons[ items[ item ] ].weaponIcon ); + CG_DrawPic( x, y, iconWidth, iconHeight, cg_weapons[ items[ item ] ].weaponIcon ); else if( items[ item ] > 32 ) - CG_DrawPic( x, y, iconsize, iconsize, cg_upgrades[ items[ item ] - 32 ].upgradeIcon ); + CG_DrawPic( x, y, iconWidth, iconHeight, cg_upgrades[ items[ item ] - 32 ].upgradeIcon ); trap_R_SetColor( NULL ); } if( vertical ) - y += iconsize; + y += iconHeight; else - x += iconsize; + x += iconWidth; } } @@ -1288,9 +1291,9 @@ void CG_DrawItemSelectText( rectDef_t *rect, float scale, int textStyle ) { if( ( name = cg_weapons[ cg.weaponSelect ].humanName ) ) { - w = CG_Text_Width( name, scale, 0 ); + w = UI_Text_Width( name, scale, 0 ); x = rect->x + rect->w / 2; - CG_Text_Paint( x - w / 2, rect->y + rect->h, scale, color, name, 0, 0, textStyle ); + UI_Text_Paint( x - w / 2, rect->y + rect->h, scale, color, name, 0, 0, textStyle ); } } } @@ -1301,9 +1304,9 @@ void CG_DrawItemSelectText( rectDef_t *rect, float scale, int textStyle ) { if( ( name = cg_upgrades[ cg.weaponSelect - 32 ].humanName ) ) { - w = CG_Text_Width( name, scale, 0 ); + w = UI_Text_Width( name, scale, 0 ); x = rect->x + rect->w / 2; - CG_Text_Paint( x - w / 2, rect->y + rect->h, scale, color, name, 0, 0, textStyle ); + UI_Text_Paint( x - w / 2, rect->y + rect->h, scale, color, name, 0, 0, textStyle ); } } } diff --git a/src/sys/win_resource.rc b/src/sys/win_resource.rc index 2527af2f..6f5d82ac 100644 --- a/src/sys/win_resource.rc +++ b/src/sys/win_resource.rc @@ -7,11 +7,7 @@ // // Generated from the TEXTINCLUDE 2 resource. // -#ifndef __MINGW32__ -#include "winres.h" -#else #include <winresrc.h> -#endif ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -58,7 +54,6 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_ICON1 ICON DISCARDABLE "misc/tremulous.ico" -#endif ///////////////////////////////////////////////////////////////////////////// diff --git a/src/ui/ui_atoms.c b/src/ui/ui_atoms.c index d2bb6b26..7d9185f7 100644 --- a/src/ui/ui_atoms.c +++ b/src/ui/ui_atoms.c @@ -412,29 +412,6 @@ UI_Shutdown void UI_Shutdown( void ) { } -/* -================ -UI_AdjustFrom640 - -Adjusted for resolution and screen aspect ratio -================ -*/ -void UI_AdjustFrom640( float *x, float *y, float *w, float *h ) { - // expect valid pointers -#if 0 - *x = *x * uiInfo.uiDC.scale + uiInfo.uiDC.bias; - *y *= uiInfo.uiDC.scale; - *w *= uiInfo.uiDC.scale; - *h *= uiInfo.uiDC.scale; -#endif - - *x *= uiInfo.uiDC.xscale; - *y *= uiInfo.uiDC.yscale; - *w *= uiInfo.uiDC.xscale; - *h *= uiInfo.uiDC.yscale; - -} - void UI_DrawNamedPic( float x, float y, float width, float height, const char *picname ) { qhandle_t hShader; diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 7618c211..25462a86 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -244,370 +244,6 @@ void _UI_DrawRect( float x, float y, float width, float height, float size, cons trap_R_SetColor( NULL ); } - - - -float Text_Width(const char *text, float scale, int limit) { - int count,len; - float out; - glyphInfo_t *glyph; - float useScale; - const char *s = text; - fontInfo_t *font = &uiInfo.uiDC.Assets.textFont; - if (scale <= ui_smallFont.value) { - font = &uiInfo.uiDC.Assets.smallFont; - } else if (scale >= ui_bigFont.value) { - font = &uiInfo.uiDC.Assets.bigFont; - } - useScale = scale * font->glyphScale; - out = 0; - if (text) { - len = Q_PrintStrlen( text ); - if (limit > 0 && len > limit) { - len = limit; - } - count = 0; - while (s && *s && count < len) { - if ( Q_IsColorString(s) ) { - s += 2; - continue; - } else { - glyph = &font->glyphs[(int)*s]; - out += glyph->xSkip; - s++; - count++; - } - } - } - return out * useScale; -} - -float Text_Height(const char *text, float scale, int limit) { - int len, count; - float max; - glyphInfo_t *glyph; - float useScale; - const char *s = text; - fontInfo_t *font = &uiInfo.uiDC.Assets.textFont; - if (scale <= ui_smallFont.value) { - font = &uiInfo.uiDC.Assets.smallFont; - } else if (scale >= ui_bigFont.value) { - font = &uiInfo.uiDC.Assets.bigFont; - } - useScale = scale * font->glyphScale; - max = 0; - if (text) { - len = strlen(text); - if (limit > 0 && len > limit) { - len = limit; - } - count = 0; - while (s && *s && count < len) { - if ( Q_IsColorString(s) ) { - s += 2; - continue; - } else { - glyph = &font->glyphs[(int)*s]; - if (max < glyph->height) { - max = glyph->height; - } - s++; - count++; - } - } - } - return max * useScale; -} - -float Text_EmWidth( float scale ) -{ - return Text_Width( "M", scale, 0 ); -} - -float Text_EmHeight( float scale ) -{ - return Text_Height( "M", scale, 0 ); -} - -void Text_PaintChar(float x, float y, float width, float height, float scale, float s, float t, float s2, float t2, qhandle_t hShader) { - float w, h; - w = width * scale; - h = height * scale; - UI_AdjustFrom640( &x, &y, &w, &h ); - trap_R_DrawStretchPic( x, y, w, h, s, t, s2, t2, hShader ); -} - -void Text_Paint(float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style) { - int len, count; - vec4_t newColor; - glyphInfo_t *glyph; - float useScale; - fontInfo_t *font = &uiInfo.uiDC.Assets.textFont; - if (scale <= ui_smallFont.value) { - font = &uiInfo.uiDC.Assets.smallFont; - } else if (scale >= ui_bigFont.value) { - font = &uiInfo.uiDC.Assets.bigFont; - } - useScale = scale * font->glyphScale; - if (text) { - const char *s = text; - trap_R_SetColor( color ); - memcpy(&newColor[0], &color[0], sizeof(vec4_t)); - len = strlen(text); - if (limit > 0 && len > limit) { - len = limit; - } - count = 0; - while (s && *s && count < len) { - glyph = &font->glyphs[(int)*s]; - if ( Q_IsColorString( s ) ) { - memcpy( newColor, g_color_table[ColorIndex(*(s+1))], sizeof( newColor ) ); - newColor[3] = color[3]; - trap_R_SetColor( newColor ); - s += 2; - continue; - } else { - float yadj = useScale * glyph->top; - if (style == ITEM_TEXTSTYLE_SHADOWED || style == ITEM_TEXTSTYLE_SHADOWEDMORE) { - int ofs = style == ITEM_TEXTSTYLE_SHADOWED ? 1 : 2; - colorBlack[3] = newColor[3]; - trap_R_SetColor( colorBlack ); - Text_PaintChar(x + ofs, y - yadj + ofs, - glyph->imageWidth, - glyph->imageHeight, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph); - trap_R_SetColor( newColor ); - colorBlack[3] = 1.0; - } - else if( style == ITEM_TEXTSTYLE_NEON ) - { - vec4_t glow, outer, inner, white; - - glow[ 0 ] = newColor[ 0 ] * 0.5; - glow[ 1 ] = newColor[ 1 ] * 0.5; - glow[ 2 ] = newColor[ 2 ] * 0.5; - glow[ 3 ] = newColor[ 3 ] * 0.2; - - outer[ 0 ] = newColor[ 0 ]; - outer[ 1 ] = newColor[ 1 ]; - outer[ 2 ] = newColor[ 2 ]; - outer[ 3 ] = newColor[ 3 ]; - - inner[ 0 ] = newColor[ 0 ] * 1.5 > 1.0f ? 1.0f : newColor[ 0 ] * 1.5; - inner[ 1 ] = newColor[ 1 ] * 1.5 > 1.0f ? 1.0f : newColor[ 1 ] * 1.5; - inner[ 2 ] = newColor[ 2 ] * 1.5 > 1.0f ? 1.0f : newColor[ 2 ] * 1.5; - inner[ 3 ] = newColor[ 3 ]; - - white[ 0 ] = white[ 1 ] = white[ 2 ] = white[ 3 ] = 1.0f; - - trap_R_SetColor( glow ); - Text_PaintChar( x - 1.5, y - yadj - 1.5, - glyph->imageWidth + 3, - glyph->imageHeight + 3, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph ); - - trap_R_SetColor( outer ); - Text_PaintChar( x - 1, y - yadj - 1, - glyph->imageWidth + 2, - glyph->imageHeight + 2, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph ); - - trap_R_SetColor( inner ); - Text_PaintChar( x - 0.5, y - yadj - 0.5, - glyph->imageWidth + 1, - glyph->imageHeight + 1, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph ); - - trap_R_SetColor( white ); - } - - Text_PaintChar(x, y - yadj, - glyph->imageWidth, - glyph->imageHeight, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph); - - x += (glyph->xSkip * useScale) + adjust; - s++; - count++; - } - } - trap_R_SetColor( NULL ); - } -} - -//FIXME: merge this with Text_Paint, somehow -void Text_PaintWithCursor(float x, float y, float scale, vec4_t color, const char *text, int cursorPos, char cursor, int limit, int style) { - int len, count; - vec4_t newColor; - glyphInfo_t *glyph, *glyph2; - float yadj; - float useScale; - fontInfo_t *font = &uiInfo.uiDC.Assets.textFont; - if (scale <= ui_smallFont.value) { - font = &uiInfo.uiDC.Assets.smallFont; - } else if (scale >= ui_bigFont.value) { - font = &uiInfo.uiDC.Assets.bigFont; - } - useScale = scale * font->glyphScale; - if (text) { - const char *s = text; - trap_R_SetColor( color ); - memcpy(&newColor[0], &color[0], sizeof(vec4_t)); - len = strlen(text); - if (limit > 0 && len > limit) { - len = limit; - } - count = 0; - glyph2 = &font->glyphs[ (int) cursor]; - while (s && *s && count < len) { - glyph = &font->glyphs[(int)*s]; - yadj = useScale * glyph->top; - if (style == ITEM_TEXTSTYLE_SHADOWED || style == ITEM_TEXTSTYLE_SHADOWEDMORE) { - int ofs = style == ITEM_TEXTSTYLE_SHADOWED ? 1 : 2; - colorBlack[3] = newColor[3]; - trap_R_SetColor( colorBlack ); - Text_PaintChar(x + ofs, y - yadj + ofs, - glyph->imageWidth, - glyph->imageHeight, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph); - colorBlack[3] = 1.0; - trap_R_SetColor( newColor ); - } - else if( style == ITEM_TEXTSTYLE_NEON ) - { - vec4_t glow, outer, inner, white; - - glow[ 0 ] = newColor[ 0 ] * 0.5; - glow[ 1 ] = newColor[ 1 ] * 0.5; - glow[ 2 ] = newColor[ 2 ] * 0.5; - glow[ 3 ] = newColor[ 3 ] * 0.2; - - outer[ 0 ] = newColor[ 0 ]; - outer[ 1 ] = newColor[ 1 ]; - outer[ 2 ] = newColor[ 2 ]; - outer[ 3 ] = newColor[ 3 ]; - - inner[ 0 ] = newColor[ 0 ] * 1.5 > 1.0f ? 1.0f : newColor[ 0 ] * 1.5; - inner[ 1 ] = newColor[ 1 ] * 1.5 > 1.0f ? 1.0f : newColor[ 1 ] * 1.5; - inner[ 2 ] = newColor[ 2 ] * 1.5 > 1.0f ? 1.0f : newColor[ 2 ] * 1.5; - inner[ 3 ] = newColor[ 3 ]; - - white[ 0 ] = white[ 1 ] = white[ 2 ] = white[ 3 ] = 1.0f; - - trap_R_SetColor( glow ); - Text_PaintChar( x - 1.5, y - yadj - 1.5, - glyph->imageWidth + 3, - glyph->imageHeight + 3, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph ); - - trap_R_SetColor( outer ); - Text_PaintChar( x - 1, y - yadj - 1, - glyph->imageWidth + 2, - glyph->imageHeight + 2, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph ); - - trap_R_SetColor( inner ); - Text_PaintChar( x - 0.5, y - yadj - 0.5, - glyph->imageWidth + 1, - glyph->imageHeight + 1, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph ); - - trap_R_SetColor( white ); - } - - Text_PaintChar(x, y - yadj, - glyph->imageWidth, - glyph->imageHeight, - useScale, - glyph->s, - glyph->t, - glyph->s2, - glyph->t2, - glyph->glyph); - - yadj = useScale * glyph2->top; - if (count == cursorPos && !((uiInfo.uiDC.realTime/BLINK_DIVISOR) & 1)) { - Text_PaintChar(x, y - yadj, - glyph2->imageWidth, - glyph2->imageHeight, - useScale, - glyph2->s, - glyph2->t, - glyph2->s2, - glyph2->t2, - glyph2->glyph); - } - - x += (glyph->xSkip * useScale); - s++; - count++; - } - // need to paint cursor at end of text - if (cursorPos == len && !((uiInfo.uiDC.realTime/BLINK_DIVISOR) & 1)) { - yadj = useScale * glyph2->top; - Text_PaintChar(x, y - yadj, - glyph2->imageWidth, - glyph2->imageHeight, - useScale, - glyph2->s, - glyph2->t, - glyph2->s2, - glyph2->t2, - glyph2->glyph); - - } - - - trap_R_SetColor( NULL ); - } -} - - void UI_ShowPostGame(qboolean newHigh) { trap_Cvar_Set ("cg_cameraOrbit", "0"); trap_Cvar_Set("cg_thirdPerson", "0"); @@ -676,20 +312,11 @@ void _UI_Refresh( int realtime ) // draw cursor UI_SetColor( NULL ); - - // don't draw the cursor whilst loading if( Menu_Count( ) > 0 && !trap_Cvar_VariableValue( "ui_hideCursor" ) ) - UI_DrawHandlePic( uiInfo.uiDC.cursorx-16, uiInfo.uiDC.cursory-16, 32, 32, uiInfo.uiDC.Assets.cursor); - -#ifndef NDEBUG - if (uiInfo.uiDC.debug) { - // cursor coordinates - //FIXME - //UI_DrawString( 0, 0, va("(%d,%d)",uis.cursorx,uis.cursory), UI_LEFT|UI_SMALLFONT, colorRed ); + UI_DrawHandlePic( uiInfo.uiDC.cursorx - ( 16.0f * uiInfo.uiDC.aspectScale ), uiInfo.uiDC.cursory - 16.0f, + 32.0f * uiInfo.uiDC.aspectScale, 32.0f, uiInfo.uiDC.Assets.cursor); } -#endif - } /* @@ -1035,11 +662,11 @@ static void UI_DrawHandicap(rectDef_t *rect, float scale, vec4_t color, int text h = Com_Clamp( 5, 100, trap_Cvar_VariableValue("handicap") ); i = 20 - h / 5; - Text_Paint(rect->x, rect->y, scale, color, handicapValues[i], 0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, handicapValues[i], 0, 0, textStyle); } static void UI_DrawClanName(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - Text_Paint(rect->x, rect->y, scale, color, UI_Cvar_VariableString("ui_teamName"), 0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, UI_Cvar_VariableString("ui_teamName"), 0, 0, textStyle); } @@ -1056,7 +683,7 @@ static void UI_SetCapFragLimits(qboolean uiVars) { } // ui_gameType assumes gametype 0 is -1 ALL and will not show static void UI_DrawGameType(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - Text_Paint(rect->x, rect->y, scale, color, uiInfo.gameTypes[ui_gameType.integer].gameType, 0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, uiInfo.gameTypes[ui_gameType.integer].gameType, 0, 0, textStyle); } static void UI_DrawNetGameType(rectDef_t *rect, float scale, vec4_t color, int textStyle) { @@ -1064,14 +691,14 @@ static void UI_DrawNetGameType(rectDef_t *rect, float scale, vec4_t color, int t trap_Cvar_Set("ui_netGameType", "0"); trap_Cvar_Set("ui_actualNetGameType", "0"); } - Text_Paint(rect->x, rect->y, scale, color, uiInfo.gameTypes[ui_netGameType.integer].gameType , 0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, uiInfo.gameTypes[ui_netGameType.integer].gameType , 0, 0, textStyle); } static void UI_DrawJoinGameType(rectDef_t *rect, float scale, vec4_t color, int textStyle) { if (ui_joinGameType.integer < 0 || ui_joinGameType.integer > uiInfo.numJoinGameTypes) { trap_Cvar_Set("ui_joinGameType", "0"); } - Text_Paint(rect->x, rect->y, scale, color, uiInfo.joinGameTypes[ui_joinGameType.integer].gameType , 0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, uiInfo.joinGameTypes[ui_joinGameType.integer].gameType , 0, 0, textStyle); } @@ -1261,7 +888,7 @@ static void UI_DrawSkill(rectDef_t *rect, float scale, vec4_t color, int textSty if (i < 1 || i > numSkillLevels) { i = 1; } - Text_Paint(rect->x, rect->y, scale, color, skillLevels[i-1],0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, skillLevels[i-1],0, 0, textStyle); } @@ -1269,7 +896,7 @@ static void UI_DrawTeamName(rectDef_t *rect, float scale, vec4_t color, qboolean int i; i = UI_TeamIndexFromName(UI_Cvar_VariableString((blue) ? "ui_blueTeam" : "ui_redTeam")); if (i >= 0 && i < uiInfo.teamCount) { - Text_Paint(rect->x, rect->y, scale, color, va("%s: %s", (blue) ? "Blue" : "Red", uiInfo.teamList[i].teamName),0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, va("%s: %s", (blue) ? "Blue" : "Red", uiInfo.teamList[i].teamName),0, 0, textStyle); } } @@ -1291,7 +918,7 @@ static void UI_DrawTeamMember(rectDef_t *rect, float scale, vec4_t color, qboole text = UI_GetBotNameByNumber(value); } - Text_Paint(rect->x, rect->y, scale, color, text, 0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, text, 0, 0, textStyle); } static void UI_DrawMapPreview(rectDef_t *rect, float scale, vec4_t color, qboolean net) { @@ -1331,7 +958,7 @@ static void UI_DrawMapTimeToBeat(rectDef_t *rect, float scale, vec4_t color, int minutes = time / 60; seconds = time % 60; - Text_Paint(rect->x, rect->y, scale, color, va("%02i:%02i", minutes, seconds), 0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, va("%02i:%02i", minutes, seconds), 0, 0, textStyle); } @@ -1445,7 +1072,7 @@ static void UI_DrawTier(rectDef_t *rect, float scale, vec4_t color, int textStyl if (i < 0 || i >= uiInfo.tierCount) { i = 0; } - Text_Paint(rect->x, rect->y, scale, color, va("Tier: %s", uiInfo.tierList[i].tierName),0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, va("Tier: %s", uiInfo.tierList[i].tierName),0, 0, textStyle); } static void UI_DrawTierMap(rectDef_t *rect, int index) { @@ -1483,7 +1110,7 @@ static void UI_DrawTierMapName(rectDef_t *rect, float scale, vec4_t color, int t j = 0; } - Text_Paint(rect->x, rect->y, scale, color, UI_EnglishMapName(uiInfo.tierList[i].maps[j]), 0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, UI_EnglishMapName(uiInfo.tierList[i].maps[j]), 0, 0, textStyle); } static void UI_DrawTierGameType(rectDef_t *rect, float scale, vec4_t color, int textStyle) { @@ -1497,7 +1124,7 @@ static void UI_DrawTierGameType(rectDef_t *rect, float scale, vec4_t color, int j = 0; } - Text_Paint(rect->x, rect->y, scale, color, uiInfo.gameTypes[uiInfo.tierList[i].gameTypes[j]].gameType , 0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, uiInfo.gameTypes[uiInfo.tierList[i].gameTypes[j]].gameType , 0, 0, textStyle); } @@ -1655,7 +1282,7 @@ static void UI_DrawOpponentLogoName(rectDef_t *rect, vec3_t color) { static void UI_DrawAllMapsSelection(rectDef_t *rect, float scale, vec4_t color, int textStyle, qboolean net) { int map = (net) ? ui_currentNetMap.integer : ui_currentMap.integer; if (map >= 0 && map < uiInfo.mapCount) { - Text_Paint(rect->x, rect->y, scale, color, uiInfo.mapList[map].mapName, 0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, uiInfo.mapList[map].mapName, 0, 0, textStyle); } } @@ -1664,7 +1291,7 @@ static void UI_DrawPlayerListSelection( rectDef_t *rect, float scale, { if( uiInfo.playerIndex >= 0 && uiInfo.playerIndex < uiInfo.playerCount ) { - Text_Paint(rect->x, rect->y, scale, color, + UI_Text_Paint(rect->x, rect->y, scale, color, uiInfo.rawPlayerNames[ uiInfo.playerIndex ], 0, 0, textStyle); } @@ -1675,14 +1302,14 @@ static void UI_DrawTeamListSelection( rectDef_t *rect, float scale, { if( uiInfo.teamIndex >= 0 && uiInfo.teamIndex < uiInfo.myTeamCount ) { - Text_Paint(rect->x, rect->y, scale, color, + UI_Text_Paint(rect->x, rect->y, scale, color, uiInfo.rawTeamNames[ uiInfo.teamIndex ], 0, 0, textStyle); } } static void UI_DrawOpponentName(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - Text_Paint(rect->x, rect->y, scale, color, UI_Cvar_VariableString("ui_opponentName"), 0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, UI_Cvar_VariableString("ui_opponentName"), 0, 0, textStyle); } static const char *UI_OwnerDrawText(int ownerDraw) { @@ -1844,7 +1471,7 @@ static int UI_OwnerDrawWidth(int ownerDraw, float scale) { } if (s) { - return Text_Width(s, scale, 0); + return UI_Text_Width(s, scale, 0); } return 0; } @@ -1858,17 +1485,17 @@ static void UI_DrawBotName(rectDef_t *rect, float scale, vec4_t color, int textS text = UI_GetBotNameByNumber( value ); - Text_Paint(rect->x, rect->y, scale, color, text, 0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, text, 0, 0, textStyle); } static void UI_DrawBotSkill(rectDef_t *rect, float scale, vec4_t color, int textStyle) { if (uiInfo.skillIndex >= 0 && uiInfo.skillIndex < numSkillLevels) { - Text_Paint(rect->x, rect->y, scale, color, skillLevels[uiInfo.skillIndex], 0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, skillLevels[uiInfo.skillIndex], 0, 0, textStyle); } } static void UI_DrawRedBlue(rectDef_t *rect, float scale, vec4_t color, int textStyle) { - Text_Paint(rect->x, rect->y, scale, color, (uiInfo.redBlue == 0) ? "Red" : "Blue", 0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, (uiInfo.redBlue == 0) ? "Red" : "Blue", 0, 0, textStyle); } /* @@ -1950,7 +1577,7 @@ static void UI_DrawSelectedPlayer(rectDef_t *rect, float scale, vec4_t color, in else s = UI_Cvar_VariableString("name"); Q_strncpyz( name, s, sizeof( name ) ); - Text_Paint(rect->x, rect->y, scale, color, name, 0, 0, textStyle); + UI_Text_Paint(rect->x, rect->y, scale, color, name, 0, 0, textStyle); } static void UI_DrawGLInfo( rectDef_t *rect, float scale, int textalign, int textvalign, @@ -5179,28 +4806,17 @@ void _UI_Init( qboolean inGameLoad ) { trap_GetGlconfig( &uiInfo.uiDC.glconfig ); // for 640x480 virtualized screen - uiInfo.uiDC.yscale = uiInfo.uiDC.glconfig.vidHeight * (1.0/480.0); - uiInfo.uiDC.xscale = uiInfo.uiDC.glconfig.vidWidth * (1.0/640.0); - if ( uiInfo.uiDC.glconfig.vidWidth * 480 > uiInfo.uiDC.glconfig.vidHeight * 640 ) { - // wide screen - uiInfo.uiDC.bias = 0.5 * ( uiInfo.uiDC.glconfig.vidWidth - ( uiInfo.uiDC.glconfig.vidHeight * (640.0/480.0) ) ); - } - else { - // no wide screen - uiInfo.uiDC.bias = 0; - } + uiInfo.uiDC.yscale = uiInfo.uiDC.glconfig.vidHeight * ( 1.0f / 480.0f ); + uiInfo.uiDC.xscale = uiInfo.uiDC.glconfig.vidWidth * ( 1.0f / 640.0f ); + // wide screen + uiInfo.uiDC.aspectScale = ( ( 640.0f * uiInfo.uiDC.glconfig.vidHeight ) / + ( 480.0f * uiInfo.uiDC.glconfig.vidWidth ) ); - //UI_Load(); uiInfo.uiDC.registerShaderNoMip = &trap_R_RegisterShaderNoMip; uiInfo.uiDC.setColor = &UI_SetColor; uiInfo.uiDC.drawHandlePic = &UI_DrawHandlePic; uiInfo.uiDC.drawStretchPic = &trap_R_DrawStretchPic; - uiInfo.uiDC.drawText = &Text_Paint; - uiInfo.uiDC.textWidth = &Text_Width; - uiInfo.uiDC.textHeight = &Text_Height; - uiInfo.uiDC.textEmWidth = &Text_EmWidth; - uiInfo.uiDC.textEmHeight = &Text_EmHeight; uiInfo.uiDC.registerModel = &trap_R_RegisterModel; uiInfo.uiDC.modelBounds = &trap_R_ModelBounds; uiInfo.uiDC.fillRect = &UI_FillRect; @@ -5220,7 +4836,6 @@ void _UI_Init( qboolean inGameLoad ) { uiInfo.uiDC.setCVar = trap_Cvar_Set; uiInfo.uiDC.getCVarString = trap_Cvar_VariableStringBuffer; uiInfo.uiDC.getCVarValue = trap_Cvar_VariableValue; - uiInfo.uiDC.drawTextWithCursor = &Text_PaintWithCursor; uiInfo.uiDC.setOverstrikeMode = &trap_Key_SetOverstrikeMode; uiInfo.uiDC.getOverstrikeMode = &trap_Key_GetOverstrikeMode; uiInfo.uiDC.startLocalSound = &trap_S_StartLocalSound; @@ -5324,7 +4939,7 @@ UI_MouseEvent void _UI_MouseEvent( int dx, int dy ) { // update mouse screen position - uiInfo.uiDC.cursorx += dx; + uiInfo.uiDC.cursorx += ( dx * uiInfo.uiDC.aspectScale ); if (uiInfo.uiDC.cursorx < 0) uiInfo.uiDC.cursorx = 0; else if (uiInfo.uiDC.cursorx > SCREEN_WIDTH) @@ -5451,8 +5066,8 @@ static void UI_PrintTime ( char *buf, int bufsize, int time ) { } void Text_PaintCenter(float x, float y, float scale, vec4_t color, const char *text, float adjust) { - int len = Text_Width(text, scale, 0); - Text_Paint(x - len / 2, y, scale, color, text, 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE); + int len = UI_Text_Width(text, scale, 0); + UI_Text_Paint(x - len / 2, y, scale, color, text, 0, 0, ITEM_TEXTSTYLE_SHADOWEDMORE); } void Text_PaintCenter_AutoWrapped(float x, float y, float xmax, float ystep, float scale, vec4_t color, const char *str, float adjust) { @@ -5473,7 +5088,7 @@ void Text_PaintCenter_AutoWrapped(float x, float y, float xmax, float ystep, flo } while (*s3!=' ' && *s3!='\0'); c_bcp = *s3; *s3 = '\0'; - width = Text_Width(s1, scale, 0); + width = UI_Text_Width(s1, scale, 0); *s3 = c_bcp; if (width > xmax) { if (s1==s2) diff --git a/src/ui/ui_shared.c b/src/ui/ui_shared.c index ec6a07eb..52aa1fc4 100644 --- a/src/ui/ui_shared.c +++ b/src/ui/ui_shared.c @@ -1058,6 +1058,59 @@ void Menu_UpdatePosition(menuDef_t *menu) { } } +static void Menu_AspectiseRect( int bias, Rectangle *rect ) +{ + switch( bias ) + { + case ALIGN_LEFT: + rect->x *= DC->aspectScale; + rect->w *= DC->aspectScale; + break; + + case ALIGN_CENTER: + rect->x = ( rect->x * DC->aspectScale ) + + ( 320.0f - ( 320.0f * DC->aspectScale ) ); + rect->w *= DC->aspectScale; + break; + + case ALIGN_RIGHT: + rect->x = 640.0f - ( ( 640.0f - rect->x ) * DC->aspectScale ); + rect->w *= DC->aspectScale; + break; + + default: + case ASPECT_NONE: + break; + } +} + +void Menu_AspectCompensate( menuDef_t *menu ) +{ + int i; + + if( menu->window.aspectBias != ASPECT_NONE ) + { + Menu_AspectiseRect( menu->window.aspectBias, &menu->window.rect ); + + for( i = 0; i < menu->itemCount; i++ ) + { + menu->items[ i ]->window.rectClient.x *= DC->aspectScale; + menu->items[ i ]->window.rectClient.w *= DC->aspectScale; + menu->items[ i ]->textalignx *= DC->aspectScale; + } + } + else + { + for( i = 0; i < menu->itemCount; i++ ) + { + Menu_AspectiseRect( menu->items[ i ]->window.aspectBias, + &menu->items[ i ]->window.rectClient ); + if( menu->items[ i ]->window.aspectBias != ASPECT_NONE ) + menu->items[ i ]->textalignx *= DC->aspectScale; + } + } +} + void Menu_PostParse(menuDef_t *menu) { if (menu == NULL) { return; @@ -1068,6 +1121,7 @@ void Menu_PostParse(menuDef_t *menu) { menu->window.rect.w = 640; menu->window.rect.h = 480; } + Menu_AspectCompensate( menu ); Menu_UpdatePosition(menu); } @@ -1485,6 +1539,27 @@ void Script_SetFocus(itemDef_t *item, char **args) { } } +void Script_Reset( itemDef_t *item, char **args ) +{ + const char *name; + itemDef_t *resetItem; + + if( String_Parse( args, &name ) ) + { + resetItem = Menu_FindItemByName( item->parent, name ); + if( resetItem ) + { + if( resetItem->type == ITEM_TYPE_LISTBOX ) + { + listBoxDef_t *listPtr = (listBoxDef_t*)resetItem->typeData; + resetItem->cursorPos = 0; + listPtr->startPos = 0; + DC->feederSelection( resetItem->special, 0 ); + } + } + } +} + void Script_SetPlayerModel(itemDef_t *item, char **args) { const char *name; if (String_Parse(args, &name)) { @@ -1529,6 +1604,467 @@ void Script_playLooped(itemDef_t *item, char **args) { } } +float UI_Text_Width(const char *text, float scale, int limit) { + int count,len; + float out; + glyphInfo_t *glyph; + float useScale; + const char *s = text; + fontInfo_t *font = &DC->Assets.textFont; + if (scale <= DC->getCVarValue( "ui_smallFont" )) { + font = &DC->Assets.smallFont; + } else if (scale >= DC->getCVarValue( "ui_bigFont" )) { + font = &DC->Assets.bigFont; + } + useScale = scale * font->glyphScale; + out = 0; + if (text) { + len = Q_PrintStrlen( text ); + if (limit > 0 && len > limit) { + len = limit; + } + count = 0; + while (s && *s && count < len) { + if ( Q_IsColorString(s) ) { + s += 2; + continue; + } else { + glyph = &font->glyphs[(int)*s]; + out += ( glyph->xSkip * DC->aspectScale ); + s++; + count++; + } + } + } + return out * useScale; +} + +float UI_Text_Height(const char *text, float scale, int limit) { + int len, count; + float max; + glyphInfo_t *glyph; + float useScale; + const char *s = text; + fontInfo_t *font = &DC->Assets.textFont; + if (scale <= DC->getCVarValue( "ui_smallFont" )) { + font = &DC->Assets.smallFont; + } else if (scale >= DC->getCVarValue( "ui_bigFont" )) { + font = &DC->Assets.bigFont; + } + useScale = scale * font->glyphScale; + max = 0; + if (text) { + len = strlen(text); + if (limit > 0 && len > limit) { + len = limit; + } + count = 0; + while (s && *s && count < len) { + if ( Q_IsColorString(s) ) { + s += 2; + continue; + } else { + glyph = &font->glyphs[(int)*s]; + if (max < glyph->height) { + max = glyph->height; + } + s++; + count++; + } + } + } + return max * useScale; +} + +float UI_Text_EmWidth( float scale ) +{ + return UI_Text_Width( "M", scale, 0 ); +} + +float UI_Text_EmHeight( float scale ) +{ + return UI_Text_Height( "M", scale, 0 ); +} + + +/* +================ +UI_AdjustFrom640 + +Adjusted for resolution and screen aspect ratio +================ +*/ +void UI_AdjustFrom640( float *x, float *y, float *w, float *h ) { + *x *= DC->xscale; + *y *= DC->yscale; + *w *= DC->xscale; + *h *= DC->yscale; +} + +static void UI_Text_PaintChar(float x, float y, float width, float height, float scale, float s, float t, float s2, float t2, qhandle_t hShader) { + float w, h; + w = width * scale; + h = height * scale; + UI_AdjustFrom640( &x, &y, &w, &h ); + DC->drawStretchPic( x, y, w, h, s, t, s2, t2, hShader ); +} + +void UI_Text_Paint_Limit( float *maxX, float x, float y, float scale, + vec4_t color, const char* text, float adjust, int limit ) +{ + int len, count; + vec4_t newColor; + glyphInfo_t *glyph; + + if( text ) + { + const char *s = text; + float max = *maxX; + float useScale; + fontInfo_t *font = &DC->Assets.textFont; + + if( scale <= DC->getCVarValue( "ui_smallFont" ) ) + font = &DC->Assets.smallFont; + else if( scale > DC->getCVarValue( "ui_bigFont" ) ) + font = &DC->Assets.bigFont; + + useScale = scale * font->glyphScale; + DC->setColor( color ); + len = strlen( text ); + + if( limit > 0 && len > limit ) + len = limit; + + count = 0; + + while( s && *s && count < len ) + { + float width, height, skip; + glyph = &font->glyphs[ (int)*s ]; + width = glyph->imageWidth * DC->aspectScale; + height = glyph->imageHeight; + skip = glyph->xSkip * DC->aspectScale; + + if( Q_IsColorString( s ) ) + { + memcpy( newColor, g_color_table[ ColorIndex( *(s+1) ) ], sizeof( newColor ) ); + newColor[ 3 ] = color[ 3 ]; + DC->setColor( newColor ); + s += 2; + continue; + } + else + { + float yadj = useScale * glyph->top; + + if( UI_Text_Width( s, useScale, 1 ) + x > max ) + { + *maxX = 0; + break; + } + + UI_Text_PaintChar( x, y - yadj, + width, + height, + useScale, + glyph->s, + glyph->t, + glyph->s2, + glyph->t2, + glyph->glyph ); + x += ( skip * useScale ) + adjust; + *maxX = x; + count++; + s++; + } + } + + DC->setColor( NULL ); + } +} + +void UI_Text_Paint(float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style) { + int len, count; + vec4_t newColor; + glyphInfo_t *glyph; + float useScale; + fontInfo_t *font = &DC->Assets.textFont; + if (scale <= DC->getCVarValue( "ui_smallFont" )) { + font = &DC->Assets.smallFont; + } else if (scale >= DC->getCVarValue( "ui_bigFont" )) { + font = &DC->Assets.bigFont; + } + useScale = scale * font->glyphScale; + if (text) { + const char *s = text; + DC->setColor( color ); + memcpy(&newColor[0], &color[0], sizeof(vec4_t)); + len = strlen(text); + if (limit > 0 && len > limit) { + len = limit; + } + count = 0; + while (s && *s && count < len) { + float width, height, skip; + glyph = &font->glyphs[(int)*s]; + width = glyph->imageWidth * DC->aspectScale; + height = glyph->imageHeight; + skip = glyph->xSkip * DC->aspectScale; + + if ( Q_IsColorString( s ) ) { + memcpy( newColor, g_color_table[ColorIndex(*(s+1))], sizeof( newColor ) ); + newColor[3] = color[3]; + DC->setColor( newColor ); + s += 2; + continue; + } else { + float yadj = useScale * glyph->top; + if (style == ITEM_TEXTSTYLE_SHADOWED || style == ITEM_TEXTSTYLE_SHADOWEDMORE) { + int ofs = style == ITEM_TEXTSTYLE_SHADOWED ? 1 : 2; + colorBlack[3] = newColor[3]; + DC->setColor( colorBlack ); + UI_Text_PaintChar(x + ofs, y - yadj + ofs, + width, + height, + useScale, + glyph->s, + glyph->t, + glyph->s2, + glyph->t2, + glyph->glyph); + DC->setColor( newColor ); + colorBlack[3] = 1.0; + } + else if( style == ITEM_TEXTSTYLE_NEON ) + { + vec4_t glow, outer, inner, white; + + glow[ 0 ] = newColor[ 0 ] * 0.5; + glow[ 1 ] = newColor[ 1 ] * 0.5; + glow[ 2 ] = newColor[ 2 ] * 0.5; + glow[ 3 ] = newColor[ 3 ] * 0.2; + + outer[ 0 ] = newColor[ 0 ]; + outer[ 1 ] = newColor[ 1 ]; + outer[ 2 ] = newColor[ 2 ]; + outer[ 3 ] = newColor[ 3 ]; + + inner[ 0 ] = newColor[ 0 ] * 1.5 > 1.0f ? 1.0f : newColor[ 0 ] * 1.5; + inner[ 1 ] = newColor[ 1 ] * 1.5 > 1.0f ? 1.0f : newColor[ 1 ] * 1.5; + inner[ 2 ] = newColor[ 2 ] * 1.5 > 1.0f ? 1.0f : newColor[ 2 ] * 1.5; + inner[ 3 ] = newColor[ 3 ]; + + white[ 0 ] = white[ 1 ] = white[ 2 ] = white[ 3 ] = 1.0f; + + DC->setColor( glow ); + UI_Text_PaintChar( x - 1.5, y - yadj - 1.5, + width + 3, + height + 3, + useScale, + glyph->s, + glyph->t, + glyph->s2, + glyph->t2, + glyph->glyph ); + + DC->setColor( outer ); + UI_Text_PaintChar( x - 1, y - yadj - 1, + width + 2, + height + 2, + useScale, + glyph->s, + glyph->t, + glyph->s2, + glyph->t2, + glyph->glyph ); + + DC->setColor( inner ); + UI_Text_PaintChar( x - 0.5, y - yadj - 0.5, + width + 1, + height + 1, + useScale, + glyph->s, + glyph->t, + glyph->s2, + glyph->t2, + glyph->glyph ); + + DC->setColor( white ); + } + + UI_Text_PaintChar(x, y - yadj, + width, + height, + useScale, + glyph->s, + glyph->t, + glyph->s2, + glyph->t2, + glyph->glyph); + + x += (skip * useScale) + adjust; + s++; + count++; + } + } + DC->setColor( NULL ); + } +} + +//FIXME: merge this with Text_Paint, somehow +void UI_Text_PaintWithCursor(float x, float y, float scale, vec4_t color, const char *text, int cursorPos, char cursor, int limit, int style) { + int len, count; + vec4_t newColor; + glyphInfo_t *glyph, *glyph2; + float yadj; + float useScale; + fontInfo_t *font = &DC->Assets.textFont; + if (scale <= DC->getCVarValue( "ui_smallFont" )) { + font = &DC->Assets.smallFont; + } else if (scale >= DC->getCVarValue( "ui_bigFont" )) { + font = &DC->Assets.bigFont; + } + useScale = scale * font->glyphScale; + if (text) { + float width2, height2, skip2; + const char *s = text; + DC->setColor( color ); + memcpy(&newColor[0], &color[0], sizeof(vec4_t)); + len = strlen(text); + if (limit > 0 && len > limit) { + len = limit; + } + count = 0; + glyph2 = &font->glyphs[ (int) cursor]; + width2 = glyph2->imageWidth * DC->aspectScale; + height2 = glyph2->imageHeight; + skip2 = glyph2->xSkip * DC->aspectScale; + while (s && *s && count < len) { + float width, height, skip; + glyph = &font->glyphs[(int)*s]; + width = glyph->imageWidth * DC->aspectScale; + height = glyph->imageHeight; + skip = glyph->xSkip * DC->aspectScale; + + yadj = useScale * glyph->top; + if (style == ITEM_TEXTSTYLE_SHADOWED || style == ITEM_TEXTSTYLE_SHADOWEDMORE) { + int ofs = style == ITEM_TEXTSTYLE_SHADOWED ? 1 : 2; + colorBlack[3] = newColor[3]; + DC->setColor( colorBlack ); + UI_Text_PaintChar(x + ofs, y - yadj + ofs, + width, + height, + useScale, + glyph->s, + glyph->t, + glyph->s2, + glyph->t2, + glyph->glyph); + colorBlack[3] = 1.0; + DC->setColor( newColor ); + } + else if( style == ITEM_TEXTSTYLE_NEON ) + { + vec4_t glow, outer, inner, white; + + glow[ 0 ] = newColor[ 0 ] * 0.5; + glow[ 1 ] = newColor[ 1 ] * 0.5; + glow[ 2 ] = newColor[ 2 ] * 0.5; + glow[ 3 ] = newColor[ 3 ] * 0.2; + + outer[ 0 ] = newColor[ 0 ]; + outer[ 1 ] = newColor[ 1 ]; + outer[ 2 ] = newColor[ 2 ]; + outer[ 3 ] = newColor[ 3 ]; + + inner[ 0 ] = newColor[ 0 ] * 1.5 > 1.0f ? 1.0f : newColor[ 0 ] * 1.5; + inner[ 1 ] = newColor[ 1 ] * 1.5 > 1.0f ? 1.0f : newColor[ 1 ] * 1.5; + inner[ 2 ] = newColor[ 2 ] * 1.5 > 1.0f ? 1.0f : newColor[ 2 ] * 1.5; + inner[ 3 ] = newColor[ 3 ]; + + white[ 0 ] = white[ 1 ] = white[ 2 ] = white[ 3 ] = 1.0f; + + DC->setColor( glow ); + UI_Text_PaintChar( x - 1.5, y - yadj - 1.5, + width + 3, + height + 3, + useScale, + glyph->s, + glyph->t, + glyph->s2, + glyph->t2, + glyph->glyph ); + + DC->setColor( outer ); + UI_Text_PaintChar( x - 1, y - yadj - 1, + width + 2, + height + 2, + useScale, + glyph->s, + glyph->t, + glyph->s2, + glyph->t2, + glyph->glyph ); + + DC->setColor( inner ); + UI_Text_PaintChar( x - 0.5, y - yadj - 0.5, + width + 1, + height + 1, + useScale, + glyph->s, + glyph->t, + glyph->s2, + glyph->t2, + glyph->glyph ); + + DC->setColor( white ); + } + + UI_Text_PaintChar(x, y - yadj, + width, + height, + useScale, + glyph->s, + glyph->t, + glyph->s2, + glyph->t2, + glyph->glyph); + + yadj = useScale * glyph2->top; + if (count == cursorPos && !((DC->realTime/BLINK_DIVISOR) & 1)) { + UI_Text_PaintChar(x, y - yadj, + width2, + height2, + useScale, + glyph2->s, + glyph2->t, + glyph2->s2, + glyph2->t2, + glyph2->glyph); + } + + x += (skip * useScale); + s++; + count++; + } + // need to paint cursor at end of text + if (cursorPos == len && !((DC->realTime/BLINK_DIVISOR) & 1)) { + yadj = useScale * glyph2->top; + UI_Text_PaintChar(x, y - yadj, + width2, + height2, + useScale, + glyph2->s, + glyph2->t, + glyph2->s2, + glyph2->t2, + glyph2->glyph); + + } + + DC->setColor( NULL ); + } +} commandDef_t commandList[] = { @@ -1545,6 +2081,7 @@ commandDef_t commandList[] = {"setitemcolor", &Script_SetItemColor}, // group/name {"setteamcolor", &Script_SetTeamColor}, // sets this background color to team color {"setfocus", &Script_SetFocus}, // sets this background color to team color + {"reset", &Script_Reset}, // resets the state of the item argument {"setplayermodel", &Script_SetPlayerModel}, // sets this background color to team color {"setplayerhead", &Script_SetPlayerHead}, // sets this background color to team color {"transition", &Script_Transition}, // group/name @@ -1724,24 +2261,24 @@ int Item_ListBox_ThumbPosition(itemDef_t *item) { max = Item_ListBox_MaxScroll(item); if (item->window.flags & WINDOW_HORIZONTAL) { - size = item->window.rect.w - (SCROLLBAR_SIZE * 2) - 2; + size = item->window.rect.w - (SCROLLBAR_WIDTH * 2) - 2; if (max > 0) { - pos = (size-SCROLLBAR_SIZE) / (float) max; + pos = (size-SCROLLBAR_WIDTH) / (float) max; } else { pos = 0; } pos *= listPtr->startPos; - return item->window.rect.x + 1 + SCROLLBAR_SIZE + pos; + return item->window.rect.x + 1 + SCROLLBAR_WIDTH + pos; } else { - size = item->window.rect.h - (SCROLLBAR_SIZE * 2) - 2; + size = item->window.rect.h - (SCROLLBAR_HEIGHT * 2) - 2; if (max > 0) { - pos = (size-SCROLLBAR_SIZE) / (float) max; + pos = (size-SCROLLBAR_HEIGHT) / (float) max; } else { pos = 0; } pos *= listPtr->startPos; - return item->window.rect.y + 1 + SCROLLBAR_SIZE + pos; + return item->window.rect.y + 1 + SCROLLBAR_HEIGHT + pos; } } @@ -1750,20 +2287,20 @@ int Item_ListBox_ThumbDrawPosition(itemDef_t *item) { if (itemCapture == item) { if (item->window.flags & WINDOW_HORIZONTAL) { - min = item->window.rect.x + SCROLLBAR_SIZE + 1; - max = item->window.rect.x + item->window.rect.w - 2*SCROLLBAR_SIZE - 1; - if (DC->cursorx >= min + SCROLLBAR_SIZE/2 && DC->cursorx <= max + SCROLLBAR_SIZE/2) { - return DC->cursorx - SCROLLBAR_SIZE/2; + min = item->window.rect.x + SCROLLBAR_WIDTH + 1; + max = item->window.rect.x + item->window.rect.w - 2*SCROLLBAR_WIDTH - 1; + if (DC->cursorx >= min + SCROLLBAR_WIDTH/2 && DC->cursorx <= max + SCROLLBAR_WIDTH/2) { + return DC->cursorx - SCROLLBAR_WIDTH/2; } else { return Item_ListBox_ThumbPosition(item); } } else { - min = item->window.rect.y + SCROLLBAR_SIZE + 1; - max = item->window.rect.y + item->window.rect.h - 2*SCROLLBAR_SIZE - 1; - if (DC->cursory >= min + SCROLLBAR_SIZE/2 && DC->cursory <= max + SCROLLBAR_SIZE/2) { - return DC->cursory - SCROLLBAR_SIZE/2; + min = item->window.rect.y + SCROLLBAR_HEIGHT + 1; + max = item->window.rect.y + item->window.rect.h - 2*SCROLLBAR_HEIGHT - 1; + if (DC->cursory >= min + SCROLLBAR_HEIGHT/2 && DC->cursory <= max + SCROLLBAR_HEIGHT/2) { + return DC->cursory - SCROLLBAR_HEIGHT/2; } else { return Item_ListBox_ThumbPosition(item); @@ -1841,13 +2378,14 @@ int Item_ListBox_OverLB(itemDef_t *item, float x, float y) { if (item->window.flags & WINDOW_HORIZONTAL) { // check if on left arrow r.x = item->window.rect.x; - r.y = item->window.rect.y + item->window.rect.h - SCROLLBAR_SIZE; - r.h = r.w = SCROLLBAR_SIZE; + r.y = item->window.rect.y + item->window.rect.h - SCROLLBAR_HEIGHT; + r.w = SCROLLBAR_WIDTH; + r.h = SCROLLBAR_HEIGHT; if (Rect_ContainsPoint(&r, x, y)) { return WINDOW_LB_LEFTARROW; } // check if on right arrow - r.x = item->window.rect.x + item->window.rect.w - SCROLLBAR_SIZE; + r.x = item->window.rect.x + item->window.rect.w - SCROLLBAR_WIDTH; if (Rect_ContainsPoint(&r, x, y)) { return WINDOW_LB_RIGHTARROW; } @@ -1857,24 +2395,25 @@ int Item_ListBox_OverLB(itemDef_t *item, float x, float y) { if (Rect_ContainsPoint(&r, x, y)) { return WINDOW_LB_THUMB; } - r.x = item->window.rect.x + SCROLLBAR_SIZE; + r.x = item->window.rect.x + SCROLLBAR_WIDTH; r.w = thumbstart - r.x; if (Rect_ContainsPoint(&r, x, y)) { return WINDOW_LB_PGUP; } - r.x = thumbstart + SCROLLBAR_SIZE; - r.w = item->window.rect.x + item->window.rect.w - SCROLLBAR_SIZE; + r.x = thumbstart + SCROLLBAR_WIDTH; + r.w = item->window.rect.x + item->window.rect.w - SCROLLBAR_WIDTH; if (Rect_ContainsPoint(&r, x, y)) { return WINDOW_LB_PGDN; } } else { - r.x = item->window.rect.x + item->window.rect.w - SCROLLBAR_SIZE; + r.x = item->window.rect.x + item->window.rect.w - SCROLLBAR_WIDTH; r.y = item->window.rect.y; - r.h = r.w = SCROLLBAR_SIZE; + r.w = SCROLLBAR_WIDTH; + r.h = SCROLLBAR_HEIGHT; if (Rect_ContainsPoint(&r, x, y)) { return WINDOW_LB_LEFTARROW; } - r.y = item->window.rect.y + item->window.rect.h - SCROLLBAR_SIZE; + r.y = item->window.rect.y + item->window.rect.h - SCROLLBAR_HEIGHT; if (Rect_ContainsPoint(&r, x, y)) { return WINDOW_LB_RIGHTARROW; } @@ -1883,13 +2422,13 @@ int Item_ListBox_OverLB(itemDef_t *item, float x, float y) { if (Rect_ContainsPoint(&r, x, y)) { return WINDOW_LB_THUMB; } - r.y = item->window.rect.y + SCROLLBAR_SIZE; + r.y = item->window.rect.y + SCROLLBAR_HEIGHT; r.h = thumbstart - r.y; if (Rect_ContainsPoint(&r, x, y)) { return WINDOW_LB_PGUP; } - r.y = thumbstart + SCROLLBAR_SIZE; - r.h = item->window.rect.y + item->window.rect.h - SCROLLBAR_SIZE; + r.y = thumbstart + SCROLLBAR_HEIGHT; + r.h = item->window.rect.y + item->window.rect.h - SCROLLBAR_HEIGHT; if (Rect_ContainsPoint(&r, x, y)) { return WINDOW_LB_PGDN; } @@ -1912,7 +2451,7 @@ void Item_ListBox_MouseEnter(itemDef_t *item, float x, float y) if (listPtr->elementStyle == LISTBOX_IMAGE) { r.x = item->window.rect.x; r.y = item->window.rect.y; - r.h = item->window.rect.h - SCROLLBAR_SIZE; + r.h = item->window.rect.h - SCROLLBAR_HEIGHT; r.w = item->window.rect.w - listPtr->drawPadding; if (Rect_ContainsPoint(&r, x, y)) { listPtr->cursorPos = (int)((x - r.x) / listPtr->elementWidth) + listPtr->startPos; @@ -1927,7 +2466,7 @@ void Item_ListBox_MouseEnter(itemDef_t *item, float x, float y) } else if (!(item->window.flags & (WINDOW_LB_LEFTARROW | WINDOW_LB_RIGHTARROW | WINDOW_LB_THUMB | WINDOW_LB_PGUP | WINDOW_LB_PGDN))) { r.x = item->window.rect.x; r.y = item->window.rect.y; - r.w = item->window.rect.w - SCROLLBAR_SIZE; + r.w = item->window.rect.w - SCROLLBAR_WIDTH; r.h = item->window.rect.h - listPtr->drawPadding; if (Rect_ContainsPoint(&r, x, y)) { listPtr->cursorPos = (int)((y - 2 - r.y) / listPtr->elementHeight) + listPtr->startPos; @@ -2156,14 +2695,14 @@ qboolean Item_ListBox_HandleKey(itemDef_t *item, int key, qboolean down, qboolea // Display_SetCaptureItem(item); } else { // select an item - if (DC->realTime < lastListBoxClickTime && listPtr->doubleClick) { - Item_RunScript(item, listPtr->doubleClick); - } - lastListBoxClickTime = DC->realTime + DOUBLE_CLICK_DELAY; if (item->cursorPos != listPtr->cursorPos) { item->cursorPos = listPtr->cursorPos; DC->feederSelection(item->special, item->cursorPos); } + if (DC->realTime < lastListBoxClickTime && listPtr->doubleClick) { + Item_RunScript(item, listPtr->doubleClick); + } + lastListBoxClickTime = DC->realTime + DOUBLE_CLICK_DELAY; } return qtrue; } @@ -2376,7 +2915,7 @@ static void Item_TextField_CalcPaintOffset( itemDef_t *item, char *buff ) // string that's visible if( buff[ item->cursorPos + 1 ] == '\0' ) { - while( DC->textWidth( &buff[ editPtr->paintOffset ], item->textscale, 0 ) <= + while( UI_Text_Width( &buff[ editPtr->paintOffset ], item->textscale, 0 ) <= ( editPtr->maxFieldWidth - EDIT_CURSOR_WIDTH ) && editPtr->paintOffset > 0 ) editPtr->paintOffset--; } @@ -2384,7 +2923,7 @@ static void Item_TextField_CalcPaintOffset( itemDef_t *item, char *buff ) buff[ item->cursorPos + 1 ] = '\0'; // Shift paintOffset so that the cursor is visible - while( DC->textWidth( &buff[ editPtr->paintOffset ], item->textscale, 0 ) > + while( UI_Text_Width( &buff[ editPtr->paintOffset ], item->textscale, 0 ) > ( editPtr->maxFieldWidth - EDIT_CURSOR_WIDTH ) ) editPtr->paintOffset++; } @@ -2514,12 +3053,23 @@ qboolean Item_TextField_HandleKey(itemDef_t *item, int key) case K_KP_UPARROW: newItem = Menu_SetNextCursorItem(item->parent); if( newItem && ( newItem->type == ITEM_TYPE_EDITFIELD || newItem->type == ITEM_TYPE_NUMERICFIELD ) ) + { g_editItem = newItem; + } + else + { + releaseFocus = qtrue; + goto exit; + } break; case K_ENTER: case K_KP_ENTER: case K_ESCAPE: + case K_MOUSE1: + case K_MOUSE2: + case K_MOUSE3: + case K_MOUSE4: releaseFocus = qtrue; goto exit; @@ -2565,13 +3115,13 @@ static void Scroll_ListBox_ThumbFunc(void *p) { if (DC->cursorx == si->xStart) { return; } - r.x = si->item->window.rect.x + SCROLLBAR_SIZE + 1; - r.y = si->item->window.rect.y + si->item->window.rect.h - SCROLLBAR_SIZE - 1; - r.h = SCROLLBAR_SIZE; - r.w = si->item->window.rect.w - (SCROLLBAR_SIZE*2) - 2; + r.x = si->item->window.rect.x + SCROLLBAR_WIDTH + 1; + r.y = si->item->window.rect.y + si->item->window.rect.h - SCROLLBAR_HEIGHT - 1; + r.w = si->item->window.rect.w - (SCROLLBAR_WIDTH*2) - 2; + r.h = SCROLLBAR_HEIGHT; max = Item_ListBox_MaxScroll(si->item); // - pos = (DC->cursorx - r.x - SCROLLBAR_SIZE/2) * max / (r.w - SCROLLBAR_SIZE); + pos = (DC->cursorx - r.x - SCROLLBAR_WIDTH/2) * max / (r.w - SCROLLBAR_WIDTH); if (pos < 0) { pos = 0; } @@ -2583,13 +3133,13 @@ static void Scroll_ListBox_ThumbFunc(void *p) { } else if (DC->cursory != si->yStart) { - r.x = si->item->window.rect.x + si->item->window.rect.w - SCROLLBAR_SIZE - 1; - r.y = si->item->window.rect.y + SCROLLBAR_SIZE + 1; - r.h = si->item->window.rect.h - (SCROLLBAR_SIZE*2) - 2; - r.w = SCROLLBAR_SIZE; + r.x = si->item->window.rect.x + si->item->window.rect.w - SCROLLBAR_WIDTH - 1; + r.y = si->item->window.rect.y + SCROLLBAR_HEIGHT + 1; + r.w = SCROLLBAR_WIDTH; + r.h = si->item->window.rect.h - (SCROLLBAR_HEIGHT*2) - 2; max = Item_ListBox_MaxScroll(si->item); // - pos = (DC->cursory - r.y - SCROLLBAR_SIZE/2) * max / (r.h - SCROLLBAR_SIZE); + pos = (DC->cursory - r.y - SCROLLBAR_HEIGHT/2) * max / (r.h - SCROLLBAR_HEIGHT); if (pos < 0) { pos = 0; } @@ -3167,37 +3717,37 @@ void Item_SetTextExtents(itemDef_t *item, int *width, int *height, const char *t *height = item->textRect.h; // keeps us from computing the widths and heights more than once - if (*width == 0 || (item->type == ITEM_TYPE_OWNERDRAW && item->textalignment == ITEM_ALIGN_CENTER)) { + if (*width == 0 || (item->type == ITEM_TYPE_OWNERDRAW && item->textalignment == ALIGN_CENTER)) { int originalWidth; - if (item->type == ITEM_TYPE_EDITFIELD && item->textalignment == ITEM_ALIGN_CENTER && item->cvar) { + if (item->type == ITEM_TYPE_EDITFIELD && item->textalignment == ALIGN_CENTER && item->cvar) { //FIXME: this will only be called once? char buff[256]; DC->getCVarString(item->cvar, buff, 256); - originalWidth = DC->textWidth(item->text, item->textscale, 0) + - DC->textWidth(buff, item->textscale, 0); + originalWidth = UI_Text_Width(item->text, item->textscale, 0) + + UI_Text_Width(buff, item->textscale, 0); } else { - originalWidth = DC->textWidth(item->text, item->textscale, 0); + originalWidth = UI_Text_Width(item->text, item->textscale, 0); } - *width = DC->textWidth(textPtr, item->textscale, 0); - *height = DC->textHeight(textPtr, item->textscale, 0); + *width = UI_Text_Width(textPtr, item->textscale, 0); + *height = UI_Text_Height(textPtr, item->textscale, 0); item->textRect.w = *width; item->textRect.h = *height; - if (item->textvalignment == ITEM_VALIGN_BOTTOM) { + if (item->textvalignment == VALIGN_BOTTOM) { item->textRect.y = item->textaligny + item->window.rect.h; - } else if (item->textvalignment == ITEM_VALIGN_CENTER) { + } else if (item->textvalignment == VALIGN_CENTER) { item->textRect.y = item->textaligny + ( ( *height + item->window.rect.h ) / 2.0f ); - } else if (item->textvalignment == ITEM_VALIGN_TOP) { + } else if (item->textvalignment == VALIGN_TOP) { item->textRect.y = item->textaligny + *height; } - if (item->textalignment == ITEM_ALIGN_LEFT) { + if (item->textalignment == ALIGN_LEFT) { item->textRect.x = item->textalignx; - } else if (item->textalignment == ITEM_ALIGN_CENTER) { + } else if (item->textalignment == ALIGN_CENTER) { item->textRect.x = item->textalignx + ( ( item->window.rect.w - originalWidth ) / 2.0f ); - } else if (item->textalignment == ITEM_ALIGN_RIGHT) { + } else if (item->textalignment == ALIGN_RIGHT) { item->textRect.x = item->textalignx + item->window.rect.w - originalWidth; } @@ -3271,8 +3821,14 @@ static const char *Item_Text_Wrap( const char *text, float scale, float width ) testLength = 1; eol = p; - - while( DC->textWidth( p, scale, testLength ) < width ) + q = p; + while( Q_IsColorString( q ) ) + q += 2; + q++; + while( Q_IsColorString( q ) ) + q += 2; + + while( UI_Text_Width( p, scale, testLength ) < width ) { if( testLength >= strlen( p ) ) { @@ -3465,14 +4021,14 @@ void Item_Text_Wrapped_Paint( itemDef_t *item ) { while( UI_NextWrapLine( &p, &x, &y ) ) { - DC->drawText( x, y, item->textscale, color, + UI_Text_Paint( x, y, item->textscale, color, p, 0, 0, item->textStyle ); } } else { char buff[ 1024 ]; - float fontHeight = DC->textEmHeight( item->textscale ); + float fontHeight = UI_Text_EmHeight( item->textscale ); const float lineSpacing = fontHeight * 0.4f; float lineHeight = fontHeight + lineSpacing; float textHeight; @@ -3508,15 +4064,15 @@ void Item_Text_Wrapped_Paint( itemDef_t *item ) switch( item->textvalignment ) { default: - case ITEM_VALIGN_BOTTOM: + case VALIGN_BOTTOM: paintY = y + ( h - textHeight ); break; - case ITEM_VALIGN_CENTER: + case VALIGN_CENTER: paintY = y + ( ( h - textHeight ) / 2.0f ); break; - case ITEM_VALIGN_TOP: + case VALIGN_TOP: paintY = y; break; } @@ -3543,7 +4099,7 @@ void Item_Text_Wrapped_Paint( itemDef_t *item ) lineItem.textStyle = item->textStyle; lineItem.text = buff; lineItem.textalignment = item->textalignment; - lineItem.textvalignment = ITEM_VALIGN_TOP; + lineItem.textvalignment = VALIGN_TOP; lineItem.textalignx = 0.0f; lineItem.textaligny = 0.0f; @@ -3566,7 +4122,7 @@ void Item_Text_Wrapped_Paint( itemDef_t *item ) } Item_SetTextExtents( &lineItem, &width, &height, buff ); - DC->drawText( lineItem.textRect.x, lineItem.textRect.y, + UI_Text_Paint( lineItem.textRect.x, lineItem.textRect.y, lineItem.textscale, color, buff, 0, 0, lineItem.textStyle ); UI_AddCacheEntryLine( buff, lineItem.textRect.x, lineItem.textRect.y ); @@ -3661,7 +4217,7 @@ void Item_Text_Paint(itemDef_t *item) { if (item->textStyle == ITEM_TEXTSTYLE_SHADOWED || item->textStyle == ITEM_TEXTSTYLE_OUTLINESHADOWED) { Fade(&item->window.flags, &DC->Assets.shadowColor[3], DC->Assets.fadeClamp, &item->window.nextTime, DC->Assets.fadeCycle, qfalse); - DC->drawText(item->textRect.x + DC->Assets.shadowX, item->textRect.y + DC->Assets.shadowY, item->textscale, DC->Assets.shadowColor, textPtr, adjust); + UI_Text_Paint(item->textRect.x + DC->Assets.shadowX, item->textRect.y + DC->Assets.shadowY, item->textscale, DC->Assets.shadowColor, textPtr, adjust); } */ @@ -3678,10 +4234,10 @@ void Item_Text_Paint(itemDef_t *item) { // Text_Paint(item->textRect.x, item->textRect.y+1, item->textscale, item->window.foreColor, textPtr, adjust); // Text_Paint(item->textRect.x+1, item->textRect.y+1, item->textscale, item->window.foreColor, textPtr, adjust); // */ -// DC->drawText(item->textRect.x - 1, item->textRect.y + 1, item->textscale * 1.02, item->window.outlineColor, textPtr, adjust); +// UI_Text_Paint(item->textRect.x - 1, item->textRect.y + 1, item->textscale * 1.02, item->window.outlineColor, textPtr, adjust); // } - DC->drawText(item->textRect.x, item->textRect.y, item->textscale, color, textPtr, 0, 0, item->textStyle); + UI_Text_Paint(item->textRect.x, item->textRect.y, item->textscale, color, textPtr, 0, 0, item->textStyle); } @@ -3719,7 +4275,7 @@ void Item_TextField_Paint(itemDef_t *item) editPtr->paintOffset = 0; // Shorten string to max viewable - while( DC->textWidth( buff + editPtr->paintOffset, item->textscale, 0 ) > + while( UI_Text_Width( buff + editPtr->paintOffset, item->textscale, 0 ) > ( editPtr->maxFieldWidth - cursorWidth ) && strlen( buff ) > 0 ) buff[ strlen( buff ) - 1 ] = '\0'; @@ -3732,7 +4288,7 @@ void Item_TextField_Paint(itemDef_t *item) if( editing ) { - DC->drawTextWithCursor( item->textRect.x + item->textRect.w + offset, + UI_Text_PaintWithCursor( item->textRect.x + item->textRect.w + offset, item->textRect.y, item->textscale, newColor, buff + editPtr->paintOffset, item->cursorPos - editPtr->paintOffset, @@ -3740,7 +4296,7 @@ void Item_TextField_Paint(itemDef_t *item) } else { - DC->drawText( item->textRect.x + item->textRect.w + offset, + UI_Text_Paint( item->textRect.x + item->textRect.w + offset, item->textRect.y, item->textscale, newColor, buff + editPtr->paintOffset, 0, editPtr->maxPaintChars, item->textStyle ); @@ -3765,9 +4321,9 @@ void Item_YesNo_Paint(itemDef_t *item) { offset = (item->text && *item->text) ? ITEM_VALUE_OFFSET : 0; if (item->text) { Item_Text_Paint(item); - DC->drawText(item->textRect.x + item->textRect.w + offset, item->textRect.y, item->textscale, newColor, (value != 0) ? "Yes" : "No", 0, 0, item->textStyle); + UI_Text_Paint(item->textRect.x + item->textRect.w + offset, item->textRect.y, item->textscale, newColor, (value != 0) ? "Yes" : "No", 0, 0, item->textStyle); } else { - DC->drawText(item->textRect.x, item->textRect.y, item->textscale, newColor, (value != 0) ? "Yes" : "No", 0, 0, item->textStyle); + UI_Text_Paint(item->textRect.x, item->textRect.y, item->textscale, newColor, (value != 0) ? "Yes" : "No", 0, 0, item->textStyle); } } @@ -3786,9 +4342,9 @@ void Item_Multi_Paint(itemDef_t *item) { if (item->text) { Item_Text_Paint(item); - DC->drawText(item->textRect.x + item->textRect.w + ITEM_VALUE_OFFSET, item->textRect.y, item->textscale, newColor, text, 0, 0, item->textStyle); + UI_Text_Paint(item->textRect.x + item->textRect.w + ITEM_VALUE_OFFSET, item->textRect.y, item->textscale, newColor, text, 0, 0, item->textStyle); } else { - DC->drawText(item->textRect.x, item->textRect.y, item->textscale, newColor, text, 0, 0, item->textStyle); + UI_Text_Paint(item->textRect.x, item->textRect.y, item->textscale, newColor, text, 0, 0, item->textStyle); } } @@ -4103,17 +4659,17 @@ void Item_Bind_Paint(itemDef_t *item) { if( g_bindItem == item && g_waitingForKey ) { - DC->drawText( item->textRect.x + item->textRect.w + ITEM_VALUE_OFFSET, item->textRect.y, + UI_Text_Paint( item->textRect.x + item->textRect.w + ITEM_VALUE_OFFSET, item->textRect.y, item->textscale, newColor, "Press key", 0, maxChars, item->textStyle); } else { BindingFromName(item->cvar); - DC->drawText( item->textRect.x + item->textRect.w + ITEM_VALUE_OFFSET, item->textRect.y, + UI_Text_Paint( item->textRect.x + item->textRect.w + ITEM_VALUE_OFFSET, item->textRect.y, item->textscale, newColor, g_nameBind1, 0, maxChars, item->textStyle); } } else { - DC->drawText(item->textRect.x, item->textRect.y, item->textscale, newColor, (value != 0) ? "FIXME" : "FIXME", 0, maxChars, item->textStyle); + UI_Text_Paint(item->textRect.x, item->textRect.y, item->textscale, newColor, (value != 0) ? "FIXME" : "FIXME", 0, maxChars, item->textStyle); } } @@ -4323,6 +4879,19 @@ void Item_ListBox_Paint(itemDef_t *item) { qhandle_t image; qhandle_t optionalImage; listBoxDef_t *listPtr = (listBoxDef_t*)item->typeData; + menuDef_t *menu = (menuDef_t *)item->parent; + float one, two; + + if( menu->window.aspectBias != ASPECT_NONE || item->window.aspectBias != ASPECT_NONE ) + { + one = 1.0f * DC->aspectScale; + two = 2.0f * DC->aspectScale; + } + else + { + one = 1.0f; + two = 2.0f; + } // the listbox is horizontal or vertical and has a fixed size scroll bar going either direction // elements are enumerated from the DC and either text or image handles are acquired from the DC as well @@ -4331,24 +4900,25 @@ void Item_ListBox_Paint(itemDef_t *item) { count = DC->feederCount(item->special); // default is vertical if horizontal flag is not here if (item->window.flags & WINDOW_HORIZONTAL) { + //FIXME: unmaintained cruft? if( !listPtr->notselectable ) { // draw scrollbar in bottom of the window // bar x = item->window.rect.x + 1; - y = item->window.rect.y + item->window.rect.h - SCROLLBAR_SIZE - 1; - DC->drawHandlePic(x, y, SCROLLBAR_SIZE, SCROLLBAR_SIZE, DC->Assets.scrollBarArrowLeft); - x += SCROLLBAR_SIZE - 1; - size = item->window.rect.w - (SCROLLBAR_SIZE * 2); - DC->drawHandlePic(x, y, size+1, SCROLLBAR_SIZE, DC->Assets.scrollBar); + y = item->window.rect.y + item->window.rect.h - SCROLLBAR_HEIGHT - 1; + DC->drawHandlePic(x, y, SCROLLBAR_WIDTH, SCROLLBAR_HEIGHT, DC->Assets.scrollBarArrowLeft); + x += SCROLLBAR_WIDTH - 1; + size = item->window.rect.w - (SCROLLBAR_WIDTH * 2); + DC->drawHandlePic(x, y, size+1, SCROLLBAR_HEIGHT, DC->Assets.scrollBar); x += size - 1; - DC->drawHandlePic(x, y, SCROLLBAR_SIZE, SCROLLBAR_SIZE, DC->Assets.scrollBarArrowRight); + DC->drawHandlePic(x, y, SCROLLBAR_WIDTH, SCROLLBAR_HEIGHT, DC->Assets.scrollBarArrowRight); // thumb thumb = Item_ListBox_ThumbDrawPosition(item);//Item_ListBox_ThumbPosition(item); - if (thumb > x - SCROLLBAR_SIZE - 1) { - thumb = x - SCROLLBAR_SIZE - 1; + if (thumb > x - SCROLLBAR_WIDTH - 1) { + thumb = x - SCROLLBAR_WIDTH - 1; } - DC->drawHandlePic(thumb, y, SCROLLBAR_SIZE, SCROLLBAR_SIZE, DC->Assets.scrollBarThumb); + DC->drawHandlePic(thumb, y, SCROLLBAR_WIDTH, SCROLLBAR_HEIGHT, DC->Assets.scrollBarThumb); // listPtr->endPos = listPtr->startPos; } @@ -4388,40 +4958,41 @@ void Item_ListBox_Paint(itemDef_t *item) { if( !listPtr->notselectable ) { // draw scrollbar to right side of the window - x = item->window.rect.x + item->window.rect.w - SCROLLBAR_SIZE - 1; + x = item->window.rect.x + item->window.rect.w - SCROLLBAR_WIDTH - one; y = item->window.rect.y + 1; - DC->drawHandlePic(x, y, SCROLLBAR_SIZE, SCROLLBAR_SIZE, DC->Assets.scrollBarArrowUp); - y += SCROLLBAR_SIZE - 1; + DC->drawHandlePic(x, y, SCROLLBAR_WIDTH, SCROLLBAR_HEIGHT, DC->Assets.scrollBarArrowUp); + y += SCROLLBAR_HEIGHT - 1; listPtr->endPos = listPtr->startPos; - size = item->window.rect.h - (SCROLLBAR_SIZE * 2); - DC->drawHandlePic(x, y, SCROLLBAR_SIZE, size+1, DC->Assets.scrollBar); + size = item->window.rect.h - (SCROLLBAR_HEIGHT * 2); + DC->drawHandlePic(x, y, SCROLLBAR_WIDTH, size+1, DC->Assets.scrollBar); y += size - 1; - DC->drawHandlePic(x, y, SCROLLBAR_SIZE, SCROLLBAR_SIZE, DC->Assets.scrollBarArrowDown); + DC->drawHandlePic(x, y, SCROLLBAR_WIDTH, SCROLLBAR_HEIGHT, DC->Assets.scrollBarArrowDown); // thumb thumb = Item_ListBox_ThumbDrawPosition(item);//Item_ListBox_ThumbPosition(item); - if (thumb > y - SCROLLBAR_SIZE - 1) { - thumb = y - SCROLLBAR_SIZE - 1; + if (thumb > y - SCROLLBAR_HEIGHT - 1) { + thumb = y - SCROLLBAR_HEIGHT - 1; } - DC->drawHandlePic(x, thumb, SCROLLBAR_SIZE, SCROLLBAR_SIZE, DC->Assets.scrollBarThumb); + DC->drawHandlePic(x, thumb, SCROLLBAR_WIDTH, SCROLLBAR_HEIGHT, DC->Assets.scrollBarThumb); } // adjust size for item painting size = item->window.rect.h - 2; if (listPtr->elementStyle == LISTBOX_IMAGE) { // fit = 0; - x = item->window.rect.x + 1; + x = item->window.rect.x + one; y = item->window.rect.y + 1; for (i = listPtr->startPos; i < count; i++) { // always draw at least one // which may overdraw the box if it is too small for the element image = DC->feederItemImage(item->special, i); if (image) { - DC->drawHandlePic(x+1, y+1, listPtr->elementWidth - 2, listPtr->elementHeight - 2, image); + DC->drawHandlePic(x+one, y+1, listPtr->elementWidth - two, listPtr->elementHeight - 2, image); } if (i == item->cursorPos) { - DC->drawRect(x, y, listPtr->elementWidth - 1, listPtr->elementHeight - 1, item->window.borderSize, item->window.borderColor); + DC->drawRect( x, y, listPtr->elementWidth - one, listPtr->elementHeight - 1, + item->window.borderSize, item->window.borderColor); } listPtr->endPos++; @@ -4434,8 +5005,8 @@ void Item_ListBox_Paint(itemDef_t *item) { // fit++; } } else { - float m = DC->textEmHeight( item->textscale ); - x = item->window.rect.x + 1; + float m = UI_Text_EmHeight( item->textscale ); + x = item->window.rect.x + one; y = item->window.rect.y + 1; for (i = listPtr->startPos; i < count; i++) { char text[ MAX_STRING_CHARS ]; @@ -4445,60 +5016,82 @@ void Item_ListBox_Paint(itemDef_t *item) { if (listPtr->numColumns > 0) { int j; for (j = 0; j < listPtr->numColumns; j++) { + float columnPos; + float width, height; + + if( menu->window.aspectBias != ASPECT_NONE || item->window.aspectBias != ASPECT_NONE ) + { + columnPos = ( listPtr->columnInfo[ j ].pos + 4.0f ) * DC->aspectScale; + width = listPtr->columnInfo[ j ].width * DC->aspectScale; + } + else + { + columnPos = ( listPtr->columnInfo[ j ].pos + 4.0f ); + width = listPtr->columnInfo[ j ].width; + } + + height = listPtr->columnInfo[ j ].width; + Q_strncpyz( text, DC->feederItemText(item->special, i, j, &optionalImage), sizeof( text ) ); if (optionalImage >= 0) { - DC->drawHandlePic(x + 4 + listPtr->columnInfo[j].pos, - y + ( ( listPtr->elementHeight - listPtr->columnInfo[ j ].width ) / 2.0f ), - listPtr->columnInfo[j].width, listPtr->columnInfo[j].width, optionalImage); + DC->drawHandlePic( x + columnPos, y + ( ( listPtr->elementHeight - height ) / 2.0f ), + width, height, optionalImage); } else if (text) { int alignOffset = 0.0f, tw; - tw = DC->textWidth( text, item->textscale, 0 ); + tw = UI_Text_Width( text, item->textscale, 0 ); // Shorten the string if it's too long - while( tw > listPtr->columnInfo[ j ].width && strlen( text ) > 0 ) + while( tw > width && strlen( text ) > 0 ) { text[ strlen( text ) - 1 ] = '\0'; - tw = DC->textWidth( text, item->textscale, 0 ); + tw = UI_Text_Width( text, item->textscale, 0 ); } switch( listPtr->columnInfo[ j ].align ) { - case ITEM_ALIGN_LEFT: + case ALIGN_LEFT: alignOffset = 0.0f; break; - case ITEM_ALIGN_RIGHT: - alignOffset = listPtr->columnInfo[ j ].width - tw; + case ALIGN_RIGHT: + alignOffset = width - tw; break; - case ITEM_ALIGN_CENTER: - alignOffset = ( listPtr->columnInfo[ j ].width / 2.0f ) - ( tw / 2.0f ); + case ALIGN_CENTER: + alignOffset = ( width / 2.0f ) - ( tw / 2.0f ); break; default: alignOffset = 0.0f; } - DC->drawText( x + 4 + listPtr->columnInfo[j].pos + alignOffset, + UI_Text_Paint( x + columnPos + alignOffset, y + m + ( ( listPtr->elementHeight - m ) / 2.0f ), item->textscale, item->window.foreColor, text, 0, 0, item->textStyle ); } } } else { + float offset; + + if( menu->window.aspectBias != ASPECT_NONE || item->window.aspectBias != ASPECT_NONE ) + offset = 4.0f * DC->aspectScale; + else + offset = 4.0f; + Q_strncpyz( text, DC->feederItemText(item->special, i, 0, &optionalImage), sizeof( text ) ); if (optionalImage >= 0) { - DC->drawHandlePic(x + 4, y, listPtr->elementHeight, listPtr->elementHeight, optionalImage); + DC->drawHandlePic(x + offset, y, listPtr->elementHeight, listPtr->elementHeight, optionalImage); } else if (text) { - DC->drawText( x + 4, y + m + ( ( listPtr->elementHeight - m ) / 2.0f ), + UI_Text_Paint( x + offset, y + m + ( ( listPtr->elementHeight - m ) / 2.0f ), item->textscale, item->window.foreColor, text, 0, 0, item->textStyle ); } } if (i == item->cursorPos) { - DC->fillRect( x, y, item->window.rect.w - SCROLLBAR_SIZE - ( 2 * item->window.borderSize ), + DC->fillRect( x, y, item->window.rect.w - SCROLLBAR_WIDTH - ( two * item->window.borderSize ), listPtr->elementHeight, item->window.outlineColor); } @@ -4563,7 +5156,7 @@ void Item_OwnerDraw_Paint(itemDef_t *item) { if (item->text && *item->text) { Item_Text_Paint(item); - DC->drawText(item->textRect.x + item->textRect.w + ITEM_VALUE_OFFSET, + UI_Text_Paint(item->textRect.x + item->textRect.w + ITEM_VALUE_OFFSET, item->textRect.y, item->textscale, color, text, 0, 0, item->textStyle); } else { @@ -4783,6 +5376,7 @@ void Menu_Init(menuDef_t *menu) { menu->fadeClamp = DC->Assets.fadeClamp; menu->fadeCycle = DC->Assets.fadeCycle; Window_Init(&menu->window); + menu->window.aspectBias = ALIGN_CENTER; } itemDef_t *Menu_GetFocusedItem(menuDef_t *menu) { @@ -4885,6 +5479,7 @@ void Item_Init(itemDef_t *item) { memset(item, 0, sizeof(itemDef_t)); item->textscale = 0.55f; Window_Init(&item->window); + item->window.aspectBias = ASPECT_NONE; } void Menu_HandleMouseMove(menuDef_t *menu, float x, float y) { @@ -5224,6 +5819,14 @@ qboolean ItemParse_rect( itemDef_t *item, int handle ) { return qtrue; } +// aspectBias <bias> +qboolean ItemParse_aspectBias( itemDef_t *item, int handle ) { + if (!PC_Int_Parse(handle, &item->window.aspectBias)) { + return qfalse; + } + return qtrue; +} + // style <integer> qboolean ItemParse_style( itemDef_t *item, int handle ) { if (!PC_Int_Parse(handle, &item->window.style)) { @@ -5839,6 +6442,7 @@ keywordHash_t itemParseKeywords[] = { {"model_rotation", ItemParse_model_rotation, NULL}, {"model_angle", ItemParse_model_angle, NULL}, {"rect", ItemParse_rect, NULL}, + {"aspectBias", ItemParse_aspectBias, NULL}, {"style", ItemParse_style, NULL}, {"decoration", ItemParse_decoration, NULL}, {"notselectable", ItemParse_notselectable, NULL}, @@ -6015,6 +6619,14 @@ qboolean MenuParse_rect( itemDef_t *item, int handle ) { return qtrue; } +qboolean MenuParse_aspectBias( itemDef_t *item, int handle ) { + menuDef_t *menu = (menuDef_t*)item; + if (!PC_Int_Parse(handle, &menu->window.aspectBias)) { + return qfalse; + } + return qtrue; +} + qboolean MenuParse_style( itemDef_t *item, int handle ) { menuDef_t *menu = (menuDef_t*)item; if (!PC_Int_Parse(handle, &menu->window.style)) { @@ -6270,6 +6882,7 @@ keywordHash_t menuParseKeywords[] = { {"name", MenuParse_name, NULL}, {"fullscreen", MenuParse_fullscreen, NULL}, {"rect", MenuParse_rect, NULL}, + {"aspectBias", MenuParse_aspectBias, NULL}, {"style", MenuParse_style, NULL}, {"visible", MenuParse_visible, NULL}, {"onOpen", MenuParse_onOpen, NULL}, @@ -6397,7 +7010,7 @@ void Menu_PaintAll( void ) { if (DC->getCVarValue( "ui_developer" )) { vec4_t v = {1, 1, 1, 1}; - DC->drawText(5, 25, .5, v, va("fps: %f", DC->FPS), 0, 0, 0); + UI_Text_Paint(5, 25, .5, v, va("fps: %f", DC->FPS), 0, 0, 0); } } @@ -6425,7 +7038,7 @@ void *Display_CaptureItem(int x, int y) { // FIXME: -qboolean Display_MouseMove(void *p, int x, int y) { +qboolean Display_MouseMove(void *p, float x, float y) { int i; menuDef_t *menu = p; diff --git a/src/ui/ui_shared.h b/src/ui/ui_shared.h index 504d0ddf..30568e85 100644 --- a/src/ui/ui_shared.h +++ b/src/ui/ui_shared.h @@ -100,11 +100,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define ASSET_SCROLL_THUMB "ui/assets/scrollbar_thumb.tga" #define ASSET_SLIDER_BAR "ui/assets/slider2.tga" #define ASSET_SLIDER_THUMB "ui/assets/sliderbutt_1.tga" -#define SCROLLBAR_SIZE 16.0 -#define SLIDER_WIDTH 96.0 -#define SLIDER_HEIGHT 16.0 -#define SLIDER_THUMB_WIDTH 12.0 -#define SLIDER_THUMB_HEIGHT 20.0 +#define SCROLLBAR_SIZE 16.0f +#define SCROLLBAR_WIDTH (SCROLLBAR_SIZE*DC->aspectScale) +#define SCROLLBAR_HEIGHT SCROLLBAR_SIZE +#define SLIDER_WIDTH (96.0f*DC->aspectScale) +#define SLIDER_HEIGHT 16.0f +#define SLIDER_THUMB_WIDTH (12.0f*DC->aspectScale) +#define SLIDER_THUMB_HEIGHT 20.0f #define NUM_CROSSHAIRS 10 typedef struct { @@ -125,6 +127,7 @@ typedef rectDef_t Rectangle; // FIXME: do something to separate text vs window stuff typedef struct { Rectangle rect; // client coord rectangle + int aspectBias; // direction in which to aspect compensate Rectangle rectClient; // screen coord rectangle const char *name; // const char *group; // if it belongs to a group @@ -133,7 +136,7 @@ typedef struct { int style; // int border; // int ownerDraw; // ownerDraw style - int ownerDrawFlags; // show flags for ownerdraw items + int ownerDrawFlags; // show flags for ownerdraw items float borderSize; // int flags; // visible, focus, mouseover, cursor Rectangle rectEffects; // for various effects @@ -320,11 +323,6 @@ typedef struct { void (*setColor) (const vec4_t v); void (*drawHandlePic) (float x, float y, float w, float h, qhandle_t asset); void (*drawStretchPic) (float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader ); - void (*drawText) (float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style ); - float (*textWidth) (const char *text, float scale, int limit); - float (*textHeight) (const char *text, float scale, int limit); - float (*textEmWidth) (float scale); - float (*textEmHeight) (float scale); qhandle_t (*registerModel) (const char *p); void (*modelBounds) (qhandle_t model, vec3_t min, vec3_t max); void (*fillRect) ( float x, float y, float w, float h, const vec4_t color); @@ -371,11 +369,11 @@ typedef struct { float yscale; float xscale; - float bias; + float aspectScale; int realTime; int frameTime; - int cursorx; - int cursory; + float cursorx; + float cursory; qboolean debug; cachedAssets_t Assets; @@ -422,7 +420,7 @@ void Menus_Activate(menuDef_t *menu); displayContextDef_t *Display_GetContext( void ); void *Display_CaptureItem(int x, int y); -qboolean Display_MouseMove(void *p, int x, int y); +qboolean Display_MouseMove(void *p, float x, float y); int Display_CursorType(int x, int y); qboolean Display_KeyBindPending( void ); menuDef_t *Menus_FindByName(const char *p); @@ -452,6 +450,13 @@ void Item_Text_Wrapped_Paint( itemDef_t *item ); void UI_DrawTextBlock( rectDef_t *rect, float text_x, float text_y, vec4_t color, float scale, int textalign, int textvalign, int textStyle, const char *text ); +void UI_Text_Paint(float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style); +void UI_Text_Paint_Limit( float *maxX, float x, float y, float scale, + vec4_t color, const char* text, float adjust, int limit ); +float UI_Text_Width(const char *text, float scale, int limit); +float UI_Text_Height(const char *text, float scale, int limit); +float UI_Text_EmWidth( float scale ); +float UI_Text_EmHeight( float scale ); int trap_Parse_AddGlobalDefine( char *define ); int trap_Parse_LoadSource( const char *filename ); diff --git a/ui/connect.menu b/ui/connect.menu index 38abb3eb..108e33c8 100644 --- a/ui/connect.menu +++ b/ui/connect.menu @@ -9,5 +9,6 @@ fullScreen MENU_FALSE visible MENU_FALSE style WINDOW_STYLE_SHADER + aspectBias ASPECT_NONE } } diff --git a/ui/createfavorite.menu b/ui/createfavorite.menu index cc3c2c8f..2c35a03e 100644 --- a/ui/createfavorite.menu +++ b/ui/createfavorite.menu @@ -51,8 +51,8 @@ type ITEM_TYPE_EDITFIELD cvar "ui_favoriteName" rect BORDER BORDER (W-(2*BORDER)) INPUT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE } @@ -67,8 +67,8 @@ type ITEM_TYPE_EDITFIELD cvar "ui_favoriteAddress" rect BORDER ((2*BORDER)+INPUT_H) (W-(2*BORDER)) INPUT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE } @@ -81,8 +81,8 @@ textscale .25 style WINDOW_STYLE_EMPTY rect (W-(2*BUTT_W)) (H-BUTT_H) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -101,8 +101,8 @@ textscale .25 style WINDOW_STYLE_EMPTY rect (W-BUTT_W) (H-BUTT_H) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action diff --git a/ui/createserver.menu b/ui/createserver.menu index 4c13f13e..e0a00d2e 100644 --- a/ui/createserver.menu +++ b/ui/createserver.menu @@ -41,6 +41,7 @@ focusColor 1 .75 0 1 outOfBoundsClick style WINDOW_STYLE_EMPTY + aspectBias ASPECT_NONE onOpen { @@ -97,7 +98,7 @@ outlinecolor 0.1 0.1 0.1 0.5 visible MENU_TRUE columns 1 - 2 190 ITEM_ALIGN_LEFT + 2 190 ALIGN_LEFT } @@ -125,8 +126,8 @@ cvar "sv_hostname" maxChars 40 rect (OPTIONS_X+BORDER) (OPTIONS_Y+ELEM_OFF_Y+(0*ELEM_H)) (OPTIONS_W-(2*BORDER)) ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx ELEM_OFF_X textscale .36 forecolor 1 1 1 1 @@ -140,8 +141,8 @@ text "Time Limit:" cvar "timelimit" rect (OPTIONS_X+BORDER) (OPTIONS_Y+ELEM_OFF_Y+(1*ELEM_H)) (OPTIONS_W-(2*BORDER)) ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx ELEM_OFF_X maxchars 4 textscale .36 @@ -156,8 +157,8 @@ text "Maximum Players:" cvar "sv_maxclients" rect (OPTIONS_X+BORDER) (OPTIONS_Y+ELEM_OFF_Y+(2*ELEM_H)) (OPTIONS_W-(2*BORDER)) ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx ELEM_OFF_X maxchars 4 textscale .36 @@ -172,8 +173,8 @@ text "Require Password:" cvar "g_needpassword" rect (OPTIONS_X+BORDER) (OPTIONS_Y+ELEM_OFF_Y+(3*ELEM_H)) (OPTIONS_W-(2*BORDER)) ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx ELEM_OFF_X textscale .36 forecolor 1 1 1 1 @@ -192,8 +193,8 @@ cvar "g_password" rect (OPTIONS_X+BORDER) (OPTIONS_Y+ELEM_OFF_Y+(4*ELEM_H)) (OPTIONS_W-(2*BORDER)) ELEM_H maxchars 10 - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx ELEM_OFF_X textscale .36 forecolor 1 1 1 1 @@ -209,8 +210,8 @@ text "Pure Server:" cvar "sv_pure" rect (OPTIONS_X+BORDER) (OPTIONS_Y+ELEM_OFF_Y+(6*ELEM_H)) (OPTIONS_W-(2*BORDER)) ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx ELEM_OFF_X textscale .36 forecolor 1 1 1 1 @@ -231,8 +232,8 @@ cvar "ui_dedicated" cvarFloatList { "No" 0 "LAN" 1 "Internet" 2 } rect (OPTIONS_X+BORDER) (OPTIONS_Y+ELEM_OFF_Y+(7*ELEM_H)) (OPTIONS_W-(2*BORDER)) ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx ELEM_OFF_X textscale .36 forecolor 1 1 1 1 @@ -250,8 +251,8 @@ text "Auto Download:" cvar "sv_allowdownload" rect (OPTIONS_X+BORDER) (OPTIONS_Y+ELEM_OFF_Y+(8*ELEM_H)) (OPTIONS_W-(2*BORDER)) ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx ELEM_OFF_X textscale .36 forecolor 1 1 1 1 @@ -269,8 +270,8 @@ text "Enable Voting:" cvar "g_allowvote" rect (OPTIONS_X+BORDER) (OPTIONS_Y+ELEM_OFF_Y+(9*ELEM_H)) (OPTIONS_W-(2*BORDER)) ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx ELEM_OFF_X textscale .36 forecolor 1 1 1 1 @@ -290,8 +291,8 @@ text "Minimum Ping:" cvar "sv_minping" rect (OPTIONS_X+BORDER) (OPTIONS_Y+ELEM_OFF_Y+(11*ELEM_H)) (OPTIONS_W-(2*BORDER)) ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx ELEM_OFF_X maxchars 4 textscale .36 @@ -306,8 +307,8 @@ text "Maximum Ping:" cvar "sv_maxping" rect (OPTIONS_X+BORDER) (OPTIONS_Y+ELEM_OFF_Y+(12*ELEM_H)) (OPTIONS_W-(2*BORDER)) ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx ELEM_OFF_X maxchars 4 textscale .36 @@ -322,8 +323,8 @@ text "Synchronous Client:" cvar "g_synchronousclients" rect (OPTIONS_X+BORDER) (OPTIONS_Y+ELEM_OFF_Y+(13*ELEM_H)) (OPTIONS_W-(2*BORDER)) ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx ELEM_OFF_X textscale .36 forecolor 1 1 1 1 @@ -341,8 +342,8 @@ text "Max Rate:" cvar "sv_maxrate" rect (OPTIONS_X+BORDER) (OPTIONS_Y+ELEM_OFF_Y+(14*ELEM_H)) (OPTIONS_W-(2*BORDER)) ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx ELEM_OFF_X maxchars 4 textscale .36 @@ -358,8 +359,8 @@ cvar "sv_zombietime" rect (OPTIONS_X+BORDER) (OPTIONS_Y+ELEM_OFF_Y+(15*ELEM_H)) (OPTIONS_W-(2*BORDER)) ELEM_H maxchars 4 - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx ELEM_OFF_X textscale .36 forecolor 1 1 1 1 @@ -374,8 +375,8 @@ cvar "sv_reconnectlimit" maxchars 4 rect (OPTIONS_X+BORDER) (OPTIONS_Y+ELEM_OFF_Y+(16*ELEM_H)) (OPTIONS_W-(2*BORDER)) ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx ELEM_OFF_X textscale .36 forecolor 1 1 1 1 @@ -392,6 +393,7 @@ style WINDOW_STYLE_SHADER background "ui/assets/backarrow.tga" rect BC_X BC_Y ARROW_H ARROW_W + aspectBias ALIGN_LEFT visible MENU_TRUE action { @@ -412,14 +414,15 @@ style WINDOW_STYLE_SHADER background "ui/assets/backarrow_alt.tga" rect BC_X BC_Y ARROW_H ARROW_W + aspectBias ALIGN_LEFT backcolor 0 0 0 0 forecolor 1 1 1 1 visible MENU_FALSE type ITEM_TYPE_BUTTON text "Back" - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textalignx ARROW_W textscale .6 @@ -444,6 +447,7 @@ name accept style WINDOW_STYLE_SHADER rect ((BC_X+BC_W)-ARROW_W) BC_Y ARROW_H ARROW_W + aspectBias ALIGN_RIGHT background "ui/assets/forwardarrow.tga" backcolor 0 0 0 0 forecolor 1 1 1 1 @@ -466,6 +470,7 @@ name accept_alt style WINDOW_STYLE_SHADER rect ((BC_X+BC_W)-ARROW_W) BC_Y ARROW_H ARROW_W + aspectBias ALIGN_RIGHT background "ui/assets/forwardarrow_alt.tga" backcolor 0 0 0 0 type ITEM_TYPE_BUTTON @@ -474,8 +479,8 @@ type ITEM_TYPE_BUTTON text "Create" - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx -ARROW_W textscale .6 diff --git a/ui/drop.menu b/ui/drop.menu index 2f0077f4..a511f228 100644 --- a/ui/drop.menu +++ b/ui/drop.menu @@ -52,8 +52,8 @@ name dropinfo rect BORDER BORDER INFO_W BUTT_H text "Disconnected" - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 visible MENU_TRUE @@ -68,8 +68,8 @@ style WINDOW_STYLE_FILLED wrapped cvar "com_errorMessage" - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .33 forecolor 1 1 1 1 visible MENU_TRUE @@ -84,8 +84,8 @@ textscale .4 style WINDOW_STYLE_EMPTY rect (W-((2*BORDER)+(2*BUTT_W))) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 backcolor .37 .1 .1 1 visible MENU_TRUE @@ -104,8 +104,8 @@ textscale .4 style WINDOW_STYLE_EMPTY rect (W-(BORDER+BUTT_W)) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 backcolor .37 .1 .1 1 visible MENU_TRUE diff --git a/ui/error.menu b/ui/error.menu index 14e9d058..2f553e99 100644 --- a/ui/error.menu +++ b/ui/error.menu @@ -52,8 +52,8 @@ name dropinfo rect BORDER BORDER INFO_W BUTT_H text "Error" - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 visible MENU_TRUE @@ -68,8 +68,8 @@ style WINDOW_STYLE_FILLED wrapped cvar "com_errorMessage" - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .33 forecolor 1 1 1 1 visible MENU_TRUE @@ -84,8 +84,8 @@ textscale .4 style WINDOW_STYLE_EMPTY rect (W-(BORDER+BUTT_W)) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 backcolor .37 .1 .1 1 visible MENU_TRUE diff --git a/ui/findplayer.menu b/ui/findplayer.menu index d78dede2..09d715a4 100644 --- a/ui/findplayer.menu +++ b/ui/findplayer.menu @@ -28,8 +28,7 @@ onClose { } onOpen { - uiScript FindPlayer; - setfocus namefield + uiScript FindPlayer } onESC @@ -60,8 +59,8 @@ cvar "ui_findplayer" maxChars 20 rect BORDER BORDER (W-((2*BORDER)+BUTT_W)) SEARCH_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textscale .3 outlinecolor .2 .2 .2 .5 backcolor 0 0 0 0 @@ -80,8 +79,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-(BORDER+BUTT_W)) BORDER BUTT_W SEARCH_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -127,10 +126,10 @@ notselectable visible MENU_TRUE columns 4 - 0 ((2*LEFT_C)*LIST_DW) ITEM_ALIGN_LEFT - (LEFT_C*LIST_DW) (LEFT_C*LIST_DW) ITEM_ALIGN_LEFT - ((2*LEFT_C)*LIST_DW) (LEFT_C*LIST_DW) ITEM_ALIGN_LEFT - ((1-RIGHT_C)*LIST_DW) (RIGHT_C*LIST_DW) ITEM_ALIGN_LEFT + 0 ((2*LEFT_C)*LIST_DW) ALIGN_LEFT + (LEFT_C*LIST_DW) (LEFT_C*LIST_DW) ALIGN_LEFT + ((2*LEFT_C)*LIST_DW) (LEFT_C*LIST_DW) ALIGN_LEFT + ((1-RIGHT_C)*LIST_DW) (RIGHT_C*LIST_DW) ALIGN_LEFT } // BUTTON // @@ -143,8 +142,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-(2*BUTT_W)) (H-BUTT_H) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action { ui_script FoundPlayerJoinServer } @@ -158,8 +157,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-BUTT_W) (H-BUTT_H) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action diff --git a/ui/ingame.menu b/ui/ingame.menu index 07b969e6..90b4cf12 100644 --- a/ui/ingame.menu +++ b/ui/ingame.menu @@ -39,6 +39,7 @@ focusColor 1 .75 0 1 disableColor .5 .5 .5 1 backColor 0 0 0 1 + aspectBias ALIGN_LEFT onEsc { @@ -67,8 +68,8 @@ rect BUTT_BAR_X BUTT_BAR_Y BUTT_W BUTT_H type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx -BUTT_TEXT_S textscale .4 forecolor 1 1 1 1 @@ -87,8 +88,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (BUTT_BAR_X+BUTT_W) BUTT_BAR_Y BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 visible MENU_TRUE @@ -106,8 +107,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (BUTT_BAR_X+(2*BUTT_W)) BUTT_BAR_Y BUTT_W BUTT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textalignx BUTT_TEXT_S textscale .4 forecolor 1 1 1 1 diff --git a/ui/ingame_game.menu b/ui/ingame_game.menu index 11603536..0306897b 100644 --- a/ui/ingame_game.menu +++ b/ui/ingame_game.menu @@ -65,6 +65,7 @@ outOfBoundsClick // this closes the window if it gets a click out of the rectangle rect X Y W H focusColor 1 .75 0 1 + aspectBias ALIGN_LEFT onopen { uiScript InitIgnoreList; @@ -102,8 +103,8 @@ style WINDOW_STYLE_EMPTY rect (W-((3*TOPBUTT_W)+BORDER)) BORDER TOPBUTT_W TOPBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .35 forecolor 1 1 1 1 visible MENU_TRUE @@ -128,8 +129,8 @@ style WINDOW_STYLE_EMPTY rect (W-((2*TOPBUTT_W)+BORDER)) BORDER TOPBUTT_W TOPBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .35 forecolor 1 1 1 1 visible MENU_TRUE @@ -153,8 +154,8 @@ style WINDOW_STYLE_EMPTY rect (W-((1*TOPBUTT_W)+BORDER)) BORDER TOPBUTT_W TOPBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .35 forecolor 1 1 1 1 visible MENU_TRUE @@ -182,8 +183,8 @@ style WINDOW_STYLE_EMPTY rect 0 ((2*BORDER)+TOPBUTT_H) SIDEBUTT_W SIDEBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_FALSE @@ -204,8 +205,8 @@ style WINDOW_STYLE_EMPTY rect 0 ((2*BORDER)+TOPBUTT_H+SIDEBUTT_H) SIDEBUTT_W SIDEBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_FALSE @@ -226,8 +227,8 @@ style WINDOW_STYLE_EMPTY rect 0 ((2*BORDER)+TOPBUTT_H+(2*SIDEBUTT_H)) SIDEBUTT_W SIDEBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_FALSE @@ -287,8 +288,8 @@ type ITEM_TYPE_BUTTON textscale .25 rect MAPBUTT_X MAPBUTT_Y MAPBUTT_W MAPBUTT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_FALSE action @@ -307,8 +308,8 @@ type ITEM_TYPE_BUTTON textscale .25 rect MAPBUTT_X (MAPBUTT_Y+MAPBUTT_H) MAPBUTT_W MAPBUTT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_FALSE action @@ -327,8 +328,8 @@ type ITEM_TYPE_BUTTON textscale .25 rect MAPBUTT_X (MAPBUTT_Y+(2*MAPBUTT_H)) MAPBUTT_W MAPBUTT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_FALSE action @@ -368,8 +369,8 @@ type ITEM_TYPE_BUTTON textscale .25 rect PBUTT_X PBUTT_Y (PBUTT_W/2) PBUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_FALSE action @@ -388,8 +389,8 @@ type ITEM_TYPE_BUTTON textscale .25 rect (PBUTT_X+(PBUTT_W/2)) PBUTT_Y (PBUTT_W/2) PBUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_FALSE action @@ -408,8 +409,8 @@ type ITEM_TYPE_BUTTON textscale .25 rect PBUTT_X (PBUTT_Y+PBUTT_H) PBUTT_W PBUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_FALSE action @@ -450,8 +451,8 @@ type ITEM_TYPE_BUTTON textscale .25 rect PBUTT_X PBUTT_Y (PBUTT_W/2) PBUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_FALSE action @@ -470,8 +471,8 @@ type ITEM_TYPE_BUTTON textscale .25 rect (PBUTT_X+(PBUTT_W/2)) PBUTT_Y (PBUTT_W/2) PBUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_FALSE action @@ -491,8 +492,8 @@ textscale .25 rect 110 215 150 20 rect PBUTT_X (PBUTT_Y+PBUTT_H) (PBUTT_W/2) PBUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_FALSE action @@ -511,8 +512,8 @@ type ITEM_TYPE_BUTTON textscale .25 rect (PBUTT_X+(PBUTT_W/2)) (PBUTT_Y+PBUTT_H) (PBUTT_W/2) PBUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_FALSE action @@ -530,8 +531,8 @@ group gameGrp rect IGNORE_X IGNHEAD_Y (PLAYER_C*IGNORE_W2) IGNHEAD_H text "Player Name" - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textalignx IGNORE_TOFF visible MENU_FALSE type ITEM_TYPE_TEXT @@ -543,8 +544,8 @@ group gameGrp rect (IGNORE_X+(PLAYER_C*IGNORE_W2)) IGNHEAD_Y (IGN_C*IGNORE_W2) IGNHEAD_H text "Ignored" - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER visible MENU_FALSE type ITEM_TYPE_TEXT textscale .225 @@ -555,8 +556,8 @@ group gameGrp rect (IGNORE_X+((PLAYER_C+IGN_C)*IGNORE_W2)) IGNHEAD_Y (IGNY_C*IGNORE_W2) IGNHEAD_H text "Ignoring You" - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER visible MENU_FALSE type ITEM_TYPE_TEXT textscale .225 @@ -581,9 +582,9 @@ feeder FEEDER_IGNORE_LIST visible MENU_FALSE columns 3 - IGNORE_TOFF ((PLAYER_C*IGNORE_W)-(3*IGNORE_TOFF)) ITEM_ALIGN_LEFT - (IGNORE_TOFF+((PLAYER_C)*IGNORE_W)) ((IGN_C*IGNORE_W)-(3*IGNORE_TOFF)) ITEM_ALIGN_CENTER - (IGNORE_TOFF+((PLAYER_C+IGN_C)*IGNORE_W)) ((IGNY_C*IGNORE_W)-(3*IGNORE_TOFF)) ITEM_ALIGN_CENTER + IGNORE_TOFF ((PLAYER_C*IGNORE_W)-(3*IGNORE_TOFF)) ALIGN_LEFT + (IGNORE_TOFF+((PLAYER_C)*IGNORE_W)) ((IGN_C*IGNORE_W)-(3*IGNORE_TOFF)) ALIGN_CENTER + (IGNORE_TOFF+((PLAYER_C+IGN_C)*IGNORE_W)) ((IGNY_C*IGNORE_W)-(3*IGNORE_TOFF)) ALIGN_CENTER doubleClick { play "sound/misc/menu1.wav"; @@ -599,8 +600,8 @@ style WINDOW_STYLE_EMPTY rect IGNBUTT_X IGNBUTT_Y IGNBUTT_W IGNBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_FALSE @@ -619,8 +620,8 @@ style WINDOW_STYLE_EMPTY rect (IGNBUTT_X+IGNBUTT_W) IGNBUTT_Y IGNBUTT_W IGNBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_FALSE @@ -642,8 +643,8 @@ style WINDOW_STYLE_EMPTY text "Server Name:" cvar ui_serverinfo_hostname - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx INFO_OFF textscale .25 forecolor 1 1 1 1 @@ -660,8 +661,8 @@ style WINDOW_STYLE_EMPTY text "Time Limit:" cvar ui_serverinfo_timelimit - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx INFO_OFF textscale .25 forecolor 1 1 1 1 @@ -678,8 +679,8 @@ style WINDOW_STYLE_EMPTY text "Sudden Death Time:" cvar ui_serverinfo_sd - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx INFO_OFF textscale .25 forecolor 1 1 1 1 @@ -696,8 +697,8 @@ style WINDOW_STYLE_EMPTY text "Max Clients:" cvar ui_serverinfo_maxclients - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx INFO_OFF textscale .25 forecolor 1 1 1 1 @@ -714,8 +715,8 @@ style WINDOW_STYLE_EMPTY text "Map Name:" cvar ui_serverinfo_mapname - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx INFO_OFF textscale .25 forecolor 1 1 1 1 @@ -732,8 +733,8 @@ style WINDOW_STYLE_EMPTY text "Lag Correction:" cvar ui_serverinfo_unlagged - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx INFO_OFF textscale .25 forecolor 1 1 1 1 @@ -751,8 +752,8 @@ text "Friendly Fire:" cvarFloat ui_serverinfo_ff 0 0 7 cvarFloatList { "Off" 0 "Humans Only" 1 "Aliens Only" 2 "Both Teams" 3 "Buildables Only" 4 "Humans and Buildables" 5 "Aliens and Buildables" 6 "Both Teams and Buildables" 7 } - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx INFO_OFF textscale .25 forecolor 1 1 1 1 @@ -769,8 +770,8 @@ style WINDOW_STYLE_EMPTY text "Version:" cvar ui_serverinfo_version - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx INFO_OFF textscale .25 forecolor 1 1 1 1 diff --git a/ui/ingame_leave.menu b/ui/ingame_leave.menu index 38fcb931..5aa5cc78 100644 --- a/ui/ingame_leave.menu +++ b/ui/ingame_leave.menu @@ -25,6 +25,7 @@ outOfBoundsClick // this closes the window if it gets a click out of the rectangle rect X Y W H focusColor 1 .75 0 1 + aspectBias ALIGN_LEFT onOpen { show grpMenu; @@ -53,8 +54,8 @@ group grpMenu style WINDOW_STYLE_EMPTY rect L1_X L1_Y L1_W L1_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_TRUE @@ -74,8 +75,8 @@ text "Quit" style WINDOW_STYLE_EMPTY rect L2_X L2_Y L2_W L2_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_TRUE @@ -98,8 +99,8 @@ group grpConfirm style WINDOW_STYLE_EMPTY rect L1_X L1_Y L1_W L1_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 decoration forecolor 1 1 1 1 @@ -115,8 +116,8 @@ textscale .25 style WINDOW_STYLE_EMPTY rect L2_X L2_Y (L2_W/2) L2_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -135,8 +136,8 @@ textscale .25 style WINDOW_STYLE_EMPTY rect (L2_X+(L2_W/2)) L2_Y (L2_W/2) L2_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -154,8 +155,8 @@ group grpConfirm style WINDOW_STYLE_EMPTY rect L1_X L1_Y L1_W L1_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 decoration @@ -171,8 +172,8 @@ textscale .25 style WINDOW_STYLE_EMPTY rect L2_X L2_Y (L2_W/2) L2_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -191,8 +192,8 @@ textscale .25 style WINDOW_STYLE_EMPTY rect (L2_X+(L2_W/2)) L2_Y (L2_W/2) L2_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action diff --git a/ui/ingame_options.menu b/ui/ingame_options.menu index 3f2978a4..fe8c5e37 100644 --- a/ui/ingame_options.menu +++ b/ui/ingame_options.menu @@ -34,6 +34,7 @@ outOfBoundsClick // this closes the window if it gets a click out of the rectangle rect X Y W H focusColor 1 .75 0 1 + aspectBias ALIGN_LEFT onopen { hide optionsGrp; @@ -67,8 +68,8 @@ style WINDOW_STYLE_EMPTY rect (W-((3*TOPBUTT_W)+BORDER)) BORDER TOPBUTT_W TOPBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .35 forecolor 1 1 1 1 visible MENU_TRUE @@ -92,8 +93,8 @@ style WINDOW_STYLE_EMPTY rect (W-((2*TOPBUTT_W)+BORDER)) BORDER TOPBUTT_W TOPBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .35 forecolor 1 1 1 1 visible MENU_TRUE @@ -118,8 +119,8 @@ style WINDOW_STYLE_EMPTY rect (W-((1*TOPBUTT_W)+BORDER)) BORDER TOPBUTT_W TOPBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .35 forecolor 1 1 1 1 visible MENU_TRUE @@ -148,8 +149,8 @@ cvar "name" maxchars 40 rect CONTENT_X (CONTENT_Y+(0*ELEM_H)) CONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx CONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -164,8 +165,8 @@ text "Auto Download:" cvar "cl_allowDownload" rect CONTENT_X (CONTENT_Y+(1*ELEM_H)) CONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx CONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -184,8 +185,8 @@ text "Taunts Sounds Off:" cvar "cg_noTaunt" rect CONTENT_X (CONTENT_Y+(2*ELEM_H)) CONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx CONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -204,8 +205,8 @@ text "Team Chats Only:" cvar "cg_teamChatsOnly" rect CONTENT_X (CONTENT_Y+(3*ELEM_H)) CONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx CONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -224,8 +225,8 @@ text "Auto Wallwalk Pitching:" cvar "cg_wwFollow" rect CONTENT_X (CONTENT_Y+(4*ELEM_H)) CONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx CONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -245,8 +246,8 @@ cvarfloat "cg_wwSmoothTime" 300 0 1000 cvarFloatList { "Medium" 300 "Fast" 150 "Instant" 0 "Slow" 600 } rect CONTENT_X (CONTENT_Y+(5*ELEM_H)) CONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx CONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -265,8 +266,8 @@ text "Wallwalk Control Toggles:" cvar "cg_wwToggle" rect CONTENT_X (CONTENT_Y+(6*ELEM_H)) CONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx CONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -285,8 +286,8 @@ text "Disable Warning Dialogs:" cvar "cg_disableWarningDialogs" rect CONTENT_X (CONTENT_Y+(7*ELEM_H)) CONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx CONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -305,8 +306,8 @@ text "Tutorial Mode:" cvar "cg_tutorial" rect CONTENT_X (CONTENT_Y+(8*ELEM_H)) CONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx CONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -326,8 +327,8 @@ cvar "cg_drawClock" cvarFloatList { "No" 0 "12 Hour" 1 "24 Hour" 2 } rect CONTENT_X (CONTENT_Y+(9*ELEM_H)) CONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx CONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -347,8 +348,8 @@ cvar "cg_drawCrosshair" cvarFloatList { "Never" 0 "Ranged Weapons Only" 1 "Always" 2 } rect CONTENT_X (CONTENT_Y+(10*ELEM_H)) CONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx CONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -370,8 +371,8 @@ style WINDOW_STYLE_EMPTY rect 0 ((2*BORDER)+TOPBUTT_H+(0*SIDEBUTT_H)) SIDEBUTT_W SIDEBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_FALSE @@ -394,8 +395,8 @@ text "Lookup:" cvar "+lookup" rect SCONTENT_X (SCONTENT_Y+(0*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -414,8 +415,8 @@ text "Look Down:" cvar "+lookdown" rect SCONTENT_X (SCONTENT_Y+(1*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -434,8 +435,8 @@ text "Mouse Look:" cvar "+mlook" rect SCONTENT_X (SCONTENT_Y+(2*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -454,8 +455,8 @@ text "Centerview:" cvar "centerview" rect SCONTENT_X (SCONTENT_Y+(3*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -474,8 +475,8 @@ text "Free Look:" cvar "cl_freelook" rect SCONTENT_X (SCONTENT_Y+(4*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -494,8 +495,8 @@ text "Mouse Sensitivity:" cvarfloat "sensitivity" 5 1 30 rect SCONTENT_X (SCONTENT_Y+(5*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -510,8 +511,8 @@ text "Invert Mouse:" cvar "ui_mousePitch" rect SCONTENT_X (SCONTENT_Y+(6*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -531,8 +532,8 @@ text "Smooth Mouse:" cvar "m_filter" rect SCONTENT_X (SCONTENT_Y+(7*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -553,8 +554,8 @@ style WINDOW_STYLE_EMPTY rect 0 ((2*BORDER)+TOPBUTT_H+(1*SIDEBUTT_H)) SIDEBUTT_W SIDEBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_FALSE @@ -575,8 +576,8 @@ text "Always Run:" cvar "cl_run" rect SCONTENT_X (SCONTENT_Y+(0*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -595,8 +596,8 @@ text "Run / Walk:" cvar "+speed" rect SCONTENT_X (SCONTENT_Y+(1*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -615,8 +616,8 @@ text "Sprint:" cvar "boost" rect SCONTENT_X (SCONTENT_Y+(2*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -635,8 +636,8 @@ text "Forward:" cvar "+forward" rect SCONTENT_X (SCONTENT_Y+(3*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -655,8 +656,8 @@ text "Backpedal:" cvar "+back" rect SCONTENT_X (SCONTENT_Y+(4*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -675,8 +676,8 @@ text "Move Left:" cvar "+moveleft" rect SCONTENT_X (SCONTENT_Y+(5*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -695,8 +696,8 @@ text "Move Right:" cvar "+moveright" rect SCONTENT_X (SCONTENT_Y+(6*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -715,8 +716,8 @@ text "Jump:" cvar "+moveup" rect SCONTENT_X (SCONTENT_Y+(7*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -735,8 +736,8 @@ text "Crouch:" cvar "+movedown" rect SCONTENT_X (SCONTENT_Y+(8*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -755,8 +756,8 @@ text "Turn Left:" cvar "+left" rect SCONTENT_X (SCONTENT_Y+(9*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -775,8 +776,8 @@ text "Turn Right:" cvar "+right" rect SCONTENT_X (SCONTENT_Y+(10*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -795,8 +796,8 @@ text "Strafe:" cvar "+strafe" rect SCONTENT_X (SCONTENT_Y+(11*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -819,8 +820,8 @@ style WINDOW_STYLE_EMPTY rect 0 ((2*BORDER)+TOPBUTT_H+(2*SIDEBUTT_H)) SIDEBUTT_W SIDEBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_FALSE @@ -841,8 +842,8 @@ text "Primary Attack:" cvar "+attack" rect SCONTENT_X (SCONTENT_Y+(0*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -861,8 +862,8 @@ text "Secondary Attack:" cvar "+button5" rect SCONTENT_X (SCONTENT_Y+(1*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -881,8 +882,8 @@ text "Previous Upgrade:" cvar "weapprev" rect SCONTENT_X (SCONTENT_Y+(2*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -901,8 +902,8 @@ text "Next Upgrade:" cvar "weapnext" rect SCONTENT_X (SCONTENT_Y+(3*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -921,8 +922,8 @@ text "Activate Upgrade:" cvar "+button2" rect SCONTENT_X (SCONTENT_Y+(4*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -941,8 +942,8 @@ text "Reload:" cvar "reload" rect SCONTENT_X (SCONTENT_Y+(5*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -961,8 +962,8 @@ text "Buy Ammo:" cvar "buy ammo" rect SCONTENT_X (SCONTENT_Y+(6*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -981,8 +982,8 @@ text "Use Medkit:" cvar "itemact medkit" rect SCONTENT_X (SCONTENT_Y+(7*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1003,8 +1004,8 @@ style WINDOW_STYLE_EMPTY rect 0 ((2*BORDER)+TOPBUTT_H+(3*SIDEBUTT_H)) SIDEBUTT_W SIDEBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_FALSE @@ -1025,8 +1026,8 @@ text "Show Scores:" cvar "+scores" rect SCONTENT_X (SCONTENT_Y+(0*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1045,8 +1046,8 @@ text "Scroll Scores Up:" cvar "scoresUp" rect SCONTENT_X (SCONTENT_Y+(1*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1065,8 +1066,8 @@ text "Scroll Scores Down:" cvar "scoresDown" rect SCONTENT_X (SCONTENT_Y+(2*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1085,8 +1086,8 @@ text "Use Structure/Evolve:" cvar "+button7" rect SCONTENT_X (SCONTENT_Y+(3*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1105,8 +1106,8 @@ text "Deconstruct Structure:" cvar "deconstruct" rect SCONTENT_X (SCONTENT_Y+(4*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1125,8 +1126,8 @@ text "Gesture:" cvar "+button3" rect SCONTENT_X (SCONTENT_Y+(5*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1145,8 +1146,8 @@ text "Chat:" cvar "messagemode" rect SCONTENT_X (SCONTENT_Y+(6*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1165,8 +1166,8 @@ text "Team Chat:" cvar "messagemode2" rect SCONTENT_X (SCONTENT_Y+(7*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1185,8 +1186,8 @@ text "Vote Yes:" cvar "vote yes" rect SCONTENT_X (SCONTENT_Y+(8*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1205,8 +1206,8 @@ text "Vote No:" cvar "vote no" rect SCONTENT_X (SCONTENT_Y+(9*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1225,8 +1226,8 @@ text "Team Vote Yes:" cvar "teamvote yes" rect SCONTENT_X (SCONTENT_Y+(10*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1245,8 +1246,8 @@ text "Team Vote No:" cvar "teamvote no" rect SCONTENT_X (SCONTENT_Y+(11*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1270,8 +1271,8 @@ style WINDOW_STYLE_EMPTY rect 0 ((2*BORDER)+TOPBUTT_H+(0*SIDEBUTT_H)) SIDEBUTT_W SIDEBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_FALSE @@ -1295,8 +1296,8 @@ cvar "ui_glCustom" cvarFloatList { "High Quality" 0 "Normal" 1 "Fast" 2 "Fastest" 3 "Custom" 4 } rect SCONTENT_X (SCONTENT_Y+(0*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1316,8 +1317,8 @@ text "GL Extensions:" cvar "r_allowExtensions" rect SCONTENT_X (SCONTENT_Y+(1*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1340,8 +1341,8 @@ "800x600" 4 "960x720" 5 "1024x768" 6 "1152x864" 7 "1280x1024" 8 "1600x1200" 9 "2048x1536" 10 "856x480 wide screen" 11 } rect SCONTENT_X (SCONTENT_Y+(2*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1362,8 +1363,8 @@ cvar "r_colorbits" cvarFloatList { "Default" 0 "16 bit" 16 "32 bit" 32 } rect SCONTENT_X (SCONTENT_Y+(3*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1384,8 +1385,8 @@ text "Fullscreen:" cvar "r_fullscreen" rect SCONTENT_X (SCONTENT_Y+(4*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1406,8 +1407,8 @@ cvar "r_vertexlight" cvarFloatList { "Light Map (high)" 0 "Vertex (low)" 1 } rect SCONTENT_X (SCONTENT_Y+(5*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1428,8 +1429,8 @@ cvar "r_lodbias" cvarFloatList { "High" 0 "Medium" 1 "Low" 2 } rect SCONTENT_X (SCONTENT_Y+(6*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1451,8 +1452,8 @@ cvar "r_picmip" cvarFloatList { "Low" 2 "Normal" 1 "High" 0 } rect SCONTENT_X (SCONTENT_Y+(7*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1473,8 +1474,8 @@ cvar "r_texturebits" cvarFloatList { "Default" 0 "16 bit" 16 "32 bit" 32 } rect SCONTENT_X (SCONTENT_Y+(8*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1494,8 +1495,8 @@ cvar "r_texturemode" cvarStrList { "Bilinear", "GL_LINEAR_MIPMAP_NEAREST", "Trilinear", "GL_LINEAR_MIPMAP_LINEAR" } rect SCONTENT_X (SCONTENT_Y+(9*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1515,8 +1516,8 @@ text "Anisotropic Filtering:" cvar "r_ext_texture_filter_anisotropic" rect SCONTENT_X (SCONTENT_Y+(10*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1536,8 +1537,8 @@ text "Compress Textures:" cvar "r_ext_compressed_textures " rect SCONTENT_X (SCONTENT_Y+(11*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1558,8 +1559,8 @@ textscale .25 style WINDOW_STYLE_EMPTY rect SCONTENT_X (SCONTENT_Y+(13*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_FALSE action @@ -1579,8 +1580,8 @@ style WINDOW_STYLE_EMPTY rect 0 ((2*BORDER)+TOPBUTT_H+(1*SIDEBUTT_H)) SIDEBUTT_W SIDEBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_FALSE @@ -1601,8 +1602,8 @@ text "Brightness:" cvarfloat "r_gamma" 1 .5 2 rect SCONTENT_X (SCONTENT_Y+(0*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1617,8 +1618,8 @@ text "Screen Size:" cvarfloat "cg_viewsize" 100 30 100 rect SCONTENT_X (SCONTENT_Y+(1*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1633,8 +1634,8 @@ text "Marks On Walls:" cvar "cg_marks" rect SCONTENT_X (SCONTENT_Y+(2*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1653,8 +1654,8 @@ text "Dynamic Lights:" cvar "r_dynamiclight" rect SCONTENT_X (SCONTENT_Y+(3*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1673,8 +1674,8 @@ text "Draw Gun:" cvar "cg_drawGun" rect SCONTENT_X (SCONTENT_Y+(4*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1693,8 +1694,8 @@ text "Low Quality Sky:" cvar "r_fastsky" rect SCONTENT_X (SCONTENT_Y+(5*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1713,8 +1714,8 @@ text "Sync Every Frame:" cvar "r_finish" rect SCONTENT_X (SCONTENT_Y+(6*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1733,8 +1734,8 @@ text "Show Time:" cvar "cg_drawTimer" rect SCONTENT_X (SCONTENT_Y+(7*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1753,8 +1754,8 @@ text "In Game Videos:" cvar "r_inGameVideo" rect SCONTENT_X (SCONTENT_Y+(8*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1773,8 +1774,8 @@ text "Depth Sort Particles:" cvar "cg_depthSortParticles" rect SCONTENT_X (SCONTENT_Y+(9*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1794,8 +1795,8 @@ cvar "cg_bounceParticles" cvarFloatList { "Low Quality" 0 "High Quality" 1 } rect SCONTENT_X (SCONTENT_Y+(10*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1815,8 +1816,8 @@ cvar "cg_lightFlare" cvarFloatList { "Off" 0 "No Fade" 1 "Timed Fade" 2 "Real Fade" 3 } rect SCONTENT_X (SCONTENT_Y+(11*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1837,8 +1838,8 @@ style WINDOW_STYLE_EMPTY rect 0 ((2*BORDER)+TOPBUTT_H+(2*SIDEBUTT_H)) SIDEBUTT_W SIDEBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_FALSE @@ -1858,8 +1859,8 @@ rect SCONTENT_X SCONTENT_Y SCONTENT_W (H-(SCONTENT_Y+BORDER)) ownerdraw UI_GLINFO textscale .25 - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_TOP + textalign ALIGN_LEFT + textvalign VALIGN_TOP textalignx 4 textaligny 4 forecolor 1 1 1 1 @@ -1877,8 +1878,8 @@ style WINDOW_STYLE_EMPTY rect 0 ((2*BORDER)+TOPBUTT_H+(3*SIDEBUTT_H)) SIDEBUTT_W SIDEBUTT_H type ITEM_TYPE_BUTTON - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_FALSE @@ -1898,8 +1899,8 @@ style WINDOW_STYLE_FILLED text "Sound" rect SCONTENT_X (SCONTENT_Y+(0*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_FALSE @@ -1918,8 +1919,8 @@ text "Effects Volume:" cvarfloat "s_volume" 0.7 0 1 rect SCONTENT_X (SCONTENT_Y+(1*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1934,8 +1935,8 @@ text "Music Volume:" cvarfloat "s_musicvolume" 0.25 0 1 rect SCONTENT_X (SCONTENT_Y+(2*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1950,8 +1951,8 @@ text "OpenAL:" cvar "s_useOpenAL" rect SCONTENT_X (SCONTENT_Y+(3*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1971,8 +1972,8 @@ cvar "s_khz" cvarFloatList { "44 khz (very high)" 44 "22 khz (high)" 22 "11 khz (low)" 11 } rect SCONTENT_X (SCONTENT_Y+(4*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -1991,8 +1992,8 @@ text "Doppler Sound:" cvar "s_doppler" rect SCONTENT_X (SCONTENT_Y+(5*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -2010,8 +2011,8 @@ style WINDOW_STYLE_FILLED text "Network" rect SCONTENT_X (SCONTENT_Y+(7*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_FALSE @@ -2031,8 +2032,8 @@ cvar "rate" cvarFloatList { "<=28.8k" 2500 "33.6k" 3000 "56k" 4000 "ISDN" 5000 "LAN/CABLE/xDSl" 25000 } rect SCONTENT_X (SCONTENT_Y+(8*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx SCONTENT_OFF textscale .25 forecolor 1 1 1 1 @@ -2052,8 +2053,8 @@ textscale .25 style WINDOW_STYLE_EMPTY rect SCONTENT_X (SCONTENT_Y+(10*ELEM_H)) SCONTENT_W ELEM_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_FALSE action diff --git a/ui/joinserver.menu b/ui/joinserver.menu index e169183e..b9bc9540 100644 --- a/ui/joinserver.menu +++ b/ui/joinserver.menu @@ -53,6 +53,7 @@ focusColor 1 .75 0 1 outOfBoundsClick style WINDOW_STYLE_EMPTY + aspectBias ASPECT_NONE onOpen { uiScript InitServerList 3; @@ -85,8 +86,8 @@ style WINDOW_STYLE_EMPTY ownerdraw UI_NETSOURCE rect TOP_X TOP_Y TOPBUTT_W TOPBUTT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_TOP + textalign ALIGN_LEFT + textvalign VALIGN_TOP textalignx TOP_TOFF_X textaligny TOP_TOFF_Y textscale .4 @@ -109,8 +110,8 @@ textscale .4 style WINDOW_STYLE_EMPTY rect (TOP_X+TOPBUTT_W) TOP_Y TOPBUTT_W TOPBUTT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_TOP + textalign ALIGN_LEFT + textvalign VALIGN_TOP textalignx TOP_TOFF_X textaligny TOP_TOFF_Y backcolor .5 .5 .5 .5 @@ -131,8 +132,8 @@ style WINDOW_STYLE_EMPTY type ITEM_TYPE_BUTTON rect (TOP_X+(2*TOPBUTT_W)) TOP_Y TOPBUTT_W TOPBUTT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_TOP + textalign ALIGN_LEFT + textvalign VALIGN_TOP textalignx TOP_TOFF_X textaligny TOP_TOFF_Y backcolor .5 .5 .5 .5 @@ -154,8 +155,8 @@ cvar "ui_browserShowEmpty" textscale .4 rect TOP_X (TOP_Y+TOPBUTT_H) TOPBUTT_W TOPBUTT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_TOP + textalign ALIGN_LEFT + textvalign VALIGN_TOP textalignx TOP_TOFF_X textaligny TOP_TOFF_Y forecolor 1 1 1 1 @@ -177,8 +178,8 @@ cvar "ui_browserShowFull" textscale .4 rect (TOP_X+TOPBUTT_W) (TOP_Y+TOPBUTT_H) TOPBUTT_W TOPBUTT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_TOP + textalign ALIGN_LEFT + textvalign VALIGN_TOP textalignx TOP_TOFF_X textaligny TOP_TOFF_Y forecolor 1 1 1 1 @@ -217,8 +218,8 @@ textscale .33 style WINDOW_STYLE_EMPTY rect LIST_X LIST_Y (SERVER_C*LIST_W) HEADFOOT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textalignx LIST_TOFF border WINDOW_BORDER_FULL bordercolor 0.5 0.5 0.5 1 @@ -259,8 +260,8 @@ textscale .33 style WINDOW_STYLE_EMPTY rect (LIST_X+(SERVER_C*LIST_W)) LIST_Y (MAP_C*LIST_W) HEADFOOT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textalignx LIST_TOFF border WINDOW_BORDER_FULL bordercolor 0.5 0.5 0.5 1 @@ -301,8 +302,8 @@ textscale .33 style WINDOW_STYLE_EMPTY rect (LIST_X+((SERVER_C+MAP_C)*LIST_W)) LIST_Y (PLAYERS_C*LIST_W) HEADFOOT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textalignx LIST_TOFF border WINDOW_BORDER_FULL bordercolor 0.5 0.5 0.5 1 @@ -343,8 +344,8 @@ textscale .33 style WINDOW_STYLE_EMPTY rect (LIST_X+((SERVER_C+MAP_C+PLAYERS_C)*LIST_W)) LIST_Y (PING_C*LIST_W) HEADFOOT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textalignx LIST_TOFF border WINDOW_BORDER_FULL bordercolor 0.5 0.5 0.5 1 @@ -396,10 +397,10 @@ outlinecolor 0.1 0.1 0.1 0.5 visible MENU_TRUE columns 4 - LIST_TOFF ((SERVER_C*LIST_W)-(3*LIST_TOFF)) ITEM_ALIGN_LEFT - (LIST_TOFF+((SERVER_C)*LIST_W)) ((MAP_C*LIST_W)-(3*LIST_TOFF)) ITEM_ALIGN_LEFT - (LIST_TOFF+((SERVER_C+MAP_C)*LIST_W)) ((PLAYERS_C*LIST_W)-(3*LIST_TOFF)) ITEM_ALIGN_LEFT - (LIST_TOFF+((SERVER_C+MAP_C+PLAYERS_C)*LIST_W)) ((PING_C*LIST_W)-(3*LIST_TOFF)) ITEM_ALIGN_LEFT + LIST_TOFF ((SERVER_C*LIST_W)-(3*LIST_TOFF)) ALIGN_LEFT + (LIST_TOFF+((SERVER_C)*LIST_W)) ((MAP_C*LIST_W)-(3*LIST_TOFF)) ALIGN_LEFT + (LIST_TOFF+((SERVER_C+MAP_C)*LIST_W)) ((PLAYERS_C*LIST_W)-(3*LIST_TOFF)) ALIGN_LEFT + (LIST_TOFF+((SERVER_C+MAP_C+PLAYERS_C)*LIST_W)) ((PING_C*LIST_W)-(3*LIST_TOFF)) ALIGN_LEFT doubleClick { uiScript JoinServer } } @@ -413,8 +414,8 @@ ownerdraw UI_SERVERREFRESHDATE textscale .33 rect LIST_X (LIST_Y+(LIST_H-HEADFOOT_H)) (LIST_W/2) HEADFOOT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textalignx LIST_TOFF forecolor 1 1 1 1 border WINDOW_BORDER_FULL @@ -429,8 +430,8 @@ ownerdraw UI_SERVERMOTD textscale .33 rect (LIST_X+(LIST_W/2)) (LIST_Y+(LIST_H-HEADFOOT_H)) (LIST_W/2) HEADFOOT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textalignx LIST_TOFF forecolor 1 1 1 1 border WINDOW_BORDER_FULL @@ -450,8 +451,8 @@ textscale .4 style WINDOW_STYLE_EMPTY rect BOT_X BOT_Y BOTBUTT_W BOTBUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -469,8 +470,8 @@ textscale .4 style WINDOW_STYLE_EMPTY rect (BOT_X+BOTBUTT_W) BOT_Y BOTBUTT_W BOTBUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -489,8 +490,8 @@ style WINDOW_STYLE_EMPTY ownerdrawFlag UI_SHOW_NOTFAVORITESERVERS rect (BOT_X+(2*BOTBUTT_W)) BOT_Y BOTBUTT_W BOTBUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -509,8 +510,8 @@ style WINDOW_STYLE_EMPTY ownerdrawFlag UI_SHOW_FAVORITESERVERS rect (BOT_X+(2*BOTBUTT_W)) BOT_Y BOTBUTT_W BOTBUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -529,8 +530,8 @@ textscale .4 style WINDOW_STYLE_EMPTY rect (BOT_X+(3*BOTBUTT_W)) BOT_Y BOTBUTT_W BOTBUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -548,8 +549,8 @@ textscale .4 style WINDOW_STYLE_EMPTY rect (BOT_X+(4*BOTBUTT_W)) BOT_Y BOTBUTT_W BOTBUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -571,8 +572,8 @@ style WINDOW_STYLE_EMPTY type ITEM_TYPE_BUTTON rect (BCJ_X+ARROW_W) BCJ_Y (BCJ_W-(2*ARROW_W)) BCJ_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -589,6 +590,7 @@ style WINDOW_STYLE_SHADER background "ui/assets/backarrow.tga" rect BCJ_X BCJ_Y ARROW_H ARROW_W + aspectBias ALIGN_LEFT visible MENU_TRUE action { @@ -609,14 +611,15 @@ style WINDOW_STYLE_SHADER background "ui/assets/backarrow_alt.tga" rect BCJ_X BCJ_Y ARROW_H ARROW_W + aspectBias ALIGN_LEFT backcolor 0 0 0 0 forecolor 1 1 1 1 visible MENU_FALSE type ITEM_TYPE_BUTTON text "Back" - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textalignx ARROW_W textscale .6 @@ -641,6 +644,7 @@ name accept style WINDOW_STYLE_SHADER rect ((BCJ_X+BCJ_W)-ARROW_W) BCJ_Y ARROW_H ARROW_W + aspectBias ALIGN_RIGHT background "ui/assets/forwardarrow.tga" backcolor 0 0 0 0 forecolor 1 1 1 1 @@ -663,6 +667,7 @@ name accept_alt style WINDOW_STYLE_SHADER rect ((BCJ_X+BCJ_W)-ARROW_W) BCJ_Y ARROW_H ARROW_W + aspectBias ALIGN_RIGHT background "ui/assets/forwardarrow_alt.tga" backcolor 0 0 0 0 type ITEM_TYPE_BUTTON @@ -671,8 +676,8 @@ type ITEM_TYPE_BUTTON text "Join" - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx -ARROW_W textscale .6 diff --git a/ui/loading.menu b/ui/loading.menu index f7f35cfa..2b4af59c 100644 --- a/ui/loading.menu +++ b/ui/loading.menu @@ -53,6 +53,7 @@ name "Loading" rect 0 0 W H fullScreen MENU_TRUE + aspectBias ASPECT_NONE itemDef { @@ -71,8 +72,8 @@ visible MENU_TRUE decoration forecolor 1 1 1 1 - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textstyle ITEM_TEXTSTYLE_NORMAL textscale 0.4 ownerdraw CG_LOAD_LEVELNAME @@ -85,8 +86,8 @@ visible MENU_TRUE decoration forecolor 1 1 1 1 - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textstyle ITEM_TEXTSTYLE_NORMAL textscale 0.4 ownerdraw CG_LOAD_HOSTNAME @@ -99,8 +100,8 @@ visible MENU_TRUE decoration forecolor 1 1 1 1 - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textstyle ITEM_TEXTSTYLE_NORMAL textscale 0.4 ownerdraw CG_LOAD_MOTD @@ -128,7 +129,7 @@ decoration forecolor 0.0 0.8 1 1 ownerdraw CG_LOAD_MEDIA - textalign ITEM_ALIGN_CENTER + textalign ALIGN_CENTER textstyle ITEM_TEXTSTYLE_NEON textscale 0.5 special 1.0 @@ -140,8 +141,8 @@ style WINDOW_STYLE_EMPTY textscale 0.6 rect LABEL_X MEDIA_Y LABEL_W BAR_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER forecolor 0.0 0.8 1 1 visible MENU_TRUE decoration @@ -157,7 +158,7 @@ decoration forecolor 0.0 0.8 1 1 ownerdraw CG_LOAD_BUILDABLES - textalign ITEM_ALIGN_CENTER + textalign ALIGN_CENTER textstyle ITEM_TEXTSTYLE_NEON textscale 0.5 special 1.0 @@ -169,8 +170,8 @@ style WINDOW_STYLE_EMPTY textscale 0.6 rect LABEL_X BUILD_Y LABEL_W BAR_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER forecolor 0.0 0.8 1 1 visible MENU_TRUE decoration @@ -185,7 +186,7 @@ decoration forecolor 0.0 0.8 1 1 ownerdraw CG_LOAD_CHARMODEL - textalign ITEM_ALIGN_CENTER + textalign ALIGN_CENTER textstyle ITEM_TEXTSTYLE_NEON textscale 0.5 special 1.0 @@ -197,8 +198,8 @@ style WINDOW_STYLE_EMPTY textscale 0.6 rect LABEL_X CHAR_Y LABEL_W BAR_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER forecolor 0.0 0.8 1 1 visible MENU_TRUE decoration @@ -213,7 +214,7 @@ decoration forecolor 0.0 0.8 1 1 ownerdraw CG_LOAD_OVERALL - textalign ITEM_ALIGN_CENTER + textalign ALIGN_CENTER textstyle ITEM_TEXTSTYLE_NEON textscale 0.5 special 1.0 diff --git a/ui/main.menu b/ui/main.menu index d7745c3a..7e6f2612 100644 --- a/ui/main.menu +++ b/ui/main.menu @@ -29,6 +29,7 @@ visible MENU_TRUE // Visible on open focusColor 1 .75 0 1 // Menu focus color for text and items background "ui/assets/mainmenu.jpg" + aspectBias ASPECT_NONE onOpen { uiScript stopRefresh ; playlooped "sound/ui/heartbeat.wav" } onESC { open quit_popmenu } @@ -60,7 +61,7 @@ style WINDOW_STYLE_EMPTY textstyle ITEM_TEXTSTYLE_NORMAL rect X Y W ELEM_H - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textscale .416 forecolor 1 1 1 1 visible MENU_TRUE @@ -80,7 +81,7 @@ textstyle ITEM_TEXTSTYLE_NORMAL textscale .416 rect X (Y+ELEM_H) W ELEM_H - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT backcolor 0 0 0 0 forecolor 1 1 1 1 visible MENU_TRUE @@ -100,7 +101,7 @@ textstyle ITEM_TEXTSTYLE_NORMAL textscale .416 rect X (Y+(2*ELEM_H)) W ELEM_H - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT backcolor 0 0 0 0 forecolor 1 1 1 1 visible MENU_TRUE @@ -120,7 +121,7 @@ textstyle ITEM_TEXTSTYLE_NORMAL rect X (Y+(3*ELEM_H)) W ELEM_H textscale .416 - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT forecolor 1 1 1 1 visible MENU_TRUE action @@ -138,7 +139,7 @@ textstyle ITEM_TEXTSTYLE_NORMAL textscale .25 rect 0 450 640 10 - textalign ITEM_ALIGN_CENTER + textalign ALIGN_CENTER forecolor .75 .75 .75 .75 visible MENU_TRUE decoration diff --git a/ui/menudef.h b/ui/menudef.h index 42196031..3e5abcaa 100644 --- a/ui/menudef.h +++ b/ui/menudef.h @@ -16,13 +16,14 @@ #define ITEM_TYPE_MULTI 12 // multiple list setting, enumerated #define ITEM_TYPE_BIND 13 // multiple list setting, enumerated -#define ITEM_ALIGN_LEFT 0 // left alignment -#define ITEM_ALIGN_CENTER 1 // center alignment -#define ITEM_ALIGN_RIGHT 2 // right alignment - -#define ITEM_VALIGN_BOTTOM 0 // bottom alignment -#define ITEM_VALIGN_CENTER 1 // center alignment -#define ITEM_VALIGN_TOP 2 // top alignment +#define ALIGN_LEFT 0 // left alignment +#define ALIGN_CENTER 1 // center alignment +#define ALIGN_RIGHT 2 // right alignment +#define ASPECT_NONE 3 // no aspect compensation + +#define VALIGN_BOTTOM 0 // bottom alignment +#define VALIGN_CENTER 1 // center alignment +#define VALIGN_TOP 2 // top alignment #define ITEM_TEXTSTYLE_NORMAL 0 // normal text #define ITEM_TEXTSTYLE_BLINK 1 // fast blinking diff --git a/ui/mod.menu b/ui/mod.menu index 88045167..38bee621 100644 --- a/ui/mod.menu +++ b/ui/mod.menu @@ -75,8 +75,8 @@ type ITEM_TYPE_BUTTON textscale .25 rect (W-(2*BUTT_W)) (H-BUTT_H) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -94,8 +94,8 @@ type ITEM_TYPE_BUTTON textscale .25 rect (W-BUTT_W) (H-BUTT_H) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action diff --git a/ui/options.menu b/ui/options.menu index eb9c823c..9959949d 100644 --- a/ui/options.menu +++ b/ui/options.menu @@ -52,9 +52,9 @@ cvar "name" maxchars 26 rect X Y W ELEM_H - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textalignx TOFF_X - textvalign ITEM_VALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_TRUE @@ -67,9 +67,9 @@ cvar "ui_glCustom" cvarFloatList { "High Quality" 0 "Normal" 1 "Fast" 2 "Fastest" 3 "Custom" 4 } rect X (Y+ELEM_H) W ELEM_H - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textalignx TOFF_X - textvalign ITEM_VALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_TRUE @@ -89,9 +89,9 @@ "800x600" 4 "960x720" 5 "1024x768" 6 "1152x864" 7 "1280x1024" 8 "1600x1200" 9 "2048x1536" 10 "856x480 wide screen" 11 } rect X (Y+(2*ELEM_H)) W ELEM_H - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textalignx TOFF_X - textvalign ITEM_VALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_TRUE @@ -108,9 +108,9 @@ text "Video Brightness:" cvarfloat "r_gamma" 1 .5 2 rect X (Y+(3*ELEM_H)) W ELEM_H - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textalignx TOFF_X - textvalign ITEM_VALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_TRUE @@ -124,9 +124,9 @@ text "Effects Volume:" cvarfloat "s_volume" 0.7 0 1 rect X (Y+(4*ELEM_H)) W ELEM_H - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textalignx TOFF_X - textvalign ITEM_VALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_TRUE @@ -138,9 +138,9 @@ text "Music Volume:" cvarfloat "s_musicvolume" 0.25 0 1 rect X (Y+(5*ELEM_H)) W ELEM_H - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textalignx TOFF_X - textvalign ITEM_VALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_TRUE @@ -152,9 +152,9 @@ text "OpenAL Sound:" cvar "s_useOpenAL" rect X (Y+(6*ELEM_H)) W ELEM_H - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textalignx TOFF_X - textvalign ITEM_VALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_TRUE @@ -172,9 +172,9 @@ text "Mouse Sensitivity:" cvarfloat "sensitivity" 5 1 30 rect X (Y+(7*ELEM_H)) W ELEM_H - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textalignx TOFF_X - textvalign ITEM_VALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_TRUE @@ -186,9 +186,9 @@ text "Invert Mouse:" cvar "ui_mousePitch" rect X (Y+(8*ELEM_H)) W ELEM_H - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textalignx TOFF_X - textvalign ITEM_VALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_TRUE @@ -208,9 +208,9 @@ cvar "rate" cvarFloatList { "<=28.8k" 2500 "33.6k" 3000 "56k" 4000 "ISDN" 5000 "LAN/CABLE/xDSL" 25000 } rect X (Y+(9*ELEM_H)) W ELEM_H - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textalignx TOFF_X - textvalign ITEM_VALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_TRUE @@ -226,9 +226,9 @@ text "Allow Auto Download:" cvar "cl_allowDownload" rect X (Y+(10*ELEM_H)) W ELEM_H - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textalignx TOFF_X - textvalign ITEM_VALIGN_CENTER + textvalign VALIGN_CENTER textscale .25 forecolor 1 1 1 1 visible MENU_TRUE @@ -246,8 +246,8 @@ textstyle ITEM_TEXTSTYLE_NORMAL textscale .25 rect 0 (H-60) W 10 - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE decoration @@ -261,8 +261,8 @@ textscale .25 style WINDOW_STYLE_EMPTY rect (W-(2*BUTT_W)) (H-BUTT_H) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -279,8 +279,8 @@ textscale .25 style WINDOW_STYLE_EMPTY rect (W-BUTT_W) (H-BUTT_H) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action diff --git a/ui/password.menu b/ui/password.menu index 1ac91cc3..54d642e8 100644 --- a/ui/password.menu +++ b/ui/password.menu @@ -57,8 +57,8 @@ type ITEM_TYPE_EDITFIELD cvar "password" rect BORDER BORDER (W-(2*BORDER)) INPUT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE } @@ -71,8 +71,8 @@ textscale .25 style WINDOW_STYLE_EMPTY rect (W-BUTT_W) (H-BUTT_H) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action diff --git a/ui/ptrc.menu b/ui/ptrc.menu index c73e4b7d..ba744138 100644 --- a/ui/ptrc.menu +++ b/ui/ptrc.menu @@ -57,8 +57,8 @@ textscale .4 textstyle WINDOW_STYLE_SHADER rect INFO_X INFO_Y INFO_W INFO_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER decoration wrapped forecolor 1 1 1 1 @@ -72,8 +72,8 @@ type ITEM_TYPE_BUTTON textscale .4 rect (W-((2*BORDER)+(2*BUTT_W))) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -92,8 +92,8 @@ type ITEM_TYPE_BUTTON textscale .4 rect (W-(BORDER+BUTT_W)) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action diff --git a/ui/quit.menu b/ui/quit.menu index e3c6be24..6a6196ef 100644 --- a/ui/quit.menu +++ b/ui/quit.menu @@ -48,8 +48,8 @@ textscale .3 textstyle WINDOW_STYLE_SHADER rect 0 0 W ((2*H)/3) - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER decoration forecolor 1 1 1 1 visible MENU_TRUE @@ -63,8 +63,8 @@ type ITEM_TYPE_BUTTON textscale .25 rect 0 (H/3) (W/2) ((2*H)/3) - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -82,8 +82,8 @@ type ITEM_TYPE_BUTTON textscale .25 rect (W/2) (H/3) (W/2) ((2*H)/3) - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action diff --git a/ui/quitcredit.menu b/ui/quitcredit.menu index e628026c..82b11069 100644 --- a/ui/quitcredit.menu +++ b/ui/quitcredit.menu @@ -12,6 +12,7 @@ focusColor 1 .75 0 1 style WINDOW_STYLE_FILLED border WINDOW_BORDER_NONE + aspectBias ASPECT_NONE onEsc { uiScript "quit" @@ -65,7 +66,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 320 48 1 1 - textalign ITEM_ALIGN_CENTER + textalign ALIGN_CENTER textscale 0.75 textstyle ITEM_TEXTSTYLE_NORMAL text "CREDITS" @@ -81,7 +82,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 10 96 1 1 - textalign ITEM_ALIGN_LEFT + textalign ALIGN_LEFT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Tim 'Timbo' Angus" @@ -96,7 +97,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 630 96 1 1 - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Programming and Direction" @@ -112,7 +113,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 10 128 1 1 - textalign ITEM_ALIGN_LEFT + textalign ALIGN_LEFT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Nick 'jex' Jansens" @@ -127,7 +128,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 630 128 1 1 - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Mapping, texturing and 2D artwork" @@ -143,7 +144,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 10 160 1 1 - textalign ITEM_ALIGN_LEFT + textalign ALIGN_LEFT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Robin 'OverFlow' Marshall" @@ -158,7 +159,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 630 160 1 1 - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Modelling, animation and mapping" @@ -174,7 +175,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 10 192 1 1 - textalign ITEM_ALIGN_LEFT + textalign ALIGN_LEFT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Jan 'Stannum' van der Weg" @@ -189,7 +190,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 630 192 1 1 - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Texturing and mapping" @@ -205,7 +206,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 10 224 1 1 - textalign ITEM_ALIGN_LEFT + textalign ALIGN_LEFT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Mike 'Veda' McInerney" @@ -220,7 +221,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 630 224 1 1 - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Modelling, animation and texturing" @@ -236,7 +237,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 10 256 1 1 - textalign ITEM_ALIGN_LEFT + textalign ALIGN_LEFT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Gordon 'Godmil' Miller" @@ -251,7 +252,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 630 256 1 1 - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Mapping" @@ -267,7 +268,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 10 288 1 1 - textalign ITEM_ALIGN_LEFT + textalign ALIGN_LEFT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "'Who-[Soup]'" @@ -282,7 +283,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 630 288 1 1 - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Mapping" @@ -298,7 +299,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 10 320 1 1 - textalign ITEM_ALIGN_LEFT + textalign ALIGN_LEFT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Tristan 'jhrx' Blease" @@ -313,7 +314,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 630 320 1 1 - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Mapping" @@ -329,7 +330,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 10 352 1 1 - textalign ITEM_ALIGN_LEFT + textalign ALIGN_LEFT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Paul 'MoP' Greveson" @@ -344,7 +345,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 630 352 1 1 - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Modelling and texturing" @@ -360,7 +361,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 10 384 1 1 - textalign ITEM_ALIGN_LEFT + textalign ALIGN_LEFT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Chris 'Dolby' McCarthy" @@ -375,7 +376,7 @@ group grpidcredit style WINDOW_STYLE_EMPTY rect 630 384 1 1 - textalign ITEM_ALIGN_RIGHT + textalign ALIGN_RIGHT textscale 0.50 textstyle ITEM_TEXTSTYLE_NORMAL text "Sound" diff --git a/ui/say.menu b/ui/say.menu index 089b1fea..dea298c9 100644 --- a/ui/say.menu +++ b/ui/say.menu @@ -15,6 +15,7 @@ fullScreen MENU_FALSE visible MENU_TRUE rect X Y W H + aspectBias ALIGN_LEFT focusColor 1 1 1 1 style WINDOW_STYLE_EMPTY onOpen @@ -31,8 +32,8 @@ cvar "ui_sayBuffer" maxchars 128 rect 0 0 W H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textscale .5 forecolor 1 1 1 1 visible MENU_TRUE diff --git a/ui/serverinfo.menu b/ui/serverinfo.menu index 626788a6..04547b4f 100644 --- a/ui/serverinfo.menu +++ b/ui/serverinfo.menu @@ -61,10 +61,10 @@ notselectable visible MENU_TRUE columns 4 - 0 ((2*LEFT_C)*LIST_DW) ITEM_ALIGN_LEFT - (LEFT_C*LIST_DW) (LEFT_C*LIST_DW) ITEM_ALIGN_LEFT - ((2*LEFT_C)*LIST_DW) (LEFT_C*LIST_DW) ITEM_ALIGN_LEFT - ((1-RIGHT_C)*LIST_DW) (RIGHT_C*LIST_DW) ITEM_ALIGN_LEFT + 0 ((2*LEFT_C)*LIST_DW) ALIGN_LEFT + (LEFT_C*LIST_DW) (LEFT_C*LIST_DW) ALIGN_LEFT + ((2*LEFT_C)*LIST_DW) (LEFT_C*LIST_DW) ALIGN_LEFT + ((1-RIGHT_C)*LIST_DW) (RIGHT_C*LIST_DW) ALIGN_LEFT } // BUTTON // @@ -78,8 +78,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-(2*BUTT_W)) (H-BUTT_H) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action @@ -98,8 +98,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-BUTT_W) (H-BUTT_H) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER forecolor 1 1 1 1 visible MENU_TRUE action diff --git a/ui/teamscore.menu b/ui/teamscore.menu index bf9f0f07..e1f96e1b 100644 --- a/ui/teamscore.menu +++ b/ui/teamscore.menu @@ -44,8 +44,8 @@ itemDef { name alienteamname - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textalignx TOFF textscale 0.4 rect 0 0 (W/3) BAR_H @@ -58,8 +58,8 @@ itemDef { name stagereport - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale 0.33 rect (W/3) 0 (W/3) BAR_H forecolor 1 1 1 1 @@ -71,8 +71,8 @@ itemDef { name humanteamname - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textalignx -TOFF textscale 0.4 rect ((2*W)/3) 0 (W/3) BAR_H @@ -121,8 +121,8 @@ textscale .33 style WINDOW_STYLE_EMPTY rect (LLIST_L+10) (BAR_H+BORDER) 1 BAR_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER backcolor 0 0 0 0 forecolor 1 .75 0 1 decoration @@ -135,8 +135,8 @@ textscale .33 style WINDOW_STYLE_EMPTY rect (LLIST_L+50) (BAR_H+BORDER) 1 BAR_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER backcolor 0 0 0 0 forecolor 1 .75 0 1 decoration @@ -149,8 +149,8 @@ textscale .33 style WINDOW_STYLE_EMPTY rect (LLIST_R-95) (BAR_H+BORDER) 1 BAR_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER backcolor 0 0 0 0 forecolor 1 .75 0 1 decoration @@ -163,8 +163,8 @@ textscale .33 style WINDOW_STYLE_EMPTY rect (LLIST_R-55) (BAR_H+BORDER) 1 BAR_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER backcolor 0 0 0 0 forecolor 1 .75 0 1 decoration @@ -177,8 +177,8 @@ textscale .33 style WINDOW_STYLE_EMPTY rect (LLIST_R-15) (BAR_H+BORDER) 1 BAR_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER backcolor 0 0 0 0 forecolor 1 .75 0 1 decoration @@ -191,8 +191,8 @@ textscale .33 style WINDOW_STYLE_EMPTY rect (RLIST_L+10) (BAR_H+BORDER) 1 BAR_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER backcolor 0 0 0 0 forecolor 1 .75 0 1 decoration @@ -205,8 +205,8 @@ textscale .33 style WINDOW_STYLE_EMPTY rect (RLIST_L+50) (BAR_H+BORDER) 1 BAR_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER backcolor 0 0 0 0 forecolor 1 .75 0 1 decoration @@ -219,8 +219,8 @@ textscale .33 style WINDOW_STYLE_EMPTY rect (RLIST_R-95) (BAR_H+BORDER) 1 BAR_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER backcolor 0 0 0 0 forecolor 1 .75 0 1 decoration @@ -233,8 +233,8 @@ textscale .33 style WINDOW_STYLE_EMPTY rect (RLIST_R-55) (BAR_H+BORDER) 1 BAR_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER backcolor 0 0 0 0 forecolor 1 .75 0 1 decoration @@ -247,8 +247,8 @@ textscale .33 style WINDOW_STYLE_EMPTY rect (RLIST_R-15) (BAR_H+BORDER) 1 BAR_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER backcolor 0 0 0 0 forecolor 1 .75 0 1 decoration @@ -274,13 +274,13 @@ feeder FEEDER_ALIENTEAM_LIST notselectable columns 7 - 5 15 ITEM_ALIGN_LEFT - 21 15 ITEM_ALIGN_LEFT - 7 30 ITEM_ALIGN_LEFT - 45 ((W/2)-200) ITEM_ALIGN_LEFT - ((W/2)-120) 20 ITEM_ALIGN_RIGHT - ((W/2)-80) 20 ITEM_ALIGN_RIGHT - ((W/2)-40) 20 ITEM_ALIGN_RIGHT + 5 15 ALIGN_LEFT + 21 15 ALIGN_LEFT + 7 30 ALIGN_LEFT + 45 ((W/2)-200) ALIGN_LEFT + ((W/2)-120) 20 ALIGN_RIGHT + ((W/2)-80) 20 ALIGN_RIGHT + ((W/2)-40) 20 ALIGN_RIGHT } itemDef @@ -302,13 +302,13 @@ feeder FEEDER_HUMANTEAM_LIST notselectable columns 7 - 5 15 ITEM_ALIGN_LEFT - 21 15 ITEM_ALIGN_LEFT - 7 30 ITEM_ALIGN_LEFT - 45 ((W/2)-200) ITEM_ALIGN_LEFT - ((W/2)-120) 20 ITEM_ALIGN_RIGHT - ((W/2)-80) 20 ITEM_ALIGN_RIGHT - ((W/2)-40) 20 ITEM_ALIGN_RIGHT + 5 15 ALIGN_LEFT + 21 15 ALIGN_LEFT + 7 30 ALIGN_LEFT + 45 ((W/2)-200) ALIGN_LEFT + ((W/2)-120) 20 ALIGN_RIGHT + ((W/2)-80) 20 ALIGN_RIGHT + ((W/2)-40) 20 ALIGN_RIGHT } // spectators // @@ -335,8 +335,8 @@ style WINDOW_STYLE_FILLED forecolor 1 1 1 1 textscale .33 - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textalignx TOFF visible MENU_TRUE decoration @@ -349,7 +349,7 @@ style WINDOW_STYLE_FILLED forecolor 1 1 1 1 textscale .33 - textvalign ITEM_VALIGN_CENTER + textvalign VALIGN_CENTER visible MENU_TRUE ownerdraw CG_SPECTATORS decoration diff --git a/ui/tremulous_alien_builder_hud.menu b/ui/tremulous_alien_builder_hud.menu index 5274d707..e78eb0c4 100644 --- a/ui/tremulous_alien_builder_hud.menu +++ b/ui/tremulous_alien_builder_hud.menu @@ -11,6 +11,7 @@ fullScreen MENU_FALSE visible MENU_TRUE rect 0 0 W H + aspectBias ASPECT_NONE #include "ui/tremulous_alien_common_hud.h" #include "ui/tremulous_common_hud.h" @@ -20,6 +21,7 @@ { name "buildtimer" rect 567 410 25 25 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor 1.0 0.0 0.0 .5 @@ -31,6 +33,7 @@ { name "build-points" rect 483.5 421.5 60 15 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor 1.0 0.0 0.0 .5 diff --git a/ui/tremulous_alien_common_hud.h b/ui/tremulous_alien_common_hud.h index 6ac76733..321c00f0 100644 --- a/ui/tremulous_alien_common_hud.h +++ b/ui/tremulous_alien_common_hud.h @@ -11,6 +11,7 @@ itemDef { name "left-ring-circle" rect 47.5 410 25 25 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.25 @@ -23,6 +24,7 @@ itemDef { name "left-arm" rect 77 404.75 104 52.5 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.25 @@ -35,6 +37,7 @@ itemDef { name "left-arm-circle" rect 150 417.5 25 25 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.25 @@ -47,6 +50,7 @@ itemDef { name "right-ring-circle" rect 567 410 25 25 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.25 @@ -59,6 +63,7 @@ itemDef { name "right-arm" rect 459 404.75 104 52.5 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.25 @@ -75,6 +80,7 @@ itemDef { name "bolt" rect 52.5 412.5 15 20 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 @@ -87,6 +93,7 @@ itemDef { name "cross" rect 155 422.5 15 15 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 @@ -99,6 +106,7 @@ itemDef { name "left-ring" rect 7.25 369.5 90.5 106 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 @@ -111,6 +119,7 @@ itemDef { name "left-spikes" rect 18.5 381 59 83 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 1.0 @@ -123,6 +132,7 @@ itemDef { name "right-ring" rect 542.25 369.5 90.5 106 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 @@ -135,6 +145,7 @@ itemDef { name "right-spikes" rect 562.5 381 59 83 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 1.0 @@ -147,6 +158,7 @@ itemDef { name "health" rect 78.5 421.5 60 15 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B .5 @@ -158,6 +170,7 @@ itemDef { name "alien-icon" rect 465 417.5 25 25 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.6 @@ -169,6 +182,7 @@ itemDef { name "organs" rect 570.5 415.95 15 15 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B .5 diff --git a/ui/tremulous_alien_general_hud.menu b/ui/tremulous_alien_general_hud.menu index 62e8af86..509a5993 100644 --- a/ui/tremulous_alien_general_hud.menu +++ b/ui/tremulous_alien_general_hud.menu @@ -11,6 +11,7 @@ fullScreen MENU_FALSE visible MENU_TRUE rect 0 0 W H + aspectBias ASPECT_NONE #include "ui/tremulous_alien_common_hud.h" #include "ui/tremulous_common_hud.h" @@ -20,6 +21,7 @@ { name "blob" rect 479 419 57 18 + aspectBias ALIGN_RIGHT visible MENU_TRUE forecolor 1.0 0.0 0.0 0.5 background "ui/assets/alien/tremublob.tga" diff --git a/ui/tremulous_alienbuild.menu b/ui/tremulous_alienbuild.menu index 522d17f5..127b769d 100644 --- a/ui/tremulous_alienbuild.menu +++ b/ui/tremulous_alienbuild.menu @@ -79,8 +79,8 @@ style WINDOW_STYLE_EMPTY rect INFO_X INFO_Y INFO_W INFO_H textscale .33 - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_TOP + textalign ALIGN_LEFT + textvalign VALIGN_TOP textalignx INFO_TOFF textaligny INFO_TOFF border WINDOW_BORDER_FULL @@ -99,8 +99,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-((2*BORDER)+(2*BUTT_W))) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor 0 0 0 1 @@ -120,8 +120,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-(BORDER+BUTT_W)) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor 0 0 0 1 diff --git a/ui/tremulous_alienclass.menu b/ui/tremulous_alienclass.menu index ad891757..441e27fd 100644 --- a/ui/tremulous_alienclass.menu +++ b/ui/tremulous_alienclass.menu @@ -79,8 +79,8 @@ style WINDOW_STYLE_EMPTY rect INFO_X INFO_Y INFO_W INFO_H textscale .33 - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_TOP + textalign ALIGN_LEFT + textvalign VALIGN_TOP textalignx INFO_TOFF textaligny INFO_TOFF border WINDOW_BORDER_FULL @@ -99,8 +99,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect ((2*BORDER)+LIST_W) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 @@ -120,8 +120,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-((2*BORDER)+(2*BUTT_W))) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 @@ -141,8 +141,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-(BORDER+BUTT_W)) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 diff --git a/ui/tremulous_aliendialogs.menu b/ui/tremulous_aliendialogs.menu index 159afb02..e3d4f05c 100644 --- a/ui/tremulous_aliendialogs.menu +++ b/ui/tremulous_aliendialogs.menu @@ -47,8 +47,8 @@ textstyle ITEM_TEXTSTYLE_NORMAL style WINDOW_STYLE_EMPTY rect BORDER BORDER INFO_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 @@ -64,8 +64,8 @@ rect INFO_X INFO_Y INFO_W INFO_H cvar "ui_dialog" wrapped - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .33 forecolor 1 1 1 1 backcolor .5 0 0 .25 @@ -80,8 +80,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-(BORDER+BUTT_W)) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 diff --git a/ui/tremulous_alienupgrade.menu b/ui/tremulous_alienupgrade.menu index d31b2832..2ef7bcb2 100644 --- a/ui/tremulous_alienupgrade.menu +++ b/ui/tremulous_alienupgrade.menu @@ -79,8 +79,8 @@ style WINDOW_STYLE_EMPTY rect INFO_X INFO_Y INFO_W INFO_H textscale .33 - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_TOP + textalign ALIGN_LEFT + textvalign VALIGN_TOP textalignx INFO_TOFF textaligny INFO_TOFF border WINDOW_BORDER_FULL @@ -99,8 +99,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-((2*BORDER)+(2*BUTT_W))) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 @@ -120,8 +120,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-(BORDER+BUTT_W)) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 diff --git a/ui/tremulous_common_hud.h b/ui/tremulous_common_hud.h index ae85d7e5..3bc62ba1 100644 --- a/ui/tremulous_common_hud.h +++ b/ui/tremulous_common_hud.h @@ -13,12 +13,13 @@ itemDef { name "console" rect BORDER BORDER CONSOLE_W CONSOLE_H + aspectBias ALIGN_LEFT style WINDOW_STYLE_EMPTY visible MENU_TRUE decoration forecolor 1 1 1 1 - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_TOP + textalign ALIGN_LEFT + textvalign VALIGN_TOP textscale 0.4 textstyle ITEM_TEXTSTYLE_NORMAL ownerdraw CG_CONSOLE @@ -29,12 +30,13 @@ itemDef { name "tutorial" rect BORDER 250 MAIN_W 180 + aspectBias ALIGN_LEFT style WINDOW_STYLE_EMPTY visible MENU_TRUE decoration forecolor 1 1 1 0.35 - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_TOP + textalign ALIGN_LEFT + textvalign VALIGN_TOP textscale 0.3 textstyle ITEM_TEXTSTYLE_NORMAL ownerdraw CG_TUTORIAL @@ -45,12 +47,13 @@ itemDef { name "fps" rect STAT_X BORDER STAT_W STAT_H + aspectBias ALIGN_RIGHT style WINDOW_STYLE_EMPTY visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 1 - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textscale 0.3 textstyle ITEM_TEXTSTYLE_NORMAL ownerdraw CG_FPS @@ -60,12 +63,13 @@ itemDef { name "timer" rect STAT_X ((2*BORDER)+STAT_H) STAT_W STAT_H + aspectBias ALIGN_RIGHT style WINDOW_STYLE_EMPTY visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 1 - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textscale 0.3 textstyle ITEM_TEXTSTYLE_NORMAL ownerdraw CG_TIMER @@ -75,28 +79,27 @@ itemDef { name "lagometer" rect STAT_X ((3*BORDER)+(2*STAT_H)) STAT_W STAT_H + aspectBias ALIGN_RIGHT style WINDOW_STYLE_EMPTY visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 1 textscale 0.3 - textalignx 1 - textaligny 0.5 ownerdraw CG_LAGOMETER } //CLOCK itemDef { name "clock" - rect 572 90 56 22 rect STAT_X ((4*BORDER)+(3*STAT_H)) STAT_W STAT_H + aspectBias ALIGN_RIGHT style WINDOW_STYLE_EMPTY visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 1 - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER - textscale 0.25 + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER + textscale 0.3 textstyle ITEM_TEXTSTYLE_NORMAL ownerdraw CG_CLOCK } @@ -105,13 +108,12 @@ itemDef { name "demoRecording" rect (STAT_X+(STAT_W-32)) ((5*BORDER)+(4*STAT_H)) 32 32 + aspectBias ALIGN_RIGHT style WINDOW_STYLE_EMPTY visible MENU_TRUE decoration forecolor 1 0 0 1 textscale 0.3 - textalignx 1 - textaligny 0.5 ownerdraw CG_DEMO_RECORDING background "ui/assets/neutral/circle.tga" } @@ -119,13 +121,12 @@ itemDef { name "demoPlayback" rect (STAT_X+(STAT_W-32)) ((5*BORDER)+(4*STAT_H)) 32 32 + aspectBias ALIGN_RIGHT style WINDOW_STYLE_EMPTY visible MENU_TRUE decoration forecolor 1 1 1 1 textscale 0.3 - textalignx 1 - textaligny 0.5 ownerdraw CG_DEMO_PLAYBACK background "ui/assets/forwardarrow.tga" } @@ -135,12 +136,13 @@ itemDef { name "snapshot" rect BORDER (H-(BORDER+STAT_H)) MAIN_W STAT_H + aspectBias ALIGN_LEFT style WINDOW_STYLE_EMPTY visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 1 - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textscale 0.4 textstyle ITEM_TEXTSTYLE_NORMAL ownerdraw CG_SNAPSHOT @@ -151,6 +153,7 @@ itemDef { name "playername" rect 200 275 240 25 + aspectBias ALIGN_CENTER visible MENU_TRUE decoration textScale .5 diff --git a/ui/tremulous_default_hud.menu b/ui/tremulous_default_hud.menu index 02689861..6c98e519 100644 --- a/ui/tremulous_default_hud.menu +++ b/ui/tremulous_default_hud.menu @@ -11,6 +11,7 @@ fullScreen MENU_FALSE visible MENU_TRUE rect 0 0 W H + aspectBias ASPECT_NONE #define COMMON_HUD_R 1.0 #define COMMON_HUD_G 1.0 diff --git a/ui/tremulous_human_hud.menu b/ui/tremulous_human_hud.menu index 38354b4a..a2bdb82d 100644 --- a/ui/tremulous_human_hud.menu +++ b/ui/tremulous_human_hud.menu @@ -11,6 +11,7 @@ fullScreen MENU_FALSE visible MENU_TRUE rect 0 0 W H + aspectBias ASPECT_NONE #define COMMON_HUD_R 0.0 #define COMMON_HUD_G 0.8 @@ -26,6 +27,7 @@ { name "left-circle" rect 35 417.5 25 25 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.25 @@ -38,6 +40,7 @@ { name "left-arm" rect 68.25 420 94.5 35 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.25 @@ -50,6 +53,7 @@ { name "credits-label" rect 508 403 7 7.5 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 @@ -62,6 +66,7 @@ { name "right-circle" rect 580 417.5 25 25 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.25 @@ -74,6 +79,7 @@ { name "right-arm" rect 477.25 420 94.5 35 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.25 @@ -86,6 +92,7 @@ { name "right-cap" rect 500 400 80 15 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.25 @@ -102,6 +109,7 @@ { name "bolt" rect 40 420 15 20 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 @@ -114,6 +122,7 @@ { name "cross" rect 137.5 430 15 15 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 @@ -126,6 +135,7 @@ { name "stamina1" rect 34.5 403.5 9 11.5 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 @@ -138,6 +148,7 @@ { name "stamina2" rect 24 410.75 11.5 10.5 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 @@ -150,6 +161,7 @@ { name "stamina3" rect 20.75 423.5 10.5 7 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 @@ -162,6 +174,7 @@ { name "stamina4" rect 21 402.5 54 55 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 @@ -175,6 +188,7 @@ name "ring" //rect 20 402.5 55 55 // Guide for Stamina alignment rect 565 402.5 55 55 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 @@ -187,6 +201,7 @@ { name "credits" rect 515 402 45 11.25 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 @@ -198,6 +213,7 @@ { name "health" rect 67 430 60 15 + aspectBias ALIGN_LEFT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B .5 @@ -209,6 +225,7 @@ { name "weapon" rect 482.5 425 25 25 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 @@ -220,6 +237,7 @@ { name "selecttext" rect 200 300 240 25 + aspectBias ALIGN_CENTER visible MENU_TRUE decoration textScale .5 @@ -231,6 +249,7 @@ { name "ammo" rect 494 430 60 15 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B .5 @@ -242,6 +261,7 @@ { name "clips" rect 538 423 60 15 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B .5 @@ -253,6 +273,7 @@ { name "buildtimer" rect 580 417.5 25 25 + aspectBias ALIGN_RIGHT visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B .5 @@ -264,6 +285,7 @@ { name "usable" rect 307.5 380 25 25 + aspectBias ALIGN_CENTER visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B .5 @@ -276,6 +298,7 @@ { name "scanner" rect 164 340 312 72 + aspectBias ALIGN_CENTER visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B .5 @@ -288,6 +311,7 @@ { name "inventory" rect 232.5 425 175 25 + aspectBias ALIGN_CENTER visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.5 @@ -299,6 +323,7 @@ { name "selected" rect 306 424 27 27 + aspectBias ALIGN_CENTER visible MENU_TRUE decoration forecolor COMMON_HUD_R COMMON_HUD_G COMMON_HUD_B 0.25 diff --git a/ui/tremulous_humanarmoury.menu b/ui/tremulous_humanarmoury.menu index 60bc70b1..4234259e 100644 --- a/ui/tremulous_humanarmoury.menu +++ b/ui/tremulous_humanarmoury.menu @@ -75,7 +75,9 @@ doubleclick { play "sound/misc/menu1.wav"; - uiScript BuyFromArmoury + uiScript BuyFromArmoury; + reset selllist; + reset buylist; } } @@ -99,7 +101,9 @@ doubleclick { play "sound/misc/menu1.wav"; - uiScript SellToArmoury + uiScript SellToArmoury; + reset selllist; + reset buylist; } } @@ -111,8 +115,8 @@ style WINDOW_STYLE_EMPTY rect INFO_X INFO_Y INFO_W INFO_H textscale .33 - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_TOP + textalign ALIGN_LEFT + textvalign VALIGN_TOP textalignx INFO_TOFF textaligny INFO_TOFF border WINDOW_BORDER_FULL @@ -126,13 +130,13 @@ itemDef { - name "Sell" - text "< Sell" + name "Buy" + text "Buy >" type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect BUTT_X BUTT_Y BUTT_W BUTT_H - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_LEFT + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 @@ -140,7 +144,9 @@ action { play "sound/misc/menu1.wav"; - uiScript SellToArmoury + uiScript BuyFromArmoury; + reset selllist; + reset buylist; } } @@ -151,8 +157,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (BUTT_X+BUTT_W) BUTT_Y BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 @@ -166,13 +172,13 @@ itemDef { - name "Buy" - text "Buy >" + name "Sell" + text "< Sell" type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (BUTT_X+(2*BUTT_W)) BUTT_Y BUTT_W BUTT_H - textalign ITEM_ALIGN_RIGHT - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_RIGHT + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 @@ -180,7 +186,9 @@ action { play "sound/misc/menu1.wav"; - uiScript BuyFromArmoury + uiScript SellToArmoury; + reset selllist; + reset buylist; } } } diff --git a/ui/tremulous_humanbuild.menu b/ui/tremulous_humanbuild.menu index a2f84c85..572957bb 100644 --- a/ui/tremulous_humanbuild.menu +++ b/ui/tremulous_humanbuild.menu @@ -79,8 +79,8 @@ style WINDOW_STYLE_EMPTY rect INFO_X INFO_Y INFO_W INFO_H textscale .33 - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_TOP + textalign ALIGN_LEFT + textvalign VALIGN_TOP textalignx INFO_TOFF textaligny INFO_TOFF border WINDOW_BORDER_FULL @@ -98,8 +98,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-((2*BORDER)+(2*BUTT_W))) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 @@ -119,8 +119,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-(BORDER+BUTT_W)) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 diff --git a/ui/tremulous_humandialogs.menu b/ui/tremulous_humandialogs.menu index 8db2f027..bbaa70e3 100644 --- a/ui/tremulous_humandialogs.menu +++ b/ui/tremulous_humandialogs.menu @@ -48,8 +48,8 @@ textstyle ITEM_TEXTSTYLE_NORMAL style WINDOW_STYLE_EMPTY rect BORDER BORDER INFO_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 @@ -65,8 +65,8 @@ rect INFO_X INFO_Y INFO_W INFO_H cvar "ui_dialog" wrapped - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .33 forecolor 1 1 1 1 backcolor .5 0 0 .25 @@ -81,8 +81,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-(BORDER+BUTT_W)) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 diff --git a/ui/tremulous_humanitem.menu b/ui/tremulous_humanitem.menu index bc2204f6..551334be 100644 --- a/ui/tremulous_humanitem.menu +++ b/ui/tremulous_humanitem.menu @@ -79,8 +79,8 @@ style WINDOW_STYLE_EMPTY rect INFO_X INFO_Y INFO_W INFO_H textscale .33 - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_TOP + textalign ALIGN_LEFT + textvalign VALIGN_TOP textalignx INFO_TOFF textaligny INFO_TOFF border WINDOW_BORDER_FULL @@ -99,8 +99,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect ((2*BORDER)+LIST_W) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 @@ -120,8 +120,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-((2*BORDER)+(2*BUTT_W))) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 @@ -141,8 +141,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-(BORDER+BUTT_W)) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 diff --git a/ui/tremulous_teamselect.menu b/ui/tremulous_teamselect.menu index 7d638784..70512748 100644 --- a/ui/tremulous_teamselect.menu +++ b/ui/tremulous_teamselect.menu @@ -79,8 +79,8 @@ style WINDOW_STYLE_EMPTY rect INFO_X INFO_Y INFO_W INFO_H textscale .33 - textalign ITEM_ALIGN_LEFT - textvalign ITEM_VALIGN_TOP + textalign ALIGN_LEFT + textvalign VALIGN_TOP textalignx INFO_TOFF textaligny INFO_TOFF border WINDOW_BORDER_FULL @@ -99,8 +99,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-((2*BORDER)+(2*BUTT_W))) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 @@ -120,8 +120,8 @@ type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY rect (W-(BORDER+BUTT_W)) (H-(BORDER+BUTT_H)) BUTT_W BUTT_H - textalign ITEM_ALIGN_CENTER - textvalign ITEM_VALIGN_CENTER + textalign ALIGN_CENTER + textvalign VALIGN_CENTER textscale .4 forecolor 1 1 1 1 backcolor .5 0 0 .25 |