[quake3-commits] r2066 - trunk/code/q3_ui

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Jul 7 12:12:53 EDT 2011


Author: thilo
Date: 2011-07-07 12:12:53 -0400 (Thu, 07 Jul 2011)
New Revision: 2066

Modified:
   trunk/code/q3_ui/ui_local.h
   trunk/code/q3_ui/ui_players.c
   trunk/code/q3_ui/ui_preferences.c
   trunk/code/q3_ui/ui_qmenu.c
Log:
Add fixes to ui menu by Ensiform and DevHC (#5062)


Modified: trunk/code/q3_ui/ui_local.h
===================================================================
--- trunk/code/q3_ui/ui_local.h	2011-07-07 16:07:58 UTC (rev 2065)
+++ trunk/code/q3_ui/ui_local.h	2011-07-07 16:12:53 UTC (rev 2066)
@@ -492,6 +492,9 @@
 	vec3_t			flashDlightColor;
 	int				muzzleFlashTime;
 
+	vec3_t			color1;
+	byte			c1RGBA[4];
+
 	// currently in use drawing parms
 	vec3_t			viewAngles;
 	vec3_t			moveAngles;

Modified: trunk/code/q3_ui/ui_players.c
===================================================================
--- trunk/code/q3_ui/ui_players.c	2011-07-07 16:07:58 UTC (rev 2065)
+++ trunk/code/q3_ui/ui_players.c	2011-07-07 16:12:53 UTC (rev 2066)
@@ -819,6 +819,12 @@
 	if ( pi->currentWeapon != WP_NONE ) {
 		memset( &gun, 0, sizeof(gun) );
 		gun.hModel = pi->weaponModel;
+		if( pi->currentWeapon == WP_RAILGUN ) {
+			Byte4Copy( pi->c1RGBA, gun.shaderRGBA );
+		}
+		else {
+			Byte4Copy( colorWhite, gun.shaderRGBA );
+		}
 		VectorCopy( origin, gun.lightingOrigin );
 		UI_PositionEntityOnTag( &gun, &torso, pi->torsoModel, "tag_weapon");
 		gun.renderfx = renderfx;
@@ -857,6 +863,12 @@
 		if ( pi->flashModel ) {
 			memset( &flash, 0, sizeof(flash) );
 			flash.hModel = pi->flashModel;
+			if( pi->currentWeapon == WP_RAILGUN ) {
+				Byte4Copy( pi->c1RGBA, flash.shaderRGBA );
+			}
+			else {
+				Byte4Copy( colorWhite, flash.shaderRGBA );
+			}
 			VectorCopy( origin, flash.lightingOrigin );
 			UI_PositionEntityOnTag( &flash, &gun, pi->weaponModel, "tag_flash");
 			flash.renderfx = renderfx;
@@ -1140,9 +1152,36 @@
 void UI_PlayerInfo_SetInfo( playerInfo_t *pi, int legsAnim, int torsoAnim, vec3_t viewAngles, vec3_t moveAngles, weapon_t weaponNumber, qboolean chat ) {
 	int			currentAnim;
 	weapon_t	weaponNum;
+	int			c;
 
 	pi->chat = chat;
 
+	c = (int)trap_Cvar_VariableValue( "color1" );
+ 
+	VectorClear( pi->color1 );
+
+	if( c < 1 || c > 7 ) {
+		VectorSet( pi->color1, 1, 1, 1 );
+	}
+	else {
+		if( c & 1 ) {
+			pi->color1[2] = 1.0f;
+		}
+
+		if( c & 2 ) {
+			pi->color1[1] = 1.0f;
+		}
+
+		if( c & 4 ) {
+			pi->color1[0] = 1.0f;
+		}
+	}
+
+	pi->c1RGBA[0] = 255 * pi->color1[0];
+	pi->c1RGBA[1] = 255 * pi->color1[1];
+	pi->c1RGBA[2] = 255 * pi->color1[2];
+	pi->c1RGBA[3] = 255;
+
 	// view angles
 	VectorCopy( viewAngles, pi->viewAngles );
 

Modified: trunk/code/q3_ui/ui_preferences.c
===================================================================
--- trunk/code/q3_ui/ui_preferences.c	2011-07-07 16:07:58 UTC (rev 2065)
+++ trunk/code/q3_ui/ui_preferences.c	2011-07-07 16:12:53 UTC (rev 2066)
@@ -111,10 +111,6 @@
 
 	switch( ((menucommon_s*)ptr)->id ) {
 	case ID_CROSSHAIR:
-		s_preferences.crosshair.curvalue++;
-		if( s_preferences.crosshair.curvalue == NUM_CROSSHAIRS ) {
-			s_preferences.crosshair.curvalue = 0;
-		}
 		trap_Cvar_SetValue( "cg_drawCrosshair", s_preferences.crosshair.curvalue );
 		break;
 
@@ -252,7 +248,7 @@
 	s_preferences.framer.height  	   = 334;
 
 	y = 144;
-	s_preferences.crosshair.generic.type		= MTYPE_TEXT;
+	s_preferences.crosshair.generic.type		= MTYPE_SPINCONTROL;
 	s_preferences.crosshair.generic.flags		= QMF_PULSEIFFOCUS|QMF_SMALLFONT|QMF_NODEFAULTINIT|QMF_OWNERDRAW;
 	s_preferences.crosshair.generic.x			= PREFERENCES_X_POS;
 	s_preferences.crosshair.generic.y			= y;
@@ -264,6 +260,7 @@
 	s_preferences.crosshair.generic.bottom		= y + 20;
 	s_preferences.crosshair.generic.left		= PREFERENCES_X_POS - ( ( strlen(s_preferences.crosshair.generic.name) + 1 ) * SMALLCHAR_WIDTH );
 	s_preferences.crosshair.generic.right		= PREFERENCES_X_POS + 48;
+	s_preferences.crosshair.numitems			= NUM_CROSSHAIRS;
 
 	y += BIGCHAR_HEIGHT+2+4;
 	s_preferences.simpleitems.generic.type        = MTYPE_RADIOBUTTON;

Modified: trunk/code/q3_ui/ui_qmenu.c
===================================================================
--- trunk/code/q3_ui/ui_qmenu.c	2011-07-07 16:07:58 UTC (rev 2065)
+++ trunk/code/q3_ui/ui_qmenu.c	2011-07-07 16:12:53 UTC (rev 2066)
@@ -798,6 +798,8 @@
 	sound = 0;
 	switch (key)
 	{
+		case K_KP_RIGHTARROW:
+		case K_RIGHTARROW:
 		case K_MOUSE1:
 			s->curvalue++;
 			if (s->curvalue >= s->numitems)
@@ -807,25 +809,11 @@
 		
 		case K_KP_LEFTARROW:
 		case K_LEFTARROW:
-			if (s->curvalue > 0)
-			{
-				s->curvalue--;
-				sound = menu_move_sound;
-			}
-			else
-				sound = menu_buzz_sound;
+			s->curvalue--;
+			if (s->curvalue < 0)
+				s->curvalue = s->numitems-1;
+			sound = menu_move_sound;
 			break;
-
-		case K_KP_RIGHTARROW:
-		case K_RIGHTARROW:
-			if (s->curvalue < s->numitems-1)
-			{
-				s->curvalue++;
-				sound = menu_move_sound;
-			}
-			else
-				sound = menu_buzz_sound;
-			break;
 	}
 
 	if ( sound && s->generic.callback )



More information about the quake3-commits mailing list