seta hud_shownames_height 15 "height of icons"
seta hud_shownames_aspect 8 "aspect ratio of total drawing area per name"
seta hud_shownames_fontsize 8 "font size"
+seta hud_shownames_decolorize 1 "1 = decolorize name in team games, 2 = decolorize always"
seta hud_shownames_alpha 0.7 "alpha"
seta hud_shownames_resize 1 "enable resizing of the names, then the size cvars will correspond to the maximum size"
seta hud_shownames_mindistance 1000 "start fading alpha/size at this distance"
float autocvar_hud_shownames_height;
float autocvar_hud_shownames_aspect;
float autocvar_hud_shownames_fontsize;
+float autocvar_hud_shownames_decolorize;
float autocvar_hud_shownames_alpha;
float autocvar_hud_shownames_resize;
float autocvar_hud_shownames_mindistance;
return s;
}
+string Team_ColorCode(float teamid)
+{
+ if (teamid == COLOR_TEAM1)
+ return "^1";
+ else if (teamid == COLOR_TEAM2)
+ return "^4";
+ else if (teamid == COLOR_TEAM3)
+ return "^3";
+ else if (teamid == COLOR_TEAM4)
+ return "^6";
+ else
+ return "^7";
+}
+
+// decolorizes and team colors the player name when needed
+string playername(string thename, float teamid)
+{
+ string t;
+ if (teamplay)
+ {
+ t = Team_ColorCode(teamid);
+ return strcat(t, strdecolorize(thename));
+ }
+ else
+ return strdecolorize(thename);
+}
+
float cvar_or(string cv, float v)
{
string s;
prandom.qh
bgmscript.qh
noise.qh
+teamplay.qh
main.qh
string s;
s = GetPlayerName(self.the_entnum-1);
+ if((autocvar_hud_shownames_decolorize == 1 && teamplay) || autocvar_hud_shownames_decolorize == 2)
+ s = playername(s, GetPlayerColor(self.the_entnum-1));
+
drawfontscale = '1 1 0' * resize;
s = textShortenToWidth(s, namesize, '1 1 0' * autocvar_hud_shownames_fontsize, stringwidth_colors);
-float teamplay;
-float myteam;
-
float TeamByColor(float color)
{
switch(color)