Ejemplo n.º 1
0
/*
* SCR_DrawSpectators
*/
static int SCR_DrawSpectators( const char **ptrptr, int x, int y, int panelWidth, struct qfontface_s *font, bool havePing, const char *title, vec4_t titleColor, int pass )
{
	const char *token;
	char string[MAX_STRING_CHARS];
	int yoffset = 0, xoffset = 0;
	int playerNum, ping;
	int aligns[3], offsets[3];
	int colwidth, fullwidth, count = 0, height;
	bool titleDrawn = false;

	fullwidth = panelWidth * 1.5;
	if( fullwidth > cgs.vidWidth * 0.7 )
		fullwidth = cgs.vidWidth * 0.7;
	colwidth = fullwidth / 3;

	aligns[0] = ALIGN_CENTER_TOP;
	aligns[1] = ALIGN_LEFT_TOP;
	aligns[2] = ALIGN_RIGHT_TOP;

	offsets[0] = 0;
	offsets[1] = -fullwidth * 0.5;
	offsets[2] = fullwidth * 0.5;

	assert( ptrptr && *ptrptr );

	height = trap_SCR_FontHeight( font );
	yoffset = height;

	// draw spectators
	while( *ptrptr )
	{
		if( !SCR_ParseToken( ptrptr, &token ) )
			break;

		// first token is played id
		playerNum = atoi( token );
		if( playerNum < 0 || playerNum >= gs.maxclients )
			break;

		if( havePing )
		{
			// get a second token
			if( !SCR_ParseToken( ptrptr, &token ) )
				break;

			// second token is ping
			ping = atoi( token );

			// draw the spectator
			if( ping < 0 )
				Q_snprintfz( string, sizeof( string ), "%s%s ...", cgs.clientInfo[playerNum].name, S_COLOR_WHITE );
			else
				Q_snprintfz( string, sizeof( string ), "%s%s %i", cgs.clientInfo[playerNum].name, S_COLOR_WHITE, ping );
		}
		else
		{
			Q_snprintfz( string, sizeof( string ), "%s%s", cgs.clientInfo[playerNum].name, S_COLOR_WHITE );
		}

		// draw title if there are any spectators
		if( !titleDrawn )
		{
			titleDrawn = true;
			if( pass ) {
				trap_SCR_DrawString( x, y + yoffset, ALIGN_CENTER_TOP,
					CG_TranslateString( title ), font, titleColor );
			}
			yoffset += height;
		}

		xoffset = offsets[count] + CG_HorizontalAlignForWidth( 0, aligns[count], trap_SCR_strWidth( string, font, 0 ) );

		if ( pass ) {
			// fixme: the boxes aren't actually correctly aligned
			trap_SCR_DrawClampString( x + xoffset, y + yoffset, string, x + xoffset, y + yoffset, x + xoffset + colwidth, y + yoffset + height, font, colorWhite );
		}

		count++;
		if( count > 2 )
		{
			count = 0;
			yoffset += height;
		}
	}

	if( count )
		yoffset += height;
	return yoffset;
}
Ejemplo n.º 2
0
static qboolean StartServer_MenuInit( void )
{
    menucommon_t *menuitem_settings_background;
    menucommon_t *menuitem, *col_title;
    static char *skill_names[] = { "easy", "normal", "hard", 0 };
    static char *sortmethod_names[] = { "file name", "title", 0 };
    cvar_t *cvar_lastmap;
    int maxclients;
    int scrollwindow_width, xoffset, yoffset = 0; //leave some room for preview pic

    trap_Cvar_Get( "ui_maplist_sortmethod", "1", CVAR_ARCHIVE );

    // create a list with the installed gametype names
    ui_gametype_names = trap_Cvar_Get( "ui_gametype_names", ";", CVAR_NOSET );
    if( !UI_CreateFileNamesListCvar( ui_gametype_names, "progs/gametypes", ".gt", ';' ) )
        trap_Cvar_ForceSet( "ui_gametype_names", "dm;" );

    if( uis.vidWidth < 800 )
        scrollwindow_width = uis.vidWidth * 0.85;
    else if( uis.vidWidth < 1024 )
        scrollwindow_width = uis.vidWidth * 0.75;
    else
        scrollwindow_width = uis.vidWidth * 0.45;
    xoffset = scrollwindow_width / 2;

    // convert to item names format
    M_StartServer_MakeGametypesNames( ui_gametype_names->string );

    s_startserver_menu.nitems = 0;

    menuitem = UI_InitMenuItem( "m_startserver_title1", "SERVER SETUP", 0, yoffset, MTYPE_SEPARATOR, ALIGN_CENTER_TOP, uis.fontSystemBig, NULL );
    Menu_AddItem( &s_startserver_menu, menuitem );
    yoffset += trap_SCR_strHeight( menuitem->font );

    // separator
    yoffset += trap_SCR_strHeight( menuitem->font );

    menuitem = UI_InitMenuItem( "m_startserver_map", "initial map", 0, yoffset, MTYPE_SEPARATOR, ALIGN_CENTER_TOP, uis.fontSystemMedium, NULL );
    Menu_AddItem( &s_startserver_menu, menuitem );
    yoffset += trap_SCR_strHeight( menuitem->font );

    yoffset += trap_SCR_strHeight( menuitem->font ) * 0.5;

    // order type
    menuitem = col_title = UI_InitMenuItem( "m_startserver_order_title", "order by: ", -xoffset - LCOLUMN_OFFSET / 2, yoffset, MTYPE_SEPARATOR, ALIGN_LEFT_TOP, uis.fontSystemSmall, NULL );
    Menu_AddItem( &s_startserver_menu, menuitem );

    menuitem = UI_InitMenuItem( "m_startserver_order", NULL, col_title->x + trap_SCR_strWidth( col_title->title, uis.fontSystemSmall, 0 ),
                                yoffset, MTYPE_SPINCONTROL, ALIGN_LEFT_TOP, uis.fontSystemSmall, StartServer_UpdateOrderMethod );
    UI_SetupSpinControl( menuitem, sortmethod_names, trap_Cvar_Value( "ui_maplist_sortmethod" ) );
    Menu_AddItem( &s_startserver_menu, menuitem );

    menuitem = UI_InitMenuItem( "m_startserver_mappic", NULL, xoffset - MAPPIC_WIDTH - 8, yoffset, MTYPE_SEPARATOR, ALIGN_CENTER_TOP, uis.fontSystemSmall, NULL );
    Menu_AddItem( &s_startserver_menu, menuitem );

    cvar_lastmap = trap_Cvar_Get( "ui_startserver_lastselectedmap", "", CVAR_NOSET );
    MapsList_CreateItems( cvar_lastmap->string );
    MapsList_ChooseMap( NULL );

    yoffset += trap_SCR_strHeight( menuitem->font );
    yoffset = MapsList_CreateScrollbox( scrollwindow_width, yoffset );

    yoffset += trap_SCR_strHeight( menuitem->font ) * 0.5;

    menuitem_settings_background = UI_InitMenuItem( "m_startserver_settings_back", "", -xoffset, yoffset, MTYPE_SEPARATOR, ALIGN_LEFT_TOP, uis.fontSystemSmall, NULL );
    Menu_AddItem( &s_startserver_menu, menuitem_settings_background );
    // create an associated picture to the items to act as window background
    menuitem = menuitem_settings_background;
    menuitem->ownerdraw = M_StartServer_DrawSettingsBox;
    menuitem->pict.shader = uis.whiteShader;
    menuitem->pict.shaderHigh = NULL;
    Vector4Copy( colorMdGrey, menuitem->pict.color );
    menuitem->pict.color[3] = 0;
    menuitem->pict.yoffset = 0;
    menuitem->pict.xoffset = 0;
    menuitem->pict.width = scrollwindow_width;
    menuitem->pict.height = yoffset + menuitem->pict.yoffset; // will be set later

    yoffset += trap_SCR_strHeight( menuitem->font );

    // g_gametype
    m_gametype = mapList_suggested_gametype ? mapList_suggested_gametype : SuggestGameType( NULL );
    menuitem = m_gametypes_item = UI_InitMenuItem( "m_startserver_gametype", "gametype", -130, yoffset, MTYPE_SPINCONTROL, ALIGN_RIGHT_TOP, uis.fontSystemSmall, M_GametypeFunc );
    menuitem->statusbar = "select the server gametype";
    UI_SetupSpinControl( menuitem, startserver_gametype_names, m_gametype );
    Menu_AddItem( &s_startserver_menu, menuitem );
    //yoffset += trap_SCR_strHeight( menuitem->font );

    // g_timelimit
    menuitem = UI_InitMenuItem( "m_startserver_timelimit", "time limit", 100, yoffset, MTYPE_FIELD, ALIGN_RIGHT_TOP, uis.fontSystemSmall, NULL );
    menuitem->statusbar = "0 = no limit";
    UI_SetupField( menuitem, trap_Cvar_String( "g_timelimit" ), 6, -1 );
    UI_SetupFlags( menuitem, F_NUMBERSONLY );
    Menu_AddItem( &s_startserver_menu, menuitem );
    yoffset += trap_SCR_strHeight( menuitem->font );

    // sv_skilllevel
    menuitem = UI_InitMenuItem( "m_startserver_skill", "skill level", -130, yoffset, MTYPE_SPINCONTROL, ALIGN_RIGHT_TOP, uis.fontSystemSmall, M_SkillLevelFunc );
    m_skill = trap_Cvar_Value( "sv_skilllevel" );
    menuitem->statusbar = "select server skill level";
    UI_SetupSpinControl( menuitem, skill_names, m_skill );
    Menu_AddItem( &s_startserver_menu, menuitem );
    //yoffset += trap_SCR_strHeight( menuitem->font );

    // g_scorelimit
    menuitem = UI_InitMenuItem( "m_startserver_scorelimit", "score limit", 100, yoffset, MTYPE_FIELD, ALIGN_RIGHT_TOP, uis.fontSystemSmall, NULL );
    menuitem->statusbar = "0 = no limit";
    UI_SetupField( menuitem, trap_Cvar_String( "g_scorelimit" ), 6, -1 );
    UI_SetupFlags( menuitem, F_NUMBERSONLY );
    Menu_AddItem( &s_startserver_menu, menuitem );
    yoffset += trap_SCR_strHeight( menuitem->font );

    // sv_cheats
    menuitem = UI_InitMenuItem( "m_startserver_cheats", "cheats", -130, yoffset, MTYPE_SPINCONTROL, ALIGN_RIGHT_TOP, uis.fontSystemSmall, M_CheatsFunc );
    m_cheats = trap_Cvar_Value( "sv_cheats" );
    menuitem->statusbar = "enable cheats on the server";
    UI_SetupSpinControl( menuitem, offon_names, m_cheats );
    Menu_AddItem( &s_startserver_menu, menuitem );
    //yoffset += trap_SCR_strHeight( menuitem->font );

    // g_numbots
    menuitem = UI_InitMenuItem( "m_startserver_numbots", "number of bots", 100, yoffset, MTYPE_FIELD, ALIGN_RIGHT_TOP, uis.fontSystemSmall, NULL );
    menuitem->statusbar = "Can't be more than maxclients";
    UI_SetupField( menuitem, trap_Cvar_String( "g_numbots" ), 6, -1 );
    UI_SetupFlags( menuitem, F_NUMBERSONLY );
    Menu_AddItem( &s_startserver_menu, menuitem );
    yoffset += trap_SCR_strHeight( menuitem->font );

    // g_instagib
    menuitem = UI_InitMenuItem( "m_startserver_instagib", "instagib", -130, yoffset, MTYPE_SPINCONTROL, ALIGN_RIGHT_TOP, uis.fontSystemSmall, M_InstagibFunc );
    m_instagib = trap_Cvar_Value( "g_instagib" );
    menuitem->statusbar = "enable instagib mode";
    UI_SetupSpinControl( menuitem, offon_names, m_instagib );
    Menu_AddItem( &s_startserver_menu, menuitem );
    //yoffset += trap_SCR_strHeight( menuitem->font );

    // sv_maxclients
    /*
    ** maxclients determines the maximum number of players that can join
    ** the game.  If maxclients is only "1" then we should default the menu
    ** option to 8 players, otherwise use whatever its current value is.
    */
    maxclients = trap_Cvar_Value( "sv_maxclients" ) <= 1 ? 8 : trap_Cvar_Value( "sv_maxclients" );
    menuitem = UI_InitMenuItem( "m_startserver_maxplayers", "max players", 100, yoffset, MTYPE_FIELD, ALIGN_RIGHT_TOP, uis.fontSystemSmall, NULL );
    UI_SetupField( menuitem, va( "%i", maxclients ), 6, -1 );
    UI_SetupFlags( menuitem, F_NUMBERSONLY );
    Menu_AddItem( &s_startserver_menu, menuitem );
    yoffset += trap_SCR_strHeight( menuitem->font );

    // sv_public
    menuitem = UI_InitMenuItem( "m_startserver_public", "public", -130, yoffset, MTYPE_SPINCONTROL, ALIGN_RIGHT_TOP, uis.fontSystemSmall, M_PublicFunc );
    m_public = trap_Cvar_Value( "sv_public" );
    menuitem->statusbar = "announce this server to metaservers";
    UI_SetupSpinControl( menuitem, offon_names, m_public );
    Menu_AddItem( &s_startserver_menu, menuitem );
    //yoffset += trap_SCR_strHeight( menuitem->font );

    // sv_hostname
    menuitem = UI_InitMenuItem( "m_startserver_hostname", "server name", 100, yoffset, MTYPE_FIELD, ALIGN_RIGHT_TOP, uis.fontSystemSmall, NULL );
    UI_SetupField( menuitem, trap_Cvar_String( "sv_hostname" ), 14, -1 );
    Menu_AddItem( &s_startserver_menu, menuitem );
    yoffset += trap_SCR_strHeight( menuitem->font );

    yoffset += trap_SCR_strHeight( menuitem->font ) * 0.5;

    // here ends the settings background, set it's image height now
    menuitem_settings_background->pict.height = yoffset - menuitem_settings_background->pict.height + ( 0.5 * trap_SCR_strHeight( menuitem->font ) );

    yoffset += trap_SCR_strHeight( menuitem->font );

    // begin button
    menuitem = UI_InitMenuItem( "m_startserver_begin", "begin", 16, yoffset, MTYPE_ACTION, ALIGN_LEFT_TOP, uis.fontSystemBig, StartServerActionFunc );
    Menu_AddItem( &s_startserver_menu, menuitem );
    UI_SetupButton( menuitem, qtrue );

    menuitem = UI_InitMenuItem( "m_startserver_back", "back", -16, yoffset, MTYPE_ACTION, ALIGN_RIGHT_TOP, uis.fontSystemBig, M_genericBackFunc );
    Menu_AddItem( &s_startserver_menu, menuitem );
    yoffset += UI_SetupButton( menuitem, qtrue ) + UI_BUTTONBOX_VERTICAL_SPACE;

    Menu_Center( &s_startserver_menu );
    s_startserver_menu.x = ( uis.vidWidth / 2 );
    Menu_Init( &s_startserver_menu, qfalse );
    return qtrue;
}
Ejemplo n.º 3
0
void CG_Democam_DrawCenterSubtitle( int y, unsigned int maxwidth, struct qfontface_s *font, char *text ) {
	char *ptr, *s, *t, c, d;
	int x = cgs.vidWidth / 2;

	if( !text || !text[0] ) {
		return;
	}

	int shadowOffset = 2 * cgs.vidHeight / 600;
	if( !shadowOffset ) {
		shadowOffset = 1;
	}

	if( !maxwidth || trap_SCR_strWidth( text, font, 0 ) <= maxwidth ) {
		trap_SCR_DrawStringWidth( x + shadowOffset, y + shadowOffset, ALIGN_CENTER_TOP, COM_RemoveColorTokens( text ), maxwidth, font, colorBlack );
		trap_SCR_DrawStringWidth( x, y, ALIGN_CENTER_TOP, text, maxwidth, font, colorWhite );
		return;
	}

	t = s = ptr = text;
	while( *s ) {
		while( *s && *s != ' ' && *s != '\n' )
			s++;

		if( ( !*s || *s == '\n' ) && trap_SCR_strWidth( ptr, font, 0 ) < maxwidth ) { // new line or end of text, in both cases force write
			c = *s;
			*s = 0;
			trap_SCR_DrawStringWidth( x + shadowOffset, y + shadowOffset, ALIGN_CENTER_TOP, COM_RemoveColorTokens( ptr ), maxwidth, font, colorBlack );
			trap_SCR_DrawStringWidth( x, y, ALIGN_CENTER_TOP, ptr, maxwidth, font, colorWhite );
			*s = c;

			if( !*s ) {
				break;
			}

			t = s;
			s++;
			ptr = s;
		} else {
			c = *s;
			*s = 0;

			if( trap_SCR_strWidth( ptr, font, 0 ) < maxwidth ) {
				*s = c;
				t = s;
				s++;
				continue;
			}

			*s = c;
			d = *t;
			*t = 0;
			trap_SCR_DrawStringWidth( x + shadowOffset, y + shadowOffset, ALIGN_CENTER_TOP, COM_RemoveColorTokens( ptr ), maxwidth, font, colorBlack );
			trap_SCR_DrawStringWidth( x, y, ALIGN_CENTER_TOP, ptr, maxwidth, font, colorWhite );
			*t = d;
			s = t;
			s++;
			ptr = s;
		}

		y += trap_SCR_FontHeight( font );
	}
}
Ejemplo n.º 4
0
/*
* UI_DrawConnectScreen
*/
void UI_DrawConnectScreen( const char *serverName, const char *rejectmessage, int downloadType, const char *downloadFilename,
						  float downloadPercent, int downloadSpeed, int connectCount, qboolean demoplaying, qboolean backGround )
{
	qboolean localhost, design = qfalse;
	char str[MAX_QPATH];
	int x, y, xoffset, yoffset, width, height;
	unsigned int maxwidth;
	qboolean downloadFromWeb;
	char hostName[MAX_CONFIGSTRING_CHARS], mapname[MAX_CONFIGSTRING_CHARS], mapmessage[MAX_CONFIGSTRING_CHARS],
		gametype[MAX_CONFIGSTRING_CHARS], gametypeTitle[MAX_CONFIGSTRING_CHARS],
		gametypeVersion[MAX_CONFIGSTRING_CHARS], gametypeAuthor[MAX_CONFIGSTRING_CHARS],
		matchName[MAX_CONFIGSTRING_CHARS];

	uis.demoplaying = demoplaying;

	//trap_S_StopBackgroundTrack();

	localhost = (qboolean)( !serverName || !serverName[0] || !Q_stricmp( serverName, "localhost" ) );

	trap_GetConfigString( CS_MAPNAME, mapname, sizeof( mapname ) );
	trap_GetConfigString( CS_MESSAGE, mapmessage, sizeof( mapmessage ) );

	if( backGround )
	{
		Q_snprintfz( str, sizeof( str ), UI_SHADER_BACKGROUND, uis.backgroundNum );
		trap_R_DrawStretchPic( 0, 0, uis.vidWidth, uis.vidHeight, 0, 0, 1, 1, colorWhite, trap_R_RegisterPic( str ) );
	}

	//
	// not yet connected
	//

	x = 64;
	y = 64;
	xoffset = yoffset = 0;

	if( demoplaying )
		Q_snprintfz( str, sizeof( str ), "Loading demo: %s", serverName );
	else if( localhost )
		Q_strncpyz( str, "Loading...", sizeof( str ) );
	else if( mapname[0] )
		Q_snprintfz( str, sizeof( str ), "Connecting to %s", serverName );
	else
		Q_snprintfz( str, sizeof( str ), "Awaiting connection... %i", connectCount );

	trap_SCR_DrawString( x + xoffset, y + yoffset, ALIGN_LEFT_TOP, str, uis.fontSystemBig, colorWhite );
	yoffset += trap_SCR_strHeight( uis.fontSystemBig );

	if( design && !rejectmessage )
		rejectmessage = "Connection was interrupted because the weather sux :P";

	if( rejectmessage )
	{
		x = uis.vidWidth / 2;
		y = uis.vidHeight / 3;

		height = trap_SCR_strHeight( uis.fontSystemMedium ) * 4;
		Q_strncpyz( str, "Refused: ", sizeof( str ) );
		width = max( trap_SCR_strWidth( str, uis.fontSystemMedium, 0 ), trap_SCR_strWidth( rejectmessage, uis.fontSystemSmall, 0 ) );
		width += 32 * 2;

		xoffset = UISCR_HorizontalAlignOffset( ALIGN_CENTER_MIDDLE, width );
		yoffset = UISCR_VerticalAlignOffset( ALIGN_CENTER_MIDDLE, height );

		UI_DrawBox( x + xoffset, y + yoffset, width, height, colorWarsowOrange, colorWhite, NULL, colorDkGrey );

		yoffset += trap_SCR_strHeight( uis.fontSystemMedium );
		xoffset += 32;

		trap_SCR_DrawString( x + xoffset, y + yoffset, ALIGN_LEFT_TOP, str, uis.fontSystemMedium, colorWhite );
		yoffset += trap_SCR_strHeight( uis.fontSystemMedium );

		trap_SCR_DrawString( x + xoffset, y + yoffset, ALIGN_LEFT_TOP, rejectmessage, uis.fontSystemSmall, colorBlack );

		return;
	}

	if( mapname[0] )
	{
		char levelshot[MAX_QPATH];
		struct shader_s *levelshotShader;
		qboolean isDefaultlevelshot = qtrue;

		//
		// connected
		//

		x = 64;
		y = uis.vidHeight - 300;
		xoffset = yoffset = 0;
		width = uis.vidWidth;
		height = 200;

		UI_DrawBox( x + xoffset, y + yoffset, width, height, colorWarsowPurple, colorWhite, NULL, colorDkGrey );
		xoffset += 16;
		yoffset += 16 + 4;

		maxwidth = uis.vidWidth - ( x + xoffset );

		trap_GetConfigString( CS_HOSTNAME, hostName, sizeof( hostName ) );
		trap_GetConfigString( CS_GAMETYPENAME, gametype, sizeof( gametype ) );
		trap_GetConfigString( CS_GAMETYPETITLE, gametypeTitle, sizeof( gametypeTitle ) );
		trap_GetConfigString( CS_GAMETYPEVERSION, gametypeVersion, sizeof( gametypeVersion ) );
		trap_GetConfigString( CS_GAMETYPEAUTHOR, gametypeAuthor, sizeof( gametypeAuthor ) );
		trap_GetConfigString( CS_MATCHNAME, matchName, sizeof( matchName ) );

		Q_snprintfz( levelshot, sizeof( levelshot ), "levelshots/%s.jpg", mapname );

		levelshotShader = trap_R_RegisterLevelshot( levelshot, uis.whiteShader, &isDefaultlevelshot );

		if( !isDefaultlevelshot )
		{
			int lw, lh, lx, ly;

			lh = height - 8;
			lw = lh * ( 4.0f/3.0f );
			lx = uis.vidWidth - lw;
			ly = y + 4;

			trap_R_DrawStretchPic( lx, ly, lw, lh, 0, 0, 1, 1, colorWhite, levelshotShader );
		}

		if( !localhost && !demoplaying )
		{
			Q_snprintfz( str, sizeof( str ), "Server: %s", hostName );
			trap_SCR_DrawStringWidth( x + xoffset, y + yoffset, ALIGN_LEFT_TOP, str, maxwidth, uis.fontSystemSmall, colorWhite );
			yoffset += trap_SCR_strHeight( uis.fontSystemSmall ) + 8;
		}

		if( mapmessage[0] && Q_stricmp( mapname, mapmessage ) )
		{
			Q_snprintfz( str, sizeof( str ), "Level: "S_COLOR_ORANGE"%s", COM_RemoveColorTokens( mapmessage ) );
			trap_SCR_DrawStringWidth( x + xoffset, y + yoffset, ALIGN_LEFT_TOP, str, maxwidth, uis.fontSystemSmall, colorWhite );
			yoffset += trap_SCR_strHeight( uis.fontSystemSmall ) + 8;
		}

		Q_snprintfz( str, sizeof( str ), "Map: %s", mapname );
		trap_SCR_DrawStringWidth( x + xoffset, y + yoffset, ALIGN_LEFT_TOP, str, maxwidth, uis.fontSystemSmall, colorWhite );
		yoffset += trap_SCR_strHeight( uis.fontSystemSmall ) + 8;

		if( matchName[0] )
		{
			Q_snprintfz( str, sizeof( str ), "Match: %s", matchName );
			trap_SCR_DrawStringWidth( x + xoffset, y + yoffset, ALIGN_LEFT_TOP, str, maxwidth, uis.fontSystemSmall, colorWhite );
			yoffset += trap_SCR_strHeight( uis.fontSystemSmall ) + 8;
		}
		yoffset += trap_SCR_strHeight( uis.fontSystemSmall ) + 8;

		Q_snprintfz( str, sizeof( str ), "Gametype: "S_COLOR_ORANGE"%s", COM_RemoveColorTokens( gametypeTitle ) );
		trap_SCR_DrawStringWidth( x + xoffset, y + yoffset, ALIGN_LEFT_TOP, str, maxwidth, uis.fontSystemSmall, colorWhite );
		yoffset += trap_SCR_strHeight( uis.fontSystemSmall ) + 8;

		Q_snprintfz( str, sizeof( str ), "Version: %s", COM_RemoveColorTokens( gametypeVersion ) );
		trap_SCR_DrawStringWidth( x + xoffset, y + yoffset, ALIGN_LEFT_TOP, str, maxwidth, uis.fontSystemSmall, colorWhite );
		yoffset += trap_SCR_strHeight( uis.fontSystemSmall ) + 8;

		Q_snprintfz( str, sizeof( str ), "Author: %s", gametypeAuthor );
		trap_SCR_DrawStringWidth( x + xoffset, y + yoffset, ALIGN_LEFT_TOP, str, maxwidth, uis.fontSystemSmall, colorWhite );
		yoffset += trap_SCR_strHeight( uis.fontSystemSmall ) + 8;
	}

	// downloading

	if( design && !downloadFilename )
	{
		downloadFilename = "http://www.warsow.net/autoupdate/basewsw/map_wdm9a.pk3";
		downloadType = 2;
		downloadPercent = 65.8;
		downloadSpeed = 325;
	}

	if( downloadType && downloadFilename )
	{
		size_t len;
		const char *s;

		downloadFromWeb = ( downloadType == 2 );

		x = uis.vidWidth / 2;
		y = uis.vidHeight / 3;
		width = 400;
		height = 128 - trap_SCR_strHeight( uis.fontSystemSmall );
		if( uis.vidWidth <= width )
			width = uis.vidWidth - 64;

		maxwidth = width - 48;

		xoffset = UISCR_HorizontalAlignOffset( ALIGN_CENTER_MIDDLE, width );
		yoffset = UISCR_VerticalAlignOffset( ALIGN_CENTER_MIDDLE, height );

		// adjust the box size for the extra number of lines needed to draw the file path
		s = downloadFilename;
		while( ( len = trap_SCR_StrlenForWidth( s, uis.fontSystemSmall, maxwidth ) ) > 0 )
		{
			s += len;
			height += trap_SCR_strHeight( uis.fontSystemSmall );
		}

		UI_DrawBox( x + xoffset, y + yoffset, width, height, colorWarsowPurple, colorWhite, NULL, colorDkGrey );

		xoffset += 24;
		yoffset += 24;

		trap_SCR_DrawStringWidth( x + xoffset, y + yoffset, ALIGN_LEFT_TOP, downloadFromWeb ? "Downloading from web" : "Downloading from server", maxwidth, uis.fontSystemSmall, colorWhite );
		yoffset += trap_SCR_strHeight( uis.fontSystemSmall );

		s = downloadFilename;
		while( ( len = trap_SCR_DrawStringWidth( x + xoffset, y + yoffset, ALIGN_LEFT_TOP, s, maxwidth, uis.fontSystemSmall, colorWhite ) ) > 0 )
		{
			s += len;
			yoffset += trap_SCR_strHeight( uis.fontSystemSmall );
		}

		yoffset += 16;

		UI_DrawPicBar( x + xoffset, y + yoffset, maxwidth, 24, ALIGN_LEFT_TOP, downloadPercent, trap_R_RegisterPic( "gfx/ui/progressbar" ),colorDkGrey, colorOrange );
		Q_snprintfz( str, sizeof( str ), "%3.1f%c", downloadPercent, '%' );
		trap_SCR_DrawStringWidth( x + xoffset + 12, y + yoffset + 12, ALIGN_LEFT_MIDDLE, str, maxwidth, uis.fontSystemSmall, colorWhite );
		Q_snprintfz( str, sizeof( str ), "%ik/s", downloadSpeed );
		trap_SCR_DrawStringWidth( x + xoffset + maxwidth - 12, y + yoffset + 12, ALIGN_RIGHT_MIDDLE, str, maxwidth, uis.fontSystemSmall, colorWhite );

		yoffset += 24 + 8;
	}
}