Skip to content
Merged
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
39 changes: 25 additions & 14 deletions codemp/cgame/cg_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -3860,7 +3860,11 @@ static void CG_DrawTaystHUD(char* s) {

void CG_DrawTeamHUD(rectDef_t background, float xOffset) {
rectDef_t redBackground, blueBackground;
if(cg_drawScores.integer == 3) {
const qboolean drawScores = cg_drawScores.integer == 3;
const qboolean drawCTF = (cg_drawStatus.integer == 2 || cg_drawStatus.integer == 3) &&
(cgs.gametype == GT_CTF || cgs.gametype == GT_CTY);

if (drawScores) {
char temp[4];
char temp2[4];

Expand Down Expand Up @@ -3894,12 +3898,8 @@ void CG_DrawTeamHUD(rectDef_t background, float xOffset) {
redBackground.x = (SCREEN_WIDTH / 2.0f);
}

blueBackground.y = background.y;
redBackground.y = background.y;

blueBackground.h = background.h;
redBackground.h = background.h;

blueBackground.y = redBackground.y = background.y;
blueBackground.h = redBackground.h = background.h;
overlayXPos = redBackground.x + redBackground.w;

//draw boxes
Expand Down Expand Up @@ -3932,9 +3932,21 @@ void CG_DrawTeamHUD(rectDef_t background, float xOffset) {
ITEM_TEXTSTYLE_SHADOWED,
FONT_LARGE);
trap->R_SetColor(NULL);
} else if (drawCTF) {
if (cg_drawTimer.integer == 7) {
blueBackground.x = background.x;
redBackground.x = background.x + background.w;
overlayXPos = redBackground.x;
} else {
blueBackground.x = SCREEN_WIDTH / 2.0f;
redBackground.x = SCREEN_WIDTH / 2.0f;
overlayXPos = SCREEN_WIDTH / 2.0f;
}
blueBackground.y = redBackground.y = background.y;
blueBackground.h = redBackground.h = background.h;
}

if ((cg_drawStatus.integer == 2) && ((cgs.gametype == GT_CTF) || (cgs.gametype == GT_CTY))) {
if (drawCTF) {
CG_DrawCTFHUD(blueBackground, redBackground, xOffset);
}
}
Expand All @@ -3947,7 +3959,7 @@ void CG_UpdateFlagStatus( ) {
else
{
if (!cgs.redFlagCarrier) {
for (int i = 0; i <= numSortedTeamPlayers; i++) {
for (int i = 0; i < numSortedTeamPlayers; i++) {
if (cgs.clientinfo[i].powerups & (1 << PW_BLUEFLAG)) {
cgs.redFlagCarrier = &cgs.clientinfo[i];
break;
Expand All @@ -3965,7 +3977,7 @@ void CG_UpdateFlagStatus( ) {
{
if (!cgs.blueFlagCarrier)
{
for (int i = 0; i <= numSortedTeamPlayers; i++)
for (int i = 0; i < numSortedTeamPlayers; i++)
{ //find the flag carrier
if (cgs.clientinfo[i].powerups & (1 << PW_REDFLAG))
{
Expand Down Expand Up @@ -6623,7 +6635,7 @@ static void CG_DrawUpperRight( void ) {
y = CG_DrawTimer( y );
}

if(cg_drawScores.integer == 3 && cg_drawTimer.integer != 7){
if((cg_drawScores.integer == 3 || ((cg_drawStatus.integer == 2 || cg_drawStatus.integer == 3) && (cgs.gametype == GT_CTF || cgs.gametype == GT_CTY))) && cg_drawTimer.integer != 7){
CG_DrawTaystHUD("");
}

Expand Down Expand Up @@ -11344,12 +11356,11 @@ static void CG_Draw2D( void ) {
}
}

if (cg_drawStatus.integer)
if (cg_drawStatus.integer == 1 || cg_drawStatus.integer == 3)
{
//Powerups now done with upperright stuff
//CG_DrawPowerupIcons();
if(cg_drawScores.integer != 3)
CG_DrawFlagStatus();
CG_DrawFlagStatus();
}

CG_SaberClashFlare();
Expand Down
7 changes: 7 additions & 0 deletions codemp/ui/ui_xdocs.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,13 @@ XDOCS_CVAR_DEF("cg_drawScores", "Displays the team scores",
SETTING("3", "Large team scores")
)

XDOCS_CVAR_DEF("cg_drawStatus", "Controls whether the main HUD status elements are drawn",
SETTING("0", "HUD disabled; no status elements are drawn") NL
SETTING("1", "Draws the main HUD (health, armor, ammo, force power), the weapon/force/inventory selection panel, and the default CTF flag status indicators") NL
SETTING("2", "Same as 1, but replaces the CTF flag status with a new style") NL
SETTING("3", "Same as 1, but draws both the default and new style CTF flag status indicators")
)

XDOCS_CVAR_DEF("cg_drawTimer", "Draw the match timer",
SETTING("0", "Big text") NL
SETTING("1", "Small text 1") NL
Expand Down