diff options
author | Tim Angus <tim@ngus.net> | 2002-08-04 01:52:14 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2002-08-04 01:52:14 +0000 |
commit | fd4c3379156a64336019bb13f343e8d7206bd9d9 (patch) | |
tree | 228f7b781c2ac9d53a13b942aae6ebfbcfe61e7d /src/ui/ui_main.c | |
parent | 156dfa9283d6a9fa4a53cf140ee35bbc9003783a (diff) |
* Mispelling of "threshold" fixed
* Only Tremulous servers are listed in server list
* Only Tremulous maps listed in map list
Diffstat (limited to 'src/ui/ui_main.c')
-rw-r--r-- | src/ui/ui_main.c | 73 |
1 files changed, 63 insertions, 10 deletions
diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index 3047a89b..d1c1dd50 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -1455,12 +1455,64 @@ static void UI_DrawPreviewCinematic(rectDef_t *rect, float scale, vec4_t color) } -static void UI_DrawDialogText( rectDef_t *rect, float scale, vec4_t color, - int textStyle ) +static void UI_DrawDialogText( rectDef_t *rect, float text_x, float text_y, + vec4_t color, float scale, int align, int textStyle ) { const char *text = UI_Cvar_VariableString( "ui_dialog" ); + float tw, th, tx; + int pos, i; + char buffer[ 1024 ]; + char *end; - Text_Paint( rect->x, rect->y, scale, color, text, 0, 0, textStyle ); + if( !text[ 0 ] ) + return; + + strcpy( buffer, text ); + tw = Text_Width( text, scale, 0 ); + th = scale * 40.0f; + + pos = i = 0; + + while( pos < strlen( text ) ) + { + strcpy( buffer, &text[ pos ] ); + tw = Text_Width( buffer, scale, 0 ); + + while( tw > rect->w ) + { + end = strrchr( buffer, ' ' ); + + if( end == NULL ) + break; + + *end = '\0'; + tw = Text_Width( buffer, scale, 0 ); + } + + switch( align ) + { + case ITEM_ALIGN_LEFT: + tx = rect->x; + break; + + case ITEM_ALIGN_RIGHT: + tx = rect->x + rect->w - tw; + break; + + case ITEM_ALIGN_CENTER: + tx = rect->x + ( rect->w / 2.0f ) - ( tw / 2.0f ); + break; + + default: + tx = 0.0f; + } + + Text_Paint( tx + text_x, rect->y + text_y + i * ( th + 3 ), scale, color, + buffer, 0, 0, textStyle ); + + pos += strlen( buffer ) + 1; + i++; + } } /* @@ -1607,7 +1659,7 @@ static void UI_DrawMapPreview(rectDef_t *rect, float scale, vec4_t color, qboole if (uiInfo.mapList[map].levelShot > 0) { UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, uiInfo.mapList[map].levelShot); } else { - UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, trap_R_RegisterShaderNoMip("menu/art/unknownmap")); + UI_DrawHandlePic( rect->x, rect->y, rect->w, rect->h, trap_R_RegisterShaderNoMip("gfx/2d/load_screen")); } } @@ -2391,7 +2443,7 @@ static void UI_OwnerDraw( float x, float y, float w, float h, switch( ownerDraw ) { case UI_DIALOG: - UI_DrawDialogText( &rect, scale, color, textStyle ); + UI_DrawDialogText( &rect, text_x, text_y, color, scale, align, textStyle ); break; case UI_TEAMINFOPANE: @@ -4687,12 +4739,13 @@ static void UI_BuildServerDisplayList(qboolean force) { } } - if (ui_serverFilterType.integer > 0) { - if (Q_stricmp(Info_ValueForKey(info, "game"), serverFilters[ui_serverFilterType.integer].basedir) != 0) { - trap_LAN_MarkServerVisible(ui_netSource.integer, i, qfalse); - continue; - } + //TA: only show tremulous servers + if( Q_stricmp( Info_ValueForKey( info, "game" ), "tremulous" ) != 0 ) + { + trap_LAN_MarkServerVisible( ui_netSource.integer, i, qfalse ); + continue; } + // make sure we never add a favorite server twice if (ui_netSource.integer == AS_FAVORITES) { UI_RemoveServerFromDisplayList(i); |