if(autocvar_cl_readpicture_force)
return false;
- file = strcat(name, ".tga");
- f = fopen(file, FILE_READ);
- if(f >= 0)
- {
- fclose(f);
- return true;
- }
- file = strcat(name, ".png");
- f = fopen(file, FILE_READ);
- if(f >= 0)
- {
- fclose(f);
- return true;
- }
- file = strcat(name, ".jpg");
- f = fopen(file, FILE_READ);
- if(f >= 0)
- {
- fclose(f);
- return true;
- }
- file = strcat(name, ".pcx");
- f = fopen(file, FILE_READ);
- if(f >= 0)
- {
- fclose(f);
- return true;
- }
+ if (fexists(strcat(name, ".tga"))) return true;
+ if (fexists(strcat(name, ".png"))) return true;
+ if (fexists(strcat(name, ".jpg"))) return true;
+ if (fexists(strcat(name, ".pcx"))) return true;
+
return false;
}
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;
float sz;
sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
- drawpic_skin(position + expandingbox_resize_centered_box_offset(sz, scale, 1), pic, scale * sz, rgb, alpha * (1 - fadelerp), flag);
+ drawpic_aspect_skin(position + expandingbox_resize_centered_box_offset(sz, scale, 1), pic, scale * sz, rgb, alpha * (1 - fadelerp), flag);
}
void drawpic_aspect_skin_expanding_two(vector position, string pic, vector scale, vector rgb, float alpha, float flag, float fadelerp)