Skip to content

Commit f3096a0

Browse files
authored
Merge pull request #1014 from osm/add-black-and-orange
Allow orange, bright red and black colors
2 parents faf46ab + 639c1c5 commit f3096a0

File tree

4 files changed

+78
-18
lines changed

4 files changed

+78
-18
lines changed

help_variables.json

+72
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,18 @@
651651
{
652652
"description": "Blue",
653653
"name": "13"
654+
},
655+
{
656+
"description": "Orange.",
657+
"name": "14"
658+
},
659+
{
660+
"description": "Bright red.",
661+
"name": "15"
662+
},
663+
{
664+
"description": "Black.",
665+
"name": "16"
654666
}
655667
]
656668
},
@@ -4124,6 +4136,18 @@
41244136
{
41254137
"description": "Blue",
41264138
"name": "13"
4139+
},
4140+
{
4141+
"description": "Orange.",
4142+
"name": "14"
4143+
},
4144+
{
4145+
"description": "Bright red.",
4146+
"name": "15"
4147+
},
4148+
{
4149+
"description": "Black.",
4150+
"name": "16"
41274151
}
41284152
]
41294153
},
@@ -4236,6 +4260,18 @@
42364260
{
42374261
"description": "Blue",
42384262
"name": "13"
4263+
},
4264+
{
4265+
"description": "Orange.",
4266+
"name": "14"
4267+
},
4268+
{
4269+
"description": "Bright red.",
4270+
"name": "15"
4271+
},
4272+
{
4273+
"description": "Black.",
4274+
"name": "16"
42394275
}
42404276
]
42414277
},
@@ -20694,6 +20730,18 @@
2069420730
{
2069520731
"description": "Blue",
2069620732
"name": "13"
20733+
},
20734+
{
20735+
"description": "Orange.",
20736+
"name": "14"
20737+
},
20738+
{
20739+
"description": "Bright red.",
20740+
"name": "15"
20741+
},
20742+
{
20743+
"description": "Black.",
20744+
"name": "16"
2069720745
}
2069820746
]
2069920747
},
@@ -20847,6 +20895,18 @@
2084720895
{
2084820896
"description": "Blue",
2084920897
"name": "13"
20898+
},
20899+
{
20900+
"description": "Orange.",
20901+
"name": "14"
20902+
},
20903+
{
20904+
"description": "Bright red.",
20905+
"name": "15"
20906+
},
20907+
{
20908+
"description": "Black.",
20909+
"name": "16"
2085020910
}
2085120911
]
2085220912
},
@@ -20932,6 +20992,18 @@
2093220992
{
2093320993
"description": "Blue.",
2093420994
"name": "13"
20995+
},
20996+
{
20997+
"description": "Orange.",
20998+
"name": "14"
20999+
},
21000+
{
21001+
"description": "Bright red.",
21002+
"name": "15"
21003+
},
21004+
{
21005+
"description": "Black.",
21006+
"name": "16"
2093521007
}
2093621008
]
2093721009
},

src/cl_cmd.c

+3-8
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ void CL_Color_f (void) {
746746
Com_Printf ("\"color\" is \"%s %s\"\n",
747747
Info_ValueForKey (cls.userinfo, "topcolor"),
748748
Info_ValueForKey (cls.userinfo, "bottomcolor") );
749-
Com_Printf ("color <0-13> [0-13]\n");
749+
Com_Printf ("color <0-16> [0-16]\n");
750750
return;
751751
case 2:
752752
top = bottom = Q_atoi(Cmd_Argv(1));
@@ -756,13 +756,8 @@ void CL_Color_f (void) {
756756
bottom = Q_atoi(Cmd_Argv(2));
757757
}
758758

759-
top &= 15;
760-
top = min(top, 13);
761-
bottom &= 15;
762-
bottom = min(bottom, 13);
763-
764-
Cvar_SetValue (&topcolor, top);
765-
Cvar_SetValue (&bottomcolor, bottom);
759+
Cvar_SetValue (&topcolor, bound(0, top, 16));
760+
Cvar_SetValue (&bottomcolor, bound(0, bottom, 16));
766761
}
767762

768763
//usage: fullinfo \name\unnamed\topcolor\0\bottomcolor\1, etc

src/sbar.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -441,9 +441,7 @@ void Sbar_DrawNum (int x, int y, int num, int digits, int color) {
441441

442442
// this used to be static function
443443
int Sbar_ColorForMap (int m) {
444-
m = bound(0, m, 13);
445-
446-
return 16 * m + 8;
444+
return m == 16 ? 0 : 16 * bound(0, m, 15) + 8;
447445
}
448446

449447
// HUD -> hexum

src/teamplay.c

+2-7
Original file line numberDiff line numberDiff line change
@@ -1895,13 +1895,8 @@ void TP_ColorForcing (cvar_t *topcolor, cvar_t *bottomcolor)
18951895
bottom = atoi(Cmd_Argv(2));
18961896
}
18971897

1898-
top &= 15;
1899-
top = min(13, top);
1900-
bottom &= 15;
1901-
bottom = min(13, bottom);
1902-
1903-
Cvar_SetValue(topcolor, top);
1904-
Cvar_SetValue(bottomcolor, bottom);
1898+
Cvar_SetValue(topcolor, bound(0, top, 16));
1899+
Cvar_SetValue(bottomcolor, bound(0, bottom, 16));
19051900

19061901
TP_RefreshSkins();
19071902
}

0 commit comments

Comments
 (0)