Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow orange, bright red and black colors #1014

Merged
merged 1 commit into from
Feb 19, 2025
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
72 changes: 72 additions & 0 deletions help_variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,18 @@
{
"description": "Blue",
"name": "13"
},
{
"description": "Orange.",
"name": "14"
},
{
"description": "Bright red.",
"name": "15"
},
{
"description": "Black.",
"name": "16"
}
]
},
Expand Down Expand Up @@ -4124,6 +4136,18 @@
{
"description": "Blue",
"name": "13"
},
{
"description": "Orange.",
"name": "14"
},
{
"description": "Bright red.",
"name": "15"
},
{
"description": "Black.",
"name": "16"
}
]
},
Expand Down Expand Up @@ -4236,6 +4260,18 @@
{
"description": "Blue",
"name": "13"
},
{
"description": "Orange.",
"name": "14"
},
{
"description": "Bright red.",
"name": "15"
},
{
"description": "Black.",
"name": "16"
}
]
},
Expand Down Expand Up @@ -20694,6 +20730,18 @@
{
"description": "Blue",
"name": "13"
},
{
"description": "Orange.",
"name": "14"
},
{
"description": "Bright red.",
"name": "15"
},
{
"description": "Black.",
"name": "16"
}
]
},
Expand Down Expand Up @@ -20847,6 +20895,18 @@
{
"description": "Blue",
"name": "13"
},
{
"description": "Orange.",
"name": "14"
},
{
"description": "Bright red.",
"name": "15"
},
{
"description": "Black.",
"name": "16"
}
]
},
Expand Down Expand Up @@ -20932,6 +20992,18 @@
{
"description": "Blue.",
"name": "13"
},
{
"description": "Orange.",
"name": "14"
},
{
"description": "Bright red.",
"name": "15"
},
{
"description": "Black.",
"name": "16"
}
]
},
Expand Down
11 changes: 3 additions & 8 deletions src/cl_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ void CL_Color_f (void) {
Com_Printf ("\"color\" is \"%s %s\"\n",
Info_ValueForKey (cls.userinfo, "topcolor"),
Info_ValueForKey (cls.userinfo, "bottomcolor") );
Com_Printf ("color <0-13> [0-13]\n");
Com_Printf ("color <0-16> [0-16]\n");
return;
case 2:
top = bottom = Q_atoi(Cmd_Argv(1));
Expand All @@ -756,13 +756,8 @@ void CL_Color_f (void) {
bottom = Q_atoi(Cmd_Argv(2));
}

top &= 15;
top = min(top, 13);
bottom &= 15;
bottom = min(bottom, 13);

Cvar_SetValue (&topcolor, top);
Cvar_SetValue (&bottomcolor, bottom);
Cvar_SetValue (&topcolor, bound(0, top, 16));
Cvar_SetValue (&bottomcolor, bound(0, bottom, 16));
}

//usage: fullinfo \name\unnamed\topcolor\0\bottomcolor\1, etc
Expand Down
4 changes: 1 addition & 3 deletions src/sbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,7 @@ void Sbar_DrawNum (int x, int y, int num, int digits, int color) {

// this used to be static function
int Sbar_ColorForMap (int m) {
m = bound(0, m, 13);

return 16 * m + 8;
return m == 16 ? 0 : 16 * bound(0, m, 15) + 8;
}

// HUD -> hexum
Expand Down
9 changes: 2 additions & 7 deletions src/teamplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1895,13 +1895,8 @@ void TP_ColorForcing (cvar_t *topcolor, cvar_t *bottomcolor)
bottom = atoi(Cmd_Argv(2));
}

top &= 15;
top = min(13, top);
bottom &= 15;
bottom = min(13, bottom);

Cvar_SetValue(topcolor, top);
Cvar_SetValue(bottomcolor, bottom);
Cvar_SetValue(topcolor, bound(0, top, 16));
Cvar_SetValue(bottomcolor, bound(0, bottom, 16));

TP_RefreshSkins();
}
Expand Down
Loading