Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/pakQ3VR/menu/art/fx_base.tga
Binary file not shown.
Binary file modified assets/third_party/baseq3a/pak8a.pk3
Binary file not shown.
4 changes: 2 additions & 2 deletions code/cgame/cg_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2061,9 +2061,9 @@ static void CG_CrosshairColorFromInt( int val, byte *color ) {
color[1] = 255;
color[2] = 255;
} else {
color[0] = (val & 1) ? 255 : 0;
color[0] = (val & 4) ? 255 : 0;
color[1] = (val & 2) ? 255 : 0;
color[2] = (val & 4) ? 255 : 0;
color[2] = (val & 1) ? 255 : 0;
}
color[3] = 255;
}
Expand Down
80 changes: 29 additions & 51 deletions code/cgame/cg_players.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,27 +84,34 @@ sfxHandle_t CG_CustomSound( int clientNum, const char *soundName ) {

/*
====================
CG_ColorFromChar
CG_ColorFromString
====================
*/
static void CG_ColorFromChar( char v, vec3_t color ) {
static void CG_ColorFromString( const char *v, vec3_t color ) {
int val;

val = v - '0';
VectorClear( color );

if ( !v || !v[0] ) {
VectorSet( color, 1, 1, 1 );
return;
}

val = v[0] - '0';

if ( val < 1 || val > 7 ) {
VectorSet( color, 1.0f, 1.0f, 1.0f );
} else {
VectorClear( color );
if ( val & 1 ) {
color[0] = 1.0f;
}
if ( val & 2 ) {
color[1] = 1.0f;
}
if ( val & 4 ) {
color[2] = 1.0f;
}
VectorSet( color, 1, 1, 1 );
return;
}

if ( val & 1 ) {
color[2] = 1.0f;
}
if ( val & 2 ) {
color[1] = 1.0f;
}
if ( val & 4 ) {
color[0] = 1.0f;
}
}

Expand All @@ -122,24 +129,24 @@ static void CG_SetColorInfo( const char *color, clientInfo_t *info )

if ( !color[0] )
return;
CG_ColorFromChar( color[0], info->headColor );
CG_ColorFromString( color, info->headColor );

if ( !color[1] )
return;
CG_ColorFromChar( color[1], info->bodyColor );
CG_ColorFromString( &color[1], info->bodyColor );

if ( !color[2] )
return;
CG_ColorFromChar( color[2], info->legsColor );
CG_ColorFromString( &color[2], info->legsColor );

// override color1/color2 if specified
if ( !color[3] )
return;
CG_ColorFromChar( color[3], info->color1 );
CG_ColorFromString( &color[3], info->color1 );

if ( !color[4] )
return;
CG_ColorFromChar( color[4], info->color2 );
CG_ColorFromString( &color[4], info->color2 );
}


Expand Down Expand Up @@ -1188,35 +1195,6 @@ static void CG_SetSkinAndModel( clientInfo_t *newInfo,
}


/*
====================
CG_ColorFromString
====================
*/
static void CG_ColorFromString( const char *v, vec3_t color ) {
int val;

VectorClear( color );

val = atoi( v );

if ( val < 1 || val > 7 ) {
VectorSet( color, 1, 1, 1 );
return;
}

if ( val & 1 ) {
color[2] = 1.0f;
}
if ( val & 2 ) {
color[1] = 1.0f;
}
if ( val & 4 ) {
color[0] = 1.0f;
}
}


/*
======================
CG_NewClientInfo
Expand Down Expand Up @@ -1352,9 +1330,9 @@ void CG_NewClientInfo( int clientNum ) {
colors = CG_GetTeamColors( cg_teamColors.string, newInfo.team );
len = strlen( colors );
if ( len >= 4 )
CG_ColorFromChar( colors[3], newInfo.color1 );
CG_ColorFromString( &colors[3], newInfo.color1 );
if ( len >= 5 )
CG_ColorFromChar( colors[4], newInfo.color2 );
CG_ColorFromString( &colors[4], newInfo.color2 );
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion code/q3_ui/ui_playersettings.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,10 @@ static void PlayerSettings_DrawEffects( void *self ) {

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

int markerX = item->generic.x + 64 + (item->curvalue * 112 / 6);

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] );
UI_DrawHandlePic( markerX, item->generic.y + PROP_HEIGHT + 6, 16, 12, s_playersettings.fxPic[item->curvalue] );
}


Expand Down
12 changes: 7 additions & 5 deletions code/q3_ui/ui_preferences.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ static const char *s_damageeffect[] =
NULL
};

static int gamecodetoui[] = {0,2,1,4,5,3,6};
static int uitogamecode[] = {1,3,2,6,4,5,7};
static int gamecodetoui[] = {4,2,3,0,5,1,6};
static int uitogamecode[] = {4,6,2,3,1,5,7};

static void Preferences_SetMenuItems( void ) {
int c;
Expand Down Expand Up @@ -348,9 +348,9 @@ static void Crosshair_Draw( void *self ) {
crosshairColor[1] = 1.0f;
crosshairColor[2] = 1.0f;
} else {
crosshairColor[0] = (colorCode & 1) ? 1.0f : 0.0f;
crosshairColor[0] = (colorCode & 4) ? 1.0f : 0.0f;
crosshairColor[1] = (colorCode & 2) ? 1.0f : 0.0f;
crosshairColor[2] = (colorCode & 4) ? 1.0f : 0.0f;
crosshairColor[2] = (colorCode & 1) ? 1.0f : 0.0f;
}
crosshairColor[3] = 1.0f;

Expand Down Expand Up @@ -406,8 +406,10 @@ static void CrosshairColor_Draw( void *self ) {
UI_DrawString( x - SMALLCHAR_WIDTH, y, s->generic.name, style|UI_RIGHT, color );

// Draw color picker
int markerX = x + SMALLCHAR_WIDTH + (s->curvalue * 112 / 6);

UI_DrawHandlePic( x + SMALLCHAR_WIDTH, y + 4, 128, 8, s_preferences.fxBasePic );
UI_DrawHandlePic( x + SMALLCHAR_WIDTH + s->curvalue * 16 + 8, y + 2, 16, 12, s_preferences.fxPic[s->curvalue] );
UI_DrawHandlePic( markerX, y + 2, 16, 12, s_preferences.fxPic[s->curvalue] );
}


Expand Down
31 changes: 15 additions & 16 deletions code/ui/ui_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ static char* netnames[] = {
static char quake3worldMessage[] = "Visit www.quake3world.com - News, Community, Events, Files";
#endif

static int gamecodetoui[] = {0,1,2,3,4,5,6};
static int uitogamecode[] = {1,2,3,4,5,6,7};
static int gamecodetoui[] = {4,2,3,0,5,1,6};
static int uitogamecode[] = {4,6,2,3,1,5,7};


static void UI_StartServerRefresh(qboolean full, qboolean force);
Expand Down Expand Up @@ -1293,12 +1293,10 @@ static void UI_DrawTeamMember(rectDef_t *rect, float scale, vec4_t color, qboole
}

static void UI_DrawEffects(rectDef_t *rect, float scale, vec4_t color) {
static int gamecodetofxpic[] = {0,2,1,4,5,3,6};
int gameColorCode = uitogamecode[uiInfo.effectsColor];
int fxPicIndex = gamecodetofxpic[gameColorCode - 1];
int markerX = rect->x + (uiInfo.effectsColor * 112 / 6);

UI_DrawHandlePic( rect->x, rect->y - 14, 128, 8, uiInfo.uiDC.Assets.fxBasePic );
UI_DrawHandlePic( rect->x + uiInfo.effectsColor * 16 + 8, rect->y - 16, 16, 12, uiInfo.uiDC.Assets.fxPic[fxPicIndex] );
UI_DrawHandlePic( markerX, rect->y - 16, 16, 12, uiInfo.uiDC.Assets.fxPic[uiInfo.effectsColor] );
}

static void UI_DrawMapPreview(rectDef_t *rect, float scale, vec4_t color, qboolean net) {
Expand Down Expand Up @@ -1892,9 +1890,9 @@ static void UI_DrawCrosshair(rectDef_t *rect, float scale, vec4_t color) {
crosshairColor[1] = 1.0f;
crosshairColor[2] = 1.0f;
} else {
crosshairColor[0] = (colorCode & 1) ? 1.0f : 0.0f;
crosshairColor[0] = (colorCode & 4) ? 1.0f : 0.0f;
crosshairColor[1] = (colorCode & 2) ? 1.0f : 0.0f;
crosshairColor[2] = (colorCode & 4) ? 1.0f : 0.0f;
crosshairColor[2] = (colorCode & 1) ? 1.0f : 0.0f;
}
crosshairColor[3] = 1.0f;

Expand All @@ -1904,16 +1902,15 @@ static void UI_DrawCrosshair(rectDef_t *rect, float scale, vec4_t color) {
}

static void UI_DrawCrosshairColor(rectDef_t *rect, float scale, vec4_t color) {
static int gamecodetofxpic[] = {0,2,1,4,5,3,6};
int gameColorCode = (int)trap_Cvar_VariableValue("cg_crosshairColor");
if (gameColorCode < 1 || gameColorCode > 7) {
gameColorCode = 7;
}
int uiColorIndex = gamecodetoui[gameColorCode - 1];
int fxPicIndex = gamecodetofxpic[gameColorCode - 1];
int markerX = rect->x + (uiColorIndex * 112 / 6);

UI_DrawHandlePic( rect->x, rect->y - 10, 128, 8, uiInfo.uiDC.Assets.fxBasePic );
UI_DrawHandlePic( rect->x + uiColorIndex * 16 + 8, rect->y - 12, 16, 12, uiInfo.uiDC.Assets.fxPic[fxPicIndex] );
UI_DrawHandlePic( markerX, rect->y - 12, 16, 12, uiInfo.uiDC.Assets.fxPic[uiColorIndex] );
}

/*
Expand Down Expand Up @@ -2744,13 +2741,15 @@ static qboolean UI_CrosshairColor_HandleKey(int flags, float *special, int key)
int select = UI_SelectForKey(key);
if (select != 0) {
int currentColor = (int)trap_Cvar_VariableValue("cg_crosshairColor");
currentColor += select;
int uiIndex = gamecodetoui[currentColor - 1];
uiIndex += select;

if (currentColor > 7) {
currentColor = 1;
} else if (currentColor < 1) {
currentColor = 7;
if (uiIndex > 6) {
uiIndex = 0;
} else if (uiIndex < 0) {
uiIndex = 6;
}
currentColor = uitogamecode[uiIndex];
trap_Cvar_SetValue("cg_crosshairColor", currentColor);
// Enable health-based coloring for white, disable for custom colors
if (currentColor == 7) {
Expand Down