Index: code/q3_ui/ui_local.h =================================================================== --- code/q3_ui/ui_local.h (revision 2064) +++ code/q3_ui/ui_local.h (working copy) @@ -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; Index: code/q3_ui/ui_players.c =================================================================== --- code/q3_ui/ui_players.c (revision 2064) +++ code/q3_ui/ui_players.c (working copy) @@ -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; @@ -1140,9 +1146,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[1]; + pi->c1RGBA[3] = 255; + // view angles VectorCopy( viewAngles, pi->viewAngles ); Index: code/q3_ui/ui_preferences.c =================================================================== --- code/q3_ui/ui_preferences.c (revision 2064) +++ code/q3_ui/ui_preferences.c (working copy) @@ -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; @@ -217,7 +213,63 @@ UI_DrawHandlePic( x + SMALLCHAR_WIDTH, y - 4, 24, 24, s_preferences.crosshairShader[s->curvalue] ); } +/* +================= +Preferences_MenuKey +================= +*/ +static sfxHandle_t Preferences_MenuKey( int key ) { + menulist_s* s; + sfxHandle_t sound; + s = (menulist_s *)Menu_ItemAtCursor( &s_preferences.menu ); + + if( s->generic.id != ID_CROSSHAIR ) { + return ( Menu_DefaultKey( &s_preferences.menu, key ) ); + } + + sound = 0; + switch( key ) { + default: + return ( Menu_DefaultKey( &s_preferences.menu, key ) ); + + case K_MOUSE1: + s->curvalue++; + if( s->curvalue >= s->numitems ) + s->curvalue = 0; + + sound = menu_move_sound; + break; + + case K_KP_LEFTARROW: + case K_LEFTARROW: + if( s->curvalue > 0 ) + s->curvalue--; + else + s->curvalue = NUM_CROSSHAIRS - 1; + + sound = menu_move_sound; + + break; + + case K_KP_RIGHTARROW: + case K_RIGHTARROW: + if( s->curvalue < s->numitems - 1 ) + s->curvalue++; + else + s->curvalue = 0; + + sound = menu_move_sound; + + break; + } + + if( sound && s->generic.callback ) + s->generic.callback( s, QM_ACTIVATED ); + + return ( sound ); +} + static void Preferences_MenuInit( void ) { int y; @@ -225,6 +277,7 @@ Preferences_Cache(); + s_preferences.menu.key = Preferences_MenuKey; s_preferences.menu.wrapAround = qtrue; s_preferences.menu.fullscreen = qtrue; @@ -259,6 +312,7 @@ s_preferences.crosshair.generic.name = "Crosshair:"; s_preferences.crosshair.generic.callback = Preferences_Event; s_preferences.crosshair.generic.ownerdraw = Crosshair_Draw; + s_preferences.crosshair.numitems = NUM_CROSSHAIRS; s_preferences.crosshair.generic.id = ID_CROSSHAIR; s_preferences.crosshair.generic.top = y - 4; s_preferences.crosshair.generic.bottom = y + 20; Index: code/q3_ui/ui_qmenu.c =================================================================== --- code/q3_ui/ui_qmenu.c (revision 2064) +++ code/q3_ui/ui_qmenu.c (working copy) @@ -807,24 +807,20 @@ case K_KP_LEFTARROW: case K_LEFTARROW: - if (s->curvalue > 0) - { + if( s->curvalue > 0 ) s->curvalue--; - sound = menu_move_sound; - } else - sound = menu_buzz_sound; + s->curvalue = s->numitems - 1; + sound = menu_move_sound; break; case K_KP_RIGHTARROW: case K_RIGHTARROW: - if (s->curvalue < s->numitems-1) - { + if( s->curvalue < s->numitems - 1 ) s->curvalue++; - sound = menu_move_sound; - } else - sound = menu_buzz_sound; + s->curvalue = 0; + sound = menu_move_sound; break; }