Пример #1
0
void CG_DrawStats( char *stats ) {
	int i, y, v, j;
	#define MAX_STATS_VARS  64
	int vars[MAX_STATS_VARS];
	char *str, *token;
	char *formatStr = NULL; // TTimo: init
	int varIndex;
	char string[MAX_QPATH];

	UI_DrawProportionalString( 320, 120, "MISSION STATS",
							   UI_CENTER | UI_SMALLFONT | UI_DROPSHADOW, colorWhite );

	Q_strncpyz( string, stats, sizeof( string ) );
	str = string;
	// convert commas to spaces
	for ( i = 0; str[i]; i++ ) {
		if ( str[i] == ',' ) {
			str[i] = ' ';
		}
	}

	for ( i = 0, y = 0, v = 0; statsItems[i].label; i++ ) {
		y += statsItems[i].YOfs;

		UI_DrawProportionalString( statsItems[i].labelX, y, statsItems[i].label,
								   statsItems[i].labelFlags, *statsItems[i].labelColor );

		if ( statsItems[i].numVars ) {
			varIndex = v;
			for ( j = 0; j < statsItems[i].numVars; j++ ) {
				token = COM_Parse( &str );
				if ( !token || !token[0] ) {
					CG_Error( "error parsing mission stats\n" );
					return;
				}

				vars[v++] = atoi( token );
			}

			// build the formatStr
			switch ( statsItems[i].numVars ) {
			case 1:
				formatStr = va( statsItems[i].format, vars[varIndex] );
				break;
			case 2:
				formatStr = va( statsItems[i].format, vars[varIndex], vars[varIndex + 1] );
				break;
			case 3:
				formatStr = va( statsItems[i].format, vars[varIndex], vars[varIndex + 1], vars[varIndex + 2] );
				break;
			case 4:
				formatStr = va( statsItems[i].format, vars[varIndex], vars[varIndex + 1], vars[varIndex + 2], vars[varIndex + 3] );
				break;
			}

			UI_DrawProportionalString( statsItems[i].formatX, y, formatStr,
									   statsItems[i].formatFlags, *statsItems[i].formatColor );
		}
	}
}
Пример #2
0
/*
=================
M_MotdMenu_Graphics
=================
*/
static void M_MotdMenu_Graphics( void )
{
	int i;
    int x = 15;
    int y = 15;

	for (i = s_motdstuff.scrollnum; i < motdtextnum && i < (MIN_MOTD_LINES + s_motdstuff.scrollnum); ++i) {
        UI_DrawProportionalString( x, y, motdtext[i], UI_SMALLFONT | UI_LEFT, colorTable[CT_WHITE]);
        y += 21;
	}

	//UI_FrameBottom_Graphics();	// Bottom two thirds

	// Print version
	UI_DrawProportionalString(  371, 445, Q3_VERSION, UI_TINYFONT, colorTable[CT_BLACK]);

    trap_R_SetColor( colorTable[s_motdstuff.quitmenu.color] );
    UI_DrawHandlePic(s_motdstuff.quitmenu.generic.x - 14,
		s_motdstuff.quitmenu.generic.y, 
		MENU_BUTTON_MED_HEIGHT, s_motdstuff.quitmenu.height, uis.graphicButtonLeftEnd);
	UI_DrawHandlePic(s_motdstuff.disconnect.generic.x - 14,
		s_motdstuff.disconnect.generic.y, 
		MENU_BUTTON_MED_HEIGHT, s_motdstuff.disconnect.height, uis.graphicButtonLeftEnd);

	trap_R_SetColor( colorTable[CT_LTBLUE1]); //LTBROWN1]);
	UI_DrawHandlePic( 28,  440, 287,  17, uis.whiteShader);	// Bottom front Line

	UI_DrawHandlePic( 0,  440, 25, 25, s_motdstuff.halfroundl_22);
	UI_DrawHandlePic( 319,  440, 25, 25, uis.halfroundr_22);

	trap_R_SetColor(NULL);
}
Пример #3
0
/*
===============
UI_CreditMenu_Draw_ioq3
===============
*/
static void UI_CreditMenu_Draw_ioq3( void ) {
	int		y;
	int		i;

	static const char *names[] = {
		"",
		S_COLOR_YELLOW "id Software",
		S_COLOR_RED "ioquake3 contributors",
		S_COLOR_GREEN "Spearmint contributors",
		"",
		"...and many, many others!",  // keep this one last.
		NULL
	};

	// Center text vertically on the screen
	y = (SCREEN_HEIGHT - ARRAY_LEN(names) * (1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE)) / 2;

	UI_DrawProportionalString( 320, y, "Spearmint Quake 3 credits:", UI_CENTER|UI_SMALLFONT, color_white );
	y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;

	for (i = 0; names[i]; i++) {
		UI_DrawProportionalString( 320, y, names[i], UI_CENTER|UI_SMALLFONT, color_white );
		y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
	}

	UI_DrawString( 320, 459, "http://spearmint.pw", UI_CENTER|UI_SMALLFONT, colorGreen );
}
Пример #4
0
/*
===============
UI_CreditMenu_Draw_ioq3
===============
*/
static void UI_CreditMenu_Draw_ioq3( void ) {
    int		y;
    int		i;

    // These are all people that have made commits to Subversion, and thus
    //  probably incomplete.
    // (These are in alphabetical order, for the defense of everyone's egos.)
    static const char *names[] = {
        "Tim Angus",
        "James Canete",
        "Vincent Cojot",
        "Ryan C. Gordon",
        "Aaron Gyes",
        "Zack Middleton",
        "Ludwig Nussel",
        "Julian Priestley",
        "Scirocco Six",
        "Thilo Schulz",
        "Zachary J. Slater",
        "Tony J. White",
        "...and many, many others!",  // keep this one last.
        NULL
    };

    y = 12;
    UI_DrawProportionalString( 320, y, "ioquake3 contributors:", UI_CENTER|UI_SMALLFONT, color_white );
    y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;

    for (i = 0; names[i]; i++) {
        UI_DrawProportionalString( 320, y, names[i], UI_CENTER|UI_SMALLFONT, color_white );
        y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
    }

    UI_DrawString( 320, 459, "http://www.ioquake3.org/", UI_CENTER|UI_SMALLFONT, color_red );
}
Пример #5
0
/*
===============
UI_CreditMenu_Draw
===============
*/
static void UI_CreditMenu_Draw( void ) {
	int i, j, y;

	y = 480 - (uis.realtime - s_credits.startTime) / 50.0f;

	for (i = 0; credits[i].header != NULL; i++) {
		if (i != 0) {
			y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;
		}

		UI_DrawProportionalString( 64, y, credits[i].header, UI_BIGFONT, color_white );
		y += 1.42 * PROP_HEIGHT;

		for (j = 0; credits[i].lines[j]; j++) {
			UI_DrawProportionalString( 320, y, credits[i].lines[j], UI_CENTER|UI_SMALLFONT, color_white );
			y += 1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE;

			if (y > 480)
				break;
		}

		if (y > 480)
			break;
	}

	if (y < 0) {
		// It's... over.
		UI_CreditMenu_Key(0);
	}
}
Пример #6
0
/*
=================
DemoMenu_Graphics
=================
*/
static void DemoMenu_Graphics (void)
{
	// Draw the basic screen layout
	UI_MenuFrame(&s_demos.menu);

	UI_DrawProportionalString(  74,  66, "88134-7",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  84, "56-0990",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  188, "3456",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  206, "7618",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  395, "692",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);

	trap_R_SetColor( colorTable[CT_DKBLUE2]);
	UI_DrawHandlePic(30,203,  47, 130, uis.whiteShader);	// Top left column square on bottom 2 3rds
	UI_DrawHandlePic(30,336,  47, 16, uis.whiteShader);	// Middle left column square on bottom 2 3rds
	UI_DrawHandlePic(30,355,  47, 34, uis.whiteShader);	// Bottom left column square on bottom 2 3rds

	// Numbers for left hand side
	UI_DrawProportionalString(  74,  206, "52662",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  339, "662",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  358, "101235",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);

	// Current game box
	trap_R_SetColor( colorTable[CT_DKPURPLE2]);
	UI_DrawHandlePic(130,64,  88, 24, uis.whiteShader);	// Left Side of current game line box 3
	UI_DrawHandlePic(218,64,  320, 3, uis.whiteShader);	// Top of current game line
	UI_DrawHandlePic(218,85,  320, 3, uis.whiteShader);	// Bottom of current game line
	UI_DrawHandlePic(516,64,  44, 24, uis.whiteShader);	// Right side of current game line

	UI_DrawHandlePic(113, 64,  32,	32, s_demos.currentGameTopLeft);	// Upper left corner of current game box
	UI_DrawHandlePic(113, 97,  32,	32, s_demos.currentGameBotLeft);	// Bottom left corner of current game box
	UI_DrawHandlePic(559, 64,  32,	32, s_demos.currentGameTopRight);	// Upper right corner of current game box
	UI_DrawHandlePic(552, 97,  -32,	32, s_demos.currentGameBotLeft);	// Bottom right corner of current game box

	UI_DrawHandlePic(113,91,  18, 6, uis.whiteShader);	// Left side of current game line
	UI_DrawHandlePic(566,91,  18, 6, uis.whiteShader);	// Right side of current game line

	UI_DrawHandlePic(138,101,  142, 18, uis.whiteShader);	// Lower bar to left side of 'engage'
	UI_DrawHandlePic(416,101,  143, 18, uis.whiteShader);	// Lower bar to right side of 'engage'

	// Available Demos
	trap_R_SetColor( colorTable[CT_DKPURPLE2]);
	UI_DrawHandlePic(189, 168,  32,	 32, s_demos.directoryUpperCorner1);	// Left Upper corner of directory box
	UI_DrawHandlePic(189, 421,  32,	 32, s_demos.directoryLowerCorner1);	// Left Lower corner of directory box
	UI_DrawHandlePic(481, 168,  32,	 32, s_demos.directoryUpperCorner2);	// Right Upper corner of directory box
	UI_DrawHandlePic(470, 421, -32,	 32, s_demos.directoryLowerCorner1);	// Right Lower corner of directory box

	UI_DrawHandlePic(205, 168,  277,  18, uis.whiteShader);			// Top bar
	UI_DrawHandlePic(189, 193,  16,  224, uis.whiteShader);			// Left column
	{//TiM - Arrow Boxes 
		UI_DrawHandlePic(485, 193,  16,  16, uis.whiteShader);		// Up Arrow
		UI_DrawHandlePic(485, 212,  16,  187, uis.whiteShader);		// Right column
		UI_DrawHandlePic(485, 402,  16,  16, uis.whiteShader);		// Down Arrow
	}
	UI_DrawHandlePic(205, 424,  277,   8, uis.whiteShader);			// Bottom bar

	UI_DrawProportionalString(  124,  67, "67B",UI_TINYFONT, colorTable[CT_BLACK]);

	UI_DrawProportionalString( 220, 169, menu_normal_text[MNT_CURRENTDEMOSAVAILABLE], UI_SMALLFONT, colorTable[CT_BLACK]);
}
Пример #7
0
/*
=================
UI_DrawProportionalString_Wrapped
=================
*/
void UI_DrawProportionalString_AutoWrapped( int x, int y, int xmax, int ystep, const char* str, int style, vec4_t color ) {
	int width;
	char *s1,*s2,*s3;
	char c_bcp;
	char buf[1024];
	float   sizeScale;

	if (!str || str[0]=='\0')
		return;
	
	sizeScale = UI_ProportionalSizeScale( style );
	
	Q_strncpyz(buf, str, sizeof(buf));
	s1 = s2 = s3 = buf;

	while (1) {
		do {
			s3++;
		} while (*s3!=' ' && *s3!='\0');
		c_bcp = *s3;
		*s3 = '\0';
		width = UI_ProportionalStringWidth(s1) * sizeScale;
		*s3 = c_bcp;
		if (width > xmax) {
			if (s1==s2)
			{
				// f**k, don't have a clean cut, we'll overflow
				s2 = s3;
			}
			*s2 = '\0';
			UI_DrawProportionalString(x, y, s1, style, color);
			y += ystep;
			if (c_bcp == '\0')
      {
        // that was the last word
        // we could start a new loop, but that wouldn't be much use
        // even if the word is too long, we would overflow it (see above)
        // so just print it now if needed
        s2++;
        if (*s2 != '\0') // if we are printing an overflowing line we have s2 == s3
          UI_DrawProportionalString(x, y, s2, style, color);
				break; 
      }
			s2++;
			s1 = s2;
			s3 = s2;
		}
		else
		{
			s2 = s3;
			if (c_bcp == '\0') // we reached the end
			{
				UI_DrawProportionalString(x, y, s1, style, color);
				break;
			}
		}
	}
}
Пример #8
0
/*
=================
ConfirmMenu_Draw
=================
*/
static void ConfirmMenu_Draw( void ) {
	UI_DrawNamedPic( 142, 118, 359, 256, ART_CONFIRM_FRAME );
	UI_DrawProportionalString( 320, 204, s_confirm.question, s_confirm.style, color_red );
	UI_DrawProportionalString( s_confirm.slashX, 265, "/", UI_LEFT|UI_INVERSE, color_red );

	Menu_Draw( &s_confirm.menu );

	if( s_confirm.draw ) {
		s_confirm.draw();
	}
}
Пример #9
0
/*
=================
UI_CDKeyMenu_DrawKey
=================
*/
static void UI_CDKeyMenu_DrawKey( void *self ) {
	menufield_s		*f;
	qboolean		focus;
	int				style;
	char			c;
	float			*color;
	int				x, y;
	int				val;

	f = (menufield_s *)self;

	focus = (f->generic.parent->cursor == f->generic.menuPosition);

	style = UI_LEFT;
	if( focus ) {
		color = color_yellow;
	}
	else {
		color = color_orange;
	}

	x = 320 - 8 * BIGCHAR_WIDTH;
	y = 240 - BIGCHAR_HEIGHT / 2;
	UI_FillRect( x, y, 16 * BIGCHAR_WIDTH, BIGCHAR_HEIGHT, listbar_color );
	UI_DrawString( x, y, f->field.buffer, style, color );

	// draw cursor if we have focus
	if( focus ) {
		if ( trap_Key_GetOverstrikeMode() ) {
			c = 11;
		} else {
			c = 10;
		}

		style &= ~UI_PULSE;
		style |= UI_BLINK;

		UI_DrawChar( x + f->field.cursor * BIGCHAR_WIDTH, y, c, style, color_white );
	}

	val = UI_CDKeyMenu_PreValidateKey( f->field.buffer );
	if( val == 1 ) {
		UI_DrawProportionalString( 320, 376, "Please enter your CD Key", UI_CENTER|UI_SMALLFONT, color_yellow );
	}
	else if ( val == 0 ) {
		UI_DrawProportionalString( 320, 376, "The CD Key appears to be valid, thank you", UI_CENTER|UI_SMALLFONT, color_white );
	}
	else {
		UI_DrawProportionalString( 320, 376, "The CD Key is not valid", UI_CENTER|UI_SMALLFONT, color_red );
	}
}
Пример #10
0
/*
=================
PText_Draw
=================
*/
static void PText_Draw( menutext_s *t )
{
	int		x;
	int		y;
	float *	color;
	int		style;

	x = t->generic.x;
	y = t->generic.y;

	if (t->generic.flags & QMF_GRAYED)
		color = text_color_disabled;
	else
		color = t->color;

	style = t->style;
	if( t->generic.flags & QMF_PULSEIFFOCUS ) {
		if( Menu_ItemAtCursor( t->generic.parent ) == t ) {
			style |= UI_PULSE;
		}
		else {
			style |= UI_INVERSE;
		}
	}

	UI_DrawProportionalString( x, y, t->string, style, color );
}
/*
=================
ServerInfo_MenuDraw
=================
*/
static void ServerInfo_MenuDraw( void )
{
	const char		*s;
	char			key[MAX_INFO_KEY];
	char			value[MAX_INFO_VALUE];
	int				y, i=0;
	int				keylen, vallen, infonum=-1;

	UI_DrawIngameBG();
	UI_DrawProportionalString( 320, 110, "SERVER INFO",UI_CENTER|UI_SMALLFONT,color_black);

	y = 140;//95;
	s = s_serverinfo.info;
	s_serverinfo.numdrawn = 0;
	while ( s && i < s_serverinfo.numlines ) {
		i++;
		Info_NextPair( &s, key, value );
		if ( !key[0] ) {
			break;
		}

		infonum++;
		if(s_serverinfo.firstline>infonum)
			continue;

		if(y>260) break;

		Com_sprintf(key,MAX_INFO_KEY,"%s: ",key);
		keylen=Q_PrintStrlen(key);
		vallen=Q_PrintStrlen(value);
		if(keylen+vallen<20)
		{
			UI_DrawString(230,y,key,UI_LEFT|UI_SMALLFONT,color_black);
			UI_DrawString(230+keylen*8,y,value,UI_LEFT|UI_SMALLFONT,color_blue);

			s_serverinfo.numdrawn++;
		}
		else
		{
			int i;

			// TODO: Also add linebreaks for long keys?
			UI_DrawString(230,y,key,UI_LEFT|UI_SMALLFONT,color_black);
			
			for(i=0;i<vallen;i+=20)
			{
				y += SMALLCHAR_HEIGHT;
				if(y>260) break;

				UI_DrawString(230,y,va("%20.20s",&value[i]),UI_LEFT|UI_SMALLFONT,color_blue);

				s_serverinfo.numdrawn++;
			}
		}

		y += SMALLCHAR_HEIGHT;
	}

	Menu_Draw( &s_serverinfo.menu );
}
Пример #12
0
/*
=================
UI_TeamOrdersMenu_ListDraw
=================
*/
static void UI_TeamOrdersMenu_ListDraw(void* self) {
    menulist_s*  l;
    int         x;
    int         y;
    int         i;
    float*       color;
    qboolean    hasfocus;
    int         style;

    l = (menulist_s*)self;

    hasfocus = (l->generic.parent->cursor == l->generic.menuPosition);

    x = 320;//l->generic.x;
    y = l->generic.y;
    for (i = 0; i < l->numitems; i++) {
        style = UI_LEFT | UI_SMALLFONT | UI_CENTER;
        if (i == l->curvalue) {
            color = color_yellow;
            if (hasfocus) {
                style |= UI_PULSE;
            }
        } else {
            color = color_orange;
        }

        UI_DrawProportionalString(x, y, l->itemnames[i], style, color);
        y += PROP_HEIGHT;
    }
}
Пример #13
0
/*
 * UI_SaveConfigMenu_SavenameDraw
 */
static void
UI_SaveConfigMenu_SavenameDraw(void *self)
{
	menufield_s *f;
	int style;
	float *color;

	f = (menufield_s*)self;

	if(f == Menu_ItemAtCursor(&saveConfig.menu)){
		style	= UI_LEFT|UI_PULSE|UI_SMALLFONT;
		color	= text_color_highlight;
	}else{
		style	= UI_LEFT|UI_SMALLFONT;
		color	= colorRed;
	}

	UI_DrawProportionalString(320, 192, "Enter filename:", UI_CENTER|
		UI_SMALLFONT,
		color_orange);
	UI_FillRect(f->generic.x, f->generic.y, f->field.widthInChars*
		SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT,
		colorBlack);
	MField_Draw(&f->field, f->generic.x, f->generic.y, style, color);
}
Пример #14
0
/*
=================
StartServer_ItemPage_Old_MenuDraw
=================
*/
static void StartServer_ItemPage_Old_MenuDraw(void)
{
	int i;
	int style;

	if (uis.firstdraw) {
		// put all the data in place
		if (s_itemcontrols_old.ingame_menu) {
			StartServer_InGame_Old_Init();
		}
		else {
			StartServer_ItemPage_Old_Load();
		}

		StartServer_ItemPage_Old_UpdateInterface();
	}

	StartServer_BackgroundDraw(qfalse);


	style = UI_SMALLFONT|UI_DROPSHADOW|UI_INVERSE;
	for (i = 0; i < groupInfo_Size; i++)
	{
		if (!groupInfo[i].title)
			continue;

		UI_DrawProportionalString( groupInfo[i].x, groupInfo[i].y, groupInfo[i].title, style, color_red );
	}

	// draw the controls
	Menu_Draw(&s_itemcontrols_old.menu);
}
Пример #15
0
/*
=================
PlayerSettings_DrawEffects
=================
*/
static void PlayerSettings_DrawEffects( void *self ) {
	menulist_s		*item, *item1, *item2, *item3;
	qboolean		focus;
	int				style;
	float			*color;

	item = (menulist_s *)self;
	item1 = &s_playersettings.effects;
	item2 = &s_playersettings.effects2;
	item3 = &s_playersettings.effects3;
	focus = (item1->generic.parent->cursor == item1->generic.menuPosition) ||
				(item2->generic.parent->cursor == item2->generic.menuPosition) ||
				(item3->generic.parent->cursor == item3->generic.menuPosition);

//	focus = (item->generic.parent->cursor == item->generic.menuPosition);

	style = UI_LEFT|UI_SMALLFONT;
	color = text_color_normal;
	if( focus ) {
		style |= UI_PULSE;
		color = text_color_highlight;
	}

	if ( item->generic.id == ID_EFFECTS ) UI_DrawProportionalString( item->generic.x, item->generic.y, "Effects", style, color );

	focus = (item->generic.parent->cursor == item->generic.menuPosition);

	UI_DrawHandlePic( item->generic.x + 64, item->generic.y + PROP_HEIGHT + 8, 128, 8, s_playersettings.fxBasePic );
	UI_DrawHandlePic( item->generic.x + 64 + item->curvalue * 16 + 8, item->generic.y + PROP_HEIGHT + 6, 16, 12, s_playersettings.fxPic[item->curvalue] );
}
Пример #16
0
void CG_DrawInformation( void ) {
	const char	*s;
	const char	*info;
	const char	*sysInfo;
	//int			y;
	//int			value, valueNOFP;
	qhandle_t	levelshot;
	//char		buf[1024];
//	int			iPropHeight = 18;	// I know, this is total crap, but as a post release asian-hack....  -Ste
	
	info = CG_ConfigString( CS_SERVERINFO );
	sysInfo = CG_ConfigString( CS_SYSTEMINFO );

	s = Info_ValueForKey( info, "mapname" );
	levelshot = trap->R_RegisterShaderNoMip( va( "levelshots/%s", s ) );
	if ( !levelshot ) {
		levelshot = trap->R_RegisterShaderNoMip( "menu/art/unknownmap_mp" );
	}
	trap->R_SetColor( NULL );
	CG_DrawPic( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, levelshot );

	CG_LoadBar();

	// the first 150 rows are reserved for the client connection
	// screen to write into
	if ( cg.infoScreenText[0] ) {
		const char *psLoading = CG_GetStringEdString("MENUS", "LOADING_MAPNAME");
		UI_DrawProportionalString( 425, 105, ( const char * ) va(( char * ) /*"Loading... %s"*/ psLoading, cg.infoScreenText),
			UI_RIGHT|UI_BIGFONT|UI_DROPSHADOW, colorWhite, FONT_SMALL3 );		
	} else {
		const char *psAwaitingSnapshot = CG_GetStringEdString("MENUS", "AWAITING_SNAPSHOT");
		UI_DrawProportionalString( 425, 128-32, ( const char * )  /*"Awaiting snapshot..."*/psAwaitingSnapshot,
			UI_RIGHT|UI_INFOFONT|UI_DROPSHADOW, colorWhite, FONT_SMALL3 );			
	}

	// Draw the loading screen tip
	if (cg_loadingTips.size() > 0 && cg_displayTipNumber != -1)
	{
		const char* loadingTip = CG_GetStringEdString2(cg_loadingTips.at(cg_displayTipNumber).tipText);
		int x = 320 - CG_Text_Width(loadingTip, 0.3f, FONT_SMALL) / 2;
		int y = 440;
		CG_Text_Paint(x, y, 0.3, colorWhite, loadingTip, 0, 0, ITEM_TEXTSTYLE_SHADOWED, FONT_SMALL);
	}
}
Пример #17
0
/*
=================
PlayerSettings_DrawHandicap
=================
*/
static void PlayerSettings_DrawHandicap(void* self) {
    menulist_s*      item;
    qboolean        focus;
    int             style;
    float*           color;

    item = (menulist_s*)self;
    focus = (item->generic.parent->cursor == item->generic.menuPosition);

    style = UI_LEFT | UI_SMALLFONT;
    color = text_color_normal;
    if (focus) {
        style |= UI_PULSE;
        color = text_color_highlight;
    }

    UI_DrawProportionalString(item->generic.x, item->generic.y, "Handicap", style, color);
    UI_DrawProportionalString(item->generic.x + 64, item->generic.y + PROP_HEIGHT, handicap_items[item->curvalue], style, color);
}
Пример #18
0
/*
===============
UI_CreditMenu_Draw_QuitMessage
===============
*/
static void UI_CreditMenu_Draw_QuitMessage( void ) {
	int		y;
	int		numItems = 3; // 2 text lines, 1 blank line

	// Force exit after 20 seconds
	if (uis.realtime > s_credits.startTime + 20000) {
		UI_CreditMenu_Key(0);
	}

	y = (SCREEN_HEIGHT - numItems * (1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE)) / 2;

	UI_DrawProportionalString( 320, y, "Thanks for playing", UI_CENTER|UI_SMALLFONT, color_white );

	y += (1.42 * PROP_HEIGHT * PROP_SMALL_SIZE_SCALE) * 2;

	UI_DrawProportionalString( 320, y, "Turtle Arena (c) 2009-2016 Zack Middleton", UI_CENTER|UI_SMALLFONT, color_white );


	UI_DrawString( 320, 459, "http://turtlearena.com", UI_CENTER|UI_SMALLFONT, color_red );
}
Пример #19
0
/*
=======================================================================================================================================
PlayerModel_DrawPlayer
=======================================================================================================================================
*/
static void PlayerModel_DrawPlayer(void *self) {
	menubitmap_s *b;

	b = (menubitmap_s *)self;

	if (trap_MemoryRemaining() <= LOW_MEMORY) {
		UI_DrawProportionalString(b->generic.x, b->generic.y + b->height / 2, "LOW MEMORY", UI_LEFT, color_red);
		return;
	}

	UI_DrawPlayer(b->generic.x, b->generic.y, b->width, b->height, &s_playermodel.playerinfo, uis.realtime / 2);
}
Пример #20
0
/*
=================
M_NetworkMenu_Graphics
=================
*/
void M_NetworkMenu_Graphics (void)
{
	UI_MenuFrame(&networkOptionsInfo.menu);

	UI_Setup_MenuButtons();

	UI_DrawProportionalString(  74,  66, "925",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  84, "88PK",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  188, "8125",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  206, "358677",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  395, "3-679",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);


	// Rest of Bottom1_Graphics
	trap_R_SetColor( colorTable[CT_LTBROWN1]);
	UI_DrawHandlePic(  30, 203, 47, 69, uis.whiteShader);	// Top Left column above 
	UI_DrawHandlePic(  30, 275, 47, 66, uis.whiteShader);	// Top Left column middle
	UI_DrawHandlePic(  30, 344, 47, 45, uis.whiteShader);	// Top Left column below 

	// Brackets around Video Data
	trap_R_SetColor( colorTable[CT_LTPURPLE1]);
	UI_DrawHandlePic(158,163, 16, 16, uis.graphicBracket1CornerLU);
	UI_DrawHandlePic(158,179,  8, 233, uis.whiteShader);
	UI_DrawHandlePic(158,412, 16, -16, uis.graphicBracket1CornerLU);	//LD

	UI_DrawHandlePic(174,163, 320, 8, uis.whiteShader);	// Top line

	UI_DrawHandlePic(494,163, 128, 128, networkOptionsInfo.swooshTop);			// Top swoosh

	UI_DrawHandlePic(501,188, 110, 54, uis.whiteShader);	// Top right column
	UI_DrawHandlePic(501,245, 110, 100, uis.whiteShader);	// Middle right column
	UI_DrawHandlePic(501,348, 110, 55, uis.whiteShader);	// Bottom right column

	UI_DrawHandlePic(494,406, 128, 128, networkOptionsInfo.swooshBottom);		// Bottom swoosh

	UI_DrawHandlePic(174,420, 320, 8, uis.whiteShader);	// Bottom line


}
Пример #21
0
/*
=================
Reset_MenuDraw
=================
*/
static void Reset_MenuDraw( void ) {
	UI_DrawNamedPic( 142, 118, 359, 256, ART_FRAME );
	UI_DrawProportionalString( 320, 194 + 10, "RESET GAME?", UI_CENTER|UI_INVERSE, color_red );
	UI_DrawProportionalString( s_reset.slashX, 265, "/", UI_LEFT|UI_INVERSE, color_red );
	Menu_Draw( &s_reset.menu );

	UI_DrawProportionalString( SCREEN_WIDTH/2, 356 + PROP_HEIGHT * 0, "WARNING: This resets all of the", UI_CENTER|UI_SMALLFONT, color_yellow );
	UI_DrawProportionalString( SCREEN_WIDTH/2, 356 + PROP_HEIGHT * 1, "single player game variables.", UI_CENTER|UI_SMALLFONT, color_yellow );
	UI_DrawProportionalString( SCREEN_WIDTH/2, 356 + PROP_HEIGHT * 2, "Do this only if you want to", UI_CENTER|UI_SMALLFONT, color_yellow );
	UI_DrawProportionalString( SCREEN_WIDTH/2, 356 + PROP_HEIGHT * 3, "start over from the beginning.", UI_CENTER|UI_SMALLFONT, color_yellow );
}
Пример #22
0
/*
=================
MessaheMenu_Draw
=================
*/
static void MessageMenu_Draw( void ) {
	int i,y;
	
	UI_DrawNamedPic( 142, 118, 359, 256, ART_CONFIRM_FRAME );
	
	y = 188;
	for(i=0; s_confirm.lines[i]; i++)
	{
		UI_DrawProportionalString( 320, y, s_confirm.lines[i], s_confirm.style, color_red );
		y += 18;
	}

	Menu_Draw( &s_confirm.menu );

	if( s_confirm.draw ) {
		s_confirm.draw();
	}
}
Пример #23
0
/*
=================
M_MainMenu_Graphics
=================
*/
void ModsMenu_Graphics (void)
{
	// Draw the basic screen layout
	UI_MenuFrame(&s_mods.menu);

	UI_DrawProportionalString(  74,  66, "66",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  84, "122855",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  188, "81",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  206, "4561",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  395, "2000",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);

	ui.R_SetColor( colorTable[CT_LTBROWN1]);
	UI_DrawHandlePic(30,203,  47, 123, uis.whiteShader);	// Top left column square on bottom 3rd 
	UI_DrawHandlePic(30,328,  47, 61, uis.whiteShader);	// Bottom left column square on bottom 3rd

	UI_DrawProportionalString(  74,  206, "38",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  332, "28",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);


	ui.R_SetColor( colorTable[CT_DKPURPLE3]);
	UI_DrawHandlePic(127, 167,  32,  32, s_mods.corner_ul);
	UI_DrawHandlePic(550, 167,  32,  32, s_mods.corner_ur);

	UI_DrawHandlePic(127, 410,  32,  32, s_mods.corner_ll);
	UI_DrawHandlePic(550, 410,  32,  32, s_mods.corner_lr);

	UI_DrawHandlePic(149, 167, 402,  18, uis.whiteShader);	//	Top line
	UI_DrawHandlePic(127, 192,  18, 215, uis.whiteShader);	//	Left side
	UI_DrawHandlePic(554, 192,  18, 215, uis.whiteShader);	//	Right side

	UI_DrawHandlePic(149, 414, 133,  18, uis.whiteShader);	//	Bottom line to left of button
	UI_DrawHandlePic(418, 414, 133,  18, uis.whiteShader);	//	Bottom line to right of button

	UI_DrawProportionalString(  210, 168, menu_normal_text[MNT_AVAILABLEMODS], UI_SMALLFONT, colorTable[CT_LTPURPLE3]);
	UI_DrawProportionalString(  568, 170, "38-56",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
}
Пример #24
0
static void UI_SPPostgameMenu_DrawAwardsPresentation( int timer ) {
    int		awardNum;
    int		atimer;
    vec4_t	color;

    awardNum = timer / AWARD_PRESENTATION_TIME;
    atimer = timer % AWARD_PRESENTATION_TIME;

    color[0] = color[1] = color[2] = 1.0f;
    color[3] = (float)( AWARD_PRESENTATION_TIME - atimer ) / (float)AWARD_PRESENTATION_TIME;
    UI_DrawProportionalString( 320, 64, ui_medalNames[postgameMenuInfo.awardsEarned[awardNum]], UI_CENTER, color );

    UI_SPPostgameMenu_DrawAwardsMedals( awardNum + 1 );

    if( !postgameMenuInfo.playedSound[awardNum] ) {
        postgameMenuInfo.playedSound[awardNum] = qtrue;
        trap_S_StartLocalSound( trap_S_RegisterSound( ui_medalSounds[postgameMenuInfo.awardsEarned[awardNum]], qfalse ), CHAN_ANNOUNCER );
    }
}
Пример #25
0
/*
=================
PlayerSettings_DrawEffects
=================
*/
static void PlayerSettings_DrawEffects( void *self ) {
	menulist_s		*item;
	qboolean		focus;
	int				style;
	float			*color;

	item = (menulist_s *)self;
	focus = (item->generic.parent->cursor == item->generic.menuPosition);

	style = UI_LEFT|UI_SMALLFONT|UI_CURSORSHADOW;
	color = text_color_normal;
	if( focus ) {
		style |= UI_PULSE;
		color = text_color_highlight;
	}

	UI_DrawProportionalString( item->generic.x, item->generic.y, "Effects", style, color );

	UI_DrawHandlePic( item->generic.x + 64, item->generic.y + PROP_HEIGHT + 8, 128, 8, s_playersettings.fxBasePic );
	UI_DrawHandlePic( item->generic.x + 64 + item->curvalue * 16 + 8, item->generic.y + PROP_HEIGHT + 6, 16, 12, s_playersettings.fxPic[item->curvalue] );
}
Пример #26
0
static void
DrawAwardsPresentation(int timer)
{
	int	awardNum, atimer, a;
	Vec4	color;
	const int t = AWARD_PRESENTATION_TIME;
	
	awardNum = timer / t;
	atimer = timer % t;
	a = postgame.awardsEarned[awardNum];
	color[0] = color[1] = color[2] = 1.0f;
	color[3] = (float)(t - atimer) / (float)t;
	UI_DrawProportionalString(320, 64, ui_medalNames[a], UI_CENTER, color);

	DrawAwardsMedals(awardNum + 1);

	if(!postgame.playedSound[awardNum]){
		Handle snd;

		postgame.playedSound[awardNum] = qtrue;
		snd = trap_sndregister(ui_medalSounds[a], qfalse);
		trap_sndstartlocalsound(snd, CHAN_ANNOUNCER);
	}
}
Пример #27
0
static void ConfirmMenu_Draw( void ) 
{
	UI_MenuFrame(&s_confirm.menu);

	// End of upper line
	ui.R_SetColor( colorTable[CT_LTBROWN1]);
	UI_DrawHandlePic( 482, 136,  MENU_BUTTON_MED_WIDTH - 22, MENU_BUTTON_MED_HEIGHT, uis.whiteShader);
	UI_DrawHandlePic( 460 + MENU_BUTTON_MED_WIDTH -6 , 136,  -19,  MENU_BUTTON_MED_HEIGHT, uis.graphicButtonLeftEnd);	//right

	ui.R_SetColor( colorTable[CT_DKBLUE2]);
	UI_DrawHandlePic( 30,  203,  47,  186, uis.whiteShader);	// Left hand column

	UI_DrawProportionalString(  74,  66, "286",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  84, "386",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  188, "486",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  207, "8088",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);
	UI_DrawProportionalString(  74,  395, "12799",UI_RIGHT|UI_TINYFONT, colorTable[CT_BLACK]);


	ui.R_SetColor( colorTable[CT_LTBLUE1]);
	UI_DrawHandlePic( 132, 142,  128,  -64, s_confirm.cornerPic);	// Top Left corner
	UI_DrawHandlePic( 132, 352,  128,   64, s_confirm.cornerPic);	// Bottom Left corner

	UI_DrawHandlePic( 429, 142, -128,  -64, s_confirm.cornerPic);	// Top Right corner
	UI_DrawHandlePic( 429, 352, -128,   64, s_confirm.cornerPic);	// Bottom Right corner

	UI_DrawHandlePic(145,175,  395, 18, uis.whiteShader);		// Top
	UI_DrawHandlePic(132,193,  47, 175, uis.whiteShader);		// Left side
	UI_DrawHandlePic(510,193,  47, 175, uis.whiteShader);		// Right side
	UI_DrawHandlePic(147,365,  65, 18, uis.whiteShader);		// Bottom Left
	UI_DrawHandlePic(477,365,  65, 18, uis.whiteShader);		// Bottom Right


	UI_DrawProportionalString( 345, 269, s_confirm.question, UI_SMALLFONT | UI_CENTER, color_red );
	Menu_Draw( &s_confirm.menu );

	if( s_confirm.draw ) 
	{
		s_confirm.draw();
	}
}
Пример #28
0
static void UI_SPLevelMenu_MenuDraw( void ) {
	int				n, i;
	int				x, y;
	vec4_t			color;
	int				level;
//	int				fraglimit;
	int				pad;
	char			buf[MAX_INFO_VALUE];
	char			string[64];

	if(	levelMenuInfo.reinit ) {
		UI_PopMenu();
		UI_SPLevelMenu();
		return;
	}

	// draw player name
	trap_Cvar_VariableStringBuffer( "name", string, 32 );
	Q_CleanStr( string );
	UI_DrawProportionalString( 320, PLAYER_Y, string, UI_CENTER|UI_SMALLFONT, color_orange );

	// check for model changes
	trap_Cvar_VariableStringBuffer( "model", buf, sizeof(buf) );
	if( Q_stricmp( buf, levelMenuInfo.playerModel ) != 0 ) {
		Q_strncpyz( levelMenuInfo.playerModel, buf, sizeof(levelMenuInfo.playerModel) );
		PlayerIcon( levelMenuInfo.playerModel, levelMenuInfo.playerPicName, sizeof(levelMenuInfo.playerPicName) );
		levelMenuInfo.item_player.shader = 0;
	}

	// standard menu drawing
	Menu_Draw( &levelMenuInfo.menu );

	// draw player award levels
	y = AWARDS_Y;
	i = 0;
	for( n = 0; n < 6; n++ ) {
		level = levelMenuInfo.awardLevels[n];
		if( level > 0 ) {
			if( i & 1 ) {
				x = 224 - (i - 1 ) / 2 * (48 + 16);
			}
			else {
				x = 368 + i / 2 * (48 + 16);
			}
			i++;

			if( level == 1 ) {
				continue;
			}

			if( level >= 1000000 ) {
				Com_sprintf( string, sizeof(string), "%im", level / 1000000 );
			}
			else if( level >= 1000 ) {
				Com_sprintf( string, sizeof(string), "%ik", level / 1000 );
			}
			else {
				Com_sprintf( string, sizeof(string), "%i", level );
			}

			UI_DrawString( x + 24, y + 48, string, UI_CENTER, color_yellow );
		}
	}

	UI_DrawProportionalString( 18, 38, va( "Tier %i", selectedArenaSet + 1 ), UI_LEFT|UI_SMALLFONT, color_orange );

	for ( n = 0; n < levelMenuInfo.numMaps; n++ ) {
		x = levelMenuInfo.item_maps[n].generic.x;
		y = levelMenuInfo.item_maps[n].generic.y;
		UI_FillRect( x, y + 96, 128, 18, color_black );
	}

	if ( selectedArenaSet > currentSet ) {
		UI_DrawProportionalString( 320, 216, "ACCESS DENIED", UI_CENTER|UI_BIGFONT, color_red );
		return;
	}

	// show levelshots for levels of current tier
	Vector4Copy( color_white, color );
	color[3] = 0.5+0.5*sin(uis.realtime/PULSE_DIVISOR);
	for ( n = 0; n < levelMenuInfo.numMaps; n++ ) {
		x = levelMenuInfo.item_maps[n].generic.x;
		y = levelMenuInfo.item_maps[n].generic.y;

		UI_DrawString( x + 64, y + 96, levelMenuInfo.levelNames[n], UI_CENTER|UI_SMALLFONT, color_orange );

		if( levelMenuInfo.levelScores[n] == 1 ) {
			UI_DrawHandlePic( x, y, 128, 96, levelMenuInfo.levelCompletePic[levelMenuInfo.levelScoresSkill[n] - 1] ); 
		}

		if ( n == selectedArena ) {
			if( Menu_ItemAtCursor( &levelMenuInfo.menu ) == &levelMenuInfo.item_maps[n] ) {
				trap_R_SetColor( color );
			}
			UI_DrawHandlePic( x-1, y-1, 130, 130 - 14, levelMenuInfo.levelSelectedPic ); 
			trap_R_SetColor( NULL );
		}
		else if( Menu_ItemAtCursor( &levelMenuInfo.menu ) == &levelMenuInfo.item_maps[n] ) {
			trap_R_SetColor( color );
			UI_DrawHandlePic( x-31, y-30, 256, 256-27, levelMenuInfo.levelFocusPic); 
			trap_R_SetColor( NULL );
		}
	}

	// show map name and long name of selected level
	y = 192;
	Q_strncpyz( buf, Info_ValueForKey( levelMenuInfo.selectedArenaInfo, "map" ), 20 );
	Q_strupr( buf );
	Com_sprintf( string, sizeof(string), "%s: %s", buf, Info_ValueForKey( levelMenuInfo.selectedArenaInfo, "longname" ) );
	UI_DrawProportionalString( 320, y, string, UI_CENTER|UI_SMALLFONT, color_orange );

//	fraglimit = atoi( Info_ValueForKey( levelMenuInfo.selectedArenaInfo, "fraglimit" ) );
//	UI_DrawString( 18, 212, va("Frags %i", fraglimit) , UI_LEFT|UI_SMALLFONT, color_orange );

	// draw bot opponents
	y += 24;
	pad = (7 - levelMenuInfo.numBots) * (64 + 26) / 2;
	for( n = 0; n < levelMenuInfo.numBots; n++ ) {
		x = 18 + pad + (64 + 26) * n;
		if( levelMenuInfo.botPics[n] ) {
			UI_DrawHandlePic( x, y, 64, 64, levelMenuInfo.botPics[n]);
		}
		else {
			UI_FillRect( x, y, 64, 64, color_black );
			UI_DrawProportionalString( x+22, y+18, "?", UI_BIGFONT, color_orange );
		}
		UI_DrawString( x, y + 64, levelMenuInfo.botNames[n], UI_SMALLFONT|UI_LEFT, color_orange );
	}
}
Пример #29
0
/*
=================
UI_SPLevelMenu_ResetEvent
=================
*/
static void UI_SPLevelMenu_ResetDraw( void ) {
	UI_DrawProportionalString( SCREEN_WIDTH/2, 356 + PROP_HEIGHT * 0, "WARNING: This resets all of the", UI_CENTER|UI_SMALLFONT, color_yellow );
	UI_DrawProportionalString( SCREEN_WIDTH/2, 356 + PROP_HEIGHT * 1, "single player game variables.", UI_CENTER|UI_SMALLFONT, color_yellow );
	UI_DrawProportionalString( SCREEN_WIDTH/2, 356 + PROP_HEIGHT * 2, "Do this only if you want to", UI_CENTER|UI_SMALLFONT, color_yellow );
	UI_DrawProportionalString( SCREEN_WIDTH/2, 356 + PROP_HEIGHT * 3, "start over from the beginning.", UI_CENTER|UI_SMALLFONT, color_yellow );
}
Пример #30
0
/*
=================
PlayerSettings_DrawName
=================
*/
static void PlayerSettings_DrawName(void* self) {
    menufield_s*     f;
    qboolean        focus;
    int             style;
    char*            txt;
    char            c;
    float*           color;
    int             n;
    int             basex, x, y;
    char            name[32];

    f = (menufield_s*)self;
    basex = f->generic.x;
    y = f->generic.y;
    focus = (f->generic.parent->cursor == f->generic.menuPosition);

    style = UI_LEFT | UI_SMALLFONT;
    color = text_color_normal;
    if (focus) {
        style |= UI_PULSE;
        color = text_color_highlight;
    }

    UI_DrawProportionalString(basex, y, "Name", style, color);

    // draw the actual name
    basex += 64;
    y += PROP_HEIGHT;
    txt = f->field.buffer;
    color = g_color_table[ColorIndex(COLOR_WHITE)];
    x = basex;
    while ((c = *txt) != 0) {
        if (!focus && Q_IsColorString(txt)) {
            n = ColorIndex(*(txt + 1));
            if (n == 0) {
                n = 7;
            }
            color = g_color_table[n];
            txt += 2;
            continue;
        }
        UI_DrawChar(x, y, c, style, color);
        txt++;
        x += SMALLCHAR_WIDTH;
    }

    // draw cursor if we have focus
    if (focus) {
        if (trap_Key_GetOverstrikeMode()) {
            c = 11;
        } else {
            c = 10;
        }

        style &= ~UI_PULSE;
        style |= UI_BLINK;

        UI_DrawChar(basex + f->field.cursor * SMALLCHAR_WIDTH, y, c, style, color_white);
    }

    // draw at bottom also using proportional font
    Q_strncpyz(name, f->field.buffer, sizeof(name));
    Q_CleanStr(name);
    UI_DrawProportionalString(320, 440, name, UI_CENTER | UI_BIGFONT, text_color_normal);
}