예제 #1
0
파일: ui_menu.c 프로젝트: entdark/q3mme
static void Main_MenuDraw( void ) {

	static vec4_t color  = { 0.7f, 0.0f, 0.0f, 1.0f };
	UI_BackGroundRender( 0, 0, 640, 480, 0 );
	
	if (strlen(s_errorMessage.errorMessage))
	{
		UI_DrawProportionalString_AutoWrapped( 320, 192, 600, 20, s_errorMessage.errorMessage, UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
	} else {
		// standard menu drawing
		Menu_Draw( &s_main.menu );
	}

	UI_DrawString( 320, 450, "Quake III Movie Makers Edition " Q3_VERSION_NUMBER, UI_CENTER|UI_SMALLFONT, color );
}
예제 #2
0
/*
========================
UI_DrawConnectScreen

This will also be overlaid on the cgame info screen during loading
to prevent it from blinking away too rapidly on local or lan games.
========================
*/
void UI_DrawConnectScreen( qboolean overlay ) {
	char			*s;
	uiClientState_t	cstate;
	char			info[MAX_INFO_VALUE];

	Menu_Cache();

	if ( !overlay ) {
		// draw the dialog background
		UI_SetColor( color_white );
		UI_DrawHandlePic( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, uis.connecting );
	}

	// see what information we should display
	trap_GetClientState( &cstate );

	info[0] = '\0';
	if( trap_GetConfigString( CS_SERVERINFO, info, sizeof(info) ) ) {
		UI_DrawProportionalString( 320, 16, va( "Loading %s", Info_ValueForKey( info, "mapname" ) ), UI_BIGFONT|UI_CENTER|UI_DROPSHADOW, 1.0, g_color_table[60] );
	}

	UI_DrawProportionalString( 320, 64, va("Connecting to %s", cstate.servername), UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, 0.75, g_color_table[60] );
	//UI_DrawProportionalString( 320, 96, "Press Esc to abort", UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );

	// display global MOTD at bottom
	UI_DrawProportionalString( SCREEN_WIDTH/2, SCREEN_HEIGHT-32, 
		Info_ValueForKey( cstate.updateInfoString, "motd" ), UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, 0.75, menu_text_color );
	
	// print any server info (server full, bad version, etc)
	if ( cstate.connState < CA_CONNECTED ) {
		UI_DrawProportionalString_AutoWrapped( 320, 192, 630, 20, cstate.messageString, UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
		//Here is what prints the ban message!
		//Com_Printf("DBG: %s\n", cstate.messageString);
	}

#if 0
	// display password field
	if ( passwordNeeded ) {
		s_ingame_menu.x = SCREEN_WIDTH * 0.50 - 128;
		s_ingame_menu.nitems = 0;
		s_ingame_menu.wrapAround = qtrue;

		passwordField.generic.type = MTYPE_FIELD;
		passwordField.generic.name = "Password:"******"password"), 
			sizeof(passwordField.field.buffer) );

		Menu_AddItem( &s_ingame_menu, ( void * ) &s_customize_player_action );

		MField_Draw( &passwordField );
	}
#endif

	if ( lastConnState > cstate.connState ) {
		lastLoadingText[0] = '\0';
	}
	lastConnState = cstate.connState;

	switch ( cstate.connState ) {
	case CA_CONNECTING:
		s = va("Awaiting challenge...%i", cstate.connectPacketCount);
		break;
	case CA_CHALLENGING:
		s = va("Awaiting connection...%i", cstate.connectPacketCount);
		break;
	case CA_CONNECTED: {
		char downloadName[MAX_INFO_VALUE];

			trap_Cvar_VariableStringBuffer( "cl_downloadName", downloadName, sizeof(downloadName) );
			if (*downloadName) {
				UI_DisplayDownloadInfo( downloadName );
				return;
			}
		}
		s = "Awaiting gamestate...";
		break;
	case CA_LOADING:
		return;
	case CA_PRIMED:
		return;
	default:
		return;
	}

	UI_DrawProportionalString( 320, 128, s, UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, 0.75, g_color_table[60] );

	// password required / connection rejected information goes here
}
예제 #3
0
static void Main_MenuDraw( void ) {
	refdef_t		refdef;
	//refEntity_t		ent;
	//vec3_t			origin;
	//vec3_t			angles;
	float			adjust;
	float			x, y, w, h;
	vec4_t			color = {1, 1, 1, 1};
	int sy;

	// setup the refdef

	memset( &refdef, 0, sizeof( refdef ) );

	refdef.rdflags = RDF_NOWORLDMODEL;

	AxisClear( refdef.viewaxis );

	x = 0;
	y = 0;
	w = 640;
	h = 120;
	UI_AdjustFrom640( &x, &y, &w, &h );
	refdef.x = x;
	refdef.y = y;
	refdef.width = w;
	refdef.height = h;

	adjust = 0; // JDC: Kenneth asked me to stop this 1.0 * sin( (float)uis.realtime / 1000 );
	refdef.fov_x = 60 + adjust;
	refdef.fov_y = 19.6875 + adjust;

	refdef.time = uis.realtime;

	//origin[0] = 300;
	//origin[1] = 0;
	//origin[2] = -32;

	trap_R_ClearScene();

#if 0
	// add the model

	memset( &ent, 0, sizeof(ent) );

	adjust = 5.0 * sin( (float)uis.realtime / 5000 );
	VectorSet( angles, 0, 180 + adjust, 0 );
	AnglesToAxis( angles, ent.axis );
	ent.hModel = s_main.bannerModel;
	VectorCopy( origin, ent.origin );
	VectorCopy( origin, ent.lightingOrigin );
	ent.renderfx = RF_LIGHTING_ORIGIN | RF_NOSHADOW;
	VectorCopy( ent.origin, ent.oldorigin );

	//trap_R_AddRefEntityToScene( &ent );
#endif
	trap_R_RenderScene( &refdef );

	//UI_DrawProportionalString( 320, 372, "DEMO      FOR MATURE AUDIENCES      DEMO", UI_CENTER|UI_SMALLFONT, color );
	if (uis.showErrorMenu) {
		//UI_DrawProportionalString(0, 0, "You need to copy quakelive's baseq3 directory into ", UI_SMALLFONT, color);
		sy = 0;
		sy += 2 * SMALLCHAR_HEIGHT;
		UI_DrawString(0, sy, "  Installation is incomplete.", UI_SMALLFONT, color);
		sy += 2 * SMALLCHAR_HEIGHT;
		UI_DrawString(0, sy, "  You need to copy the files in quakelive's baseq3 directory", UI_SMALLFONT, color);
		sy += SMALLCHAR_HEIGHT;
		UI_DrawString(0, sy, "  (the files ending with .pk3) into wolfcam's baseq3 directory.", UI_SMALLFONT, color);
		//return;
	}


	if (strlen(s_errorMessage.errorMessage))
	{
		UI_DrawProportionalString_AutoWrapped( 320, 192, 600, 20, s_errorMessage.errorMessage, UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
	}
	else
	{
		// standard menu drawing
		Menu_Draw( &s_main.menu );
	}

#if 0
	if (uis.demoversion) {
		UI_DrawProportionalString( 320, 372, "DEMO      FOR MATURE AUDIENCES      DEMO", UI_CENTER|UI_SMALLFONT, color );
		UI_DrawString( 320, 400, "Quake III Arena(c) 1999-2000, Id Software, Inc.  All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
	} else {
		UI_DrawString( 320, 450, "Quake III Arena(c) 1999-2000, Id Software, Inc.  All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
	}
#endif
}
예제 #4
0
static void Main_MenuDraw( void ) {
	refdef_t		refdef;
	refEntity_t		ent;
	vec3_t			origin;
	vec3_t			angles;
	float			adjust;
	float			x, y, w, h;
	vec4_t			color = {0.5, 0, 0, 1};

	// setup the refdef

	memset( &refdef, 0, sizeof( refdef ) );

	refdef.rdflags = RDF_NOWORLDMODEL;

	AxisClear( refdef.viewaxis );

	x = 0;
	y = 0;
	w = 640;
	h = 120;
	CG_AdjustFrom640( &x, &y, &w, &h );
	refdef.x = x;
	refdef.y = y;
	refdef.width = w;
	refdef.height = h;

	adjust = 0; // JDC: Kenneth asked me to stop this 1.0 * sin( (float)uis.realtime / 1000 );
	refdef.fov_x = 60 + adjust;
	refdef.fov_y = 19.6875 + adjust;

	refdef.time = uis.realtime;

	origin[0] = 300;
	origin[1] = 0;
	origin[2] = -32;

	trap_R_ClearScene();

	// add the model

	memset( &ent, 0, sizeof(ent) );

	adjust = 5.0 * sin( (float)uis.realtime / 5000 );
	VectorSet( angles, 0, 180 + adjust, 0 );
	AnglesToAxis( angles, ent.axis );
	ent.hModel = s_main.bannerModel;
	VectorCopy( origin, ent.origin );
	VectorCopy( origin, ent.lightingOrigin );
	ent.renderfx = RF_LIGHTING_ORIGIN | RF_NOSHADOW;
	VectorCopy( ent.origin, ent.oldorigin );

	CG_AddRefEntityWithMinLight( &ent );

	trap_R_RenderScene( &refdef );
	
	if (strlen(s_errorMessage.errorMessage))
	{
		UI_DrawProportionalString_AutoWrapped( 320, 192, 600, 20, s_errorMessage.errorMessage, UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
	}
	else
	{
		// standard menu drawing
		Menu_Draw( &s_main.menu );		
	}

	if (uis.demoversion) {
		UI_DrawProportionalString( 320, 372, "DEMO      FOR MATURE AUDIENCES      DEMO", UI_CENTER|UI_SMALLFONT, color );
		UI_DrawString( 320, 400, "Quake III Arena(c) 1999-2000, Id Software, Inc.  All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
	} else if (uis.demotestversion) {
		UI_DrawProportionalString( 320, 372, "DEMOTEST      FOR MATURE AUDIENCES      DEMOTEST", UI_CENTER|UI_SMALLFONT, color );
		UI_DrawString( 320, 400, "Quake III Arena(c) 1999-2000, Id Software, Inc.  All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );	
		UI_DrawString( 320, 428, "This test may only be distributed electronically. Physical media (e.g. CD-ROM's, floppies, etc.) redistribution of the demo test is prohibited. Refer to the End User License Agreement for further details.", UI_CENTER|UI_SMALLFONT, color );
	} else {
		UI_DrawString( 320, 450, "Quake III Arena(c) 1999-2000, Id Software, Inc.  All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
	}
}
예제 #5
0
파일: ui_menu.c 프로젝트: bludshot/alturt
static void Main_MenuDraw( void ) {
	refdef_t		refdef;
	//refEntity_t		ent; //blud commenting out the Q3Arena main menu title model
	vec3_t			origin;
	//vec3_t			angles; //blud commenting out the Q3Arena main menu title model
	float			adjust;
	float			x, y, w, h;
	vec4_t			color = {1, 1, 1, 1};

	// setup the refdef

	memset( &refdef, 0, sizeof( refdef ) );

	refdef.rdflags = RDF_NOWORLDMODEL;

	AxisClear( refdef.viewaxis );

	x = 0;
	y = 0;
	w = 640;
	h = 120;
	UI_AdjustFrom640( &x, &y, &w, &h );
	refdef.x = x;
	refdef.y = y;
	refdef.width = w;
	refdef.height = h;

	adjust = 0; // JDC: Kenneth asked me to stop this 1.0 * sin( (float)uis.realtime / 1000 );
	refdef.fov_x = 60 + adjust;
	refdef.fov_y = 19.6875 + adjust;

	refdef.time = uis.realtime;

	origin[0] = 300;
	origin[1] = 0;
	origin[2] = -32;

	trap_R_ClearScene();

	// add the model
/* blud commenting out the Q3Arena main menu title model

	memset( &ent, 0, sizeof(ent) );

	adjust = 5.0 * sin( (float)uis.realtime / 5000 );
	VectorSet( angles, 0, 180 + adjust, 0 );
	AnglesToAxis( angles, ent.axis );
	ent.hModel = s_main.bannerModel;
	VectorCopy( origin, ent.origin );
	VectorCopy( origin, ent.lightingOrigin );
	ent.renderfx = RF_LIGHTING_ORIGIN | RF_NOSHADOW;
	VectorCopy( ent.origin, ent.oldorigin );

	trap_R_AddRefEntityToScene( &ent );

	trap_R_RenderScene( &refdef );
*/

	if (strlen(s_errorMessage.errorMessage))
	{
		UI_DrawProportionalString_AutoWrapped( 320, 192, 600, 20, s_errorMessage.errorMessage, UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
	}
	else
	{
		// standard menu drawing
		Menu_Draw( &s_main.menu );
	}

	if (uis.demoversion) {
		UI_DrawProportionalString( 320, 372, "DEMO      FOR MATURE AUDIENCES      DEMO", UI_CENTER|UI_SMALLFONT, color );
		UI_DrawString( 320, 400, "Quake III Arena(c) 1999-2000, Id Software, Inc.  All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
	} else {
		UI_DrawString( 320, 450, "Quake III Arena(c) 1999-2000, Id Software, Inc.  All Rights Reserved", UI_CENTER|UI_SMALLFONT, color );
	}
}
예제 #6
0
static void Main_MenuDraw( void )
{
	refdef_t		refdef;
	refEntity_t		ent;
	vec3_t			origin;
	vec3_t			angles;
	float			adjust;
	float			x, y, w, h;
	vec4_t			color = {0.2, 0.2, 1.0, 1};

	// setup the refdef

	memset( &refdef, 0, sizeof( refdef ) );

	refdef.rdflags = RDF_NOWORLDMODEL;

	AxisClear( refdef.viewaxis );

	x = 0;
	y = 0;
	w = 640;
	h = 120;
	UI_AdjustFrom640( &x, &y, &w, &h );
	refdef.x = x;
	refdef.y = y;
	refdef.width = w;
	refdef.height = h;

	adjust = 0; // JDC: Kenneth asked me to stop this 1.0 * sin( (float)uis.realtime / 1000 );
	refdef.fov_x = 60 + adjust;
	refdef.fov_y = 19.6875 + adjust;

	refdef.time = uis.realtime;

	origin[0] = 300;
	origin[1] = 0;
	origin[2] = -32;

	trap_R_ClearScene();

	// add the model

	memset( &ent, 0, sizeof(ent) );

	adjust = 5.0 * sin( (float)uis.realtime / 5000 );
	VectorSet( angles, 0, 180 + adjust, 0 );
	AnglesToAxis( angles, ent.axis );
	ent.hModel = s_main.bannerModel;
	VectorCopy( origin, ent.origin );
	VectorCopy( origin, ent.lightingOrigin );
	ent.renderfx = RF_LIGHTING_ORIGIN | RF_NOSHADOW;
	VectorCopy( ent.origin, ent.oldorigin );

	trap_R_AddRefEntityToScene( &ent );

	trap_R_RenderScene( &refdef );

	if (strlen(s_errorMessage.errorMessage)) {
		UI_DrawProportionalString_AutoWrapped( 320, 192, 600, 20, s_errorMessage.errorMessage, UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, menu_text_color );
	}
	else {
		// standard menu drawing
		Menu_Draw( &s_main.menu );
	}

	UI_DrawProportionalString( 320, 372, "", UI_CENTER|UI_SMALLFONT, color );
	UI_DrawString( 320, 400, "OpenArena(c) 2005-2018 OpenArena Team", UI_CENTER|UI_SMALLFONT, color );
	UI_DrawString( 320, 414, "OpenArena comes with ABSOLUTELY NO WARRANTY; this is free software", UI_CENTER|UI_SMALLFONT, color );
	UI_DrawString( 320, 428, "and you are welcome to redistribute it under certain conditions;", UI_CENTER|UI_SMALLFONT, color );
	UI_DrawString( 320, 444, "read COPYING for details.", UI_CENTER|UI_SMALLFONT, color );

	//Draw version.
	UI_DrawString( 640-40, 480-14, "^7" OA_VERSION, UI_SMALLFONT, color );
	if ((int)trap_Cvar_VariableValue("protocol")!=OA_STD_PROTOCOL) {
		UI_DrawString( 0, 480-14, va("^7Protocol: %i",(int)trap_Cvar_VariableValue("protocol")), UI_SMALLFONT, color);
	}
}
예제 #7
0
파일: ui_menu.c 프로젝트: zturtleman/q3rain
static void Main_MenuDraw(void) {
    refdef_t refdef;
    refEntity_t ent;
    vec3_t origin;
    vec3_t angles;
    float adjust;
    float x, y, w, h;
    vec4_t color;
    qboolean connected = qtrue;
    vec4_t oldColor = {0.8, 0.8, 0.8, 1};

    // FIXME dont call on every update...
    s_main.servers = (int) trap_Cvar_VariableValue("ma_servers");
    s_main.players = (int) trap_Cvar_VariableValue("ma_players");
    s_main.motd = UI_Cvar_VariableString("ma_motd");

    if (!s_main.motd || !Q_stricmp(s_main.motd, "")) {
        s_main.motd = "Failed to connect to master server";
        connected = qfalse;
    }

    // options the refdef

    memset(&refdef, 0, sizeof ( refdef));

    refdef.rdflags = RDF_NOWORLDMODEL;

    AxisClear(refdef.viewaxis);

    x = 0;
    y = 0;
    w = 640;
    h = 120;
    UI_AdjustFrom640(&x, &y, &w, &h);
    refdef.x = x;
    refdef.y = y;
    refdef.width = w;
    refdef.height = h;

    adjust = 0; // JDC: Kenneth asked me to stop this 1.0 * sin( (float)uis.realtime / 1000 );
    refdef.fov_x = 60 + adjust;
    refdef.fov_y = 19.6875 + adjust;

    refdef.time = uis.realtime;

    origin[0] = 300;
    origin[1] = 0;
    origin[2] = -32;

    trap_R_ClearScene();

    // add the model

    memset(&ent, 0, sizeof (ent));

    /*adjust = 5.0 * sin((float) uis.realtime / 5000);
    VectorSet(angles, 0, 180 + adjust, 0);
    AnglesToAxis(angles, ent.axis);
    ent.hModel = s_main.bannerModel;
    VectorCopy(origin, ent.origin);
    VectorCopy(origin, ent.lightingOrigin);
    ent.renderfx = RF_LIGHTING_ORIGIN | RF_NOSHADOW;
    VectorCopy(ent.origin, ent.oldorigin);*/

    x = 0;
    y = 0;
    w = 640;
    h = 64;
    UI_FillRect(x, y, w, h, color_black);

    x = 16;
    y = 16;
    UI_DrawString(x, y, "Hazewood", UI_LEFT, color_green);

    x = 196;
    y = 28;
    if (connected) {
      UI_DrawString(x, y, va("%s", s_main.motd), UI_LEFT | UI_SMALLERFONT, color_white);
    } else {
      UI_DrawString(x, y, va("%s", s_main.motd), UI_LEFT | UI_SMALLERFONT, color_red);
    }

    x = 640 - 196 + 48;
    y = 12;
    if (s_main.servers > 0) {
        UI_DrawString(x, y, va("%i Servers", s_main.servers), UI_LEFT | UI_SMALLFONT, color_blue);
    } else {
        UI_DrawString(x, y, va("%i Servers", s_main.servers), UI_LEFT | UI_SMALLFONT, color_red);
    }

    y = 36;
    if (s_main.players > 0) {
        UI_DrawString(x, y, va("%i Players", s_main.players), UI_LEFT | UI_SMALLFONT, color_blue);
    } else {
        UI_DrawString(x, y, va("%i Players", s_main.players), UI_LEFT | UI_SMALLFONT, color_red);
    }

    x = 0;
    y = 480 - 64;
    w = 640;
    h = 64;
    UI_FillRect(x, y, w, h, color_black);

    x = 0;
    y = 64;
    w = 640;
    h = 480 - 128;

    if (!s_main.up) {
        s_main.fade -= ((float) uis.frametime) / 10.0f;
    } else {
        s_main.fade += ((float) uis.frametime) / 10.0f;
    }
    if (s_main.fade >= 1200.0f) {
        s_main.up = qfalse;
        s_main.currentScene++;
        if (s_main.currentScene >= MAX_MENU_SCENES) {
            s_main.currentScene = 0;
        }
    }
    if (s_main.fade <= -100.0f) {
        s_main.up = qtrue;
    }

    Vector4Copy(oldColor, color);

    UI_DrawHandlePic(x, y, w, h, trap_R_RegisterShaderNoMip(va("gfx/scenes/%i", s_main.currentScene)));

    color[3] = s_main.fade / 1000.0f;
    if (color[3] > 1) {
        color[3] = 1;
    }
    if (color[3] < 0) {
        color[3] = 0;
    }
    trap_R_SetColor(color);
    UI_DrawNamedPic(x, y, w, h, "gfx/colors/blue.jpg");

    trap_R_SetColor(oldColor);

    trap_R_AddRefEntityToScene(&ent);

    trap_R_RenderScene(&refdef);

    if (strlen(s_errorMessage.errorMessage)) {
        UI_DrawProportionalString_AutoWrapped(320, 192, 600, 20, s_errorMessage.errorMessage, UI_CENTER | UI_SMALLFONT | UI_DROPSHADOW, menu_text_color);
    } else {
        Menu_Draw(&s_main.menu);
    }
}