MUTATOR_CALLHOOK(DrawInfoMessages, pos, mySize);
- if(!warmup_stage && gametype == MAPINFO_TYPE_LMS)
+ if(!warmup_stage && ISGAMETYPE(LMS))
{
entity sk;
sk = playerslots[player_localnum];
mod_active = 1; // required in each mod function that always shows something
int layout;
- if(gametype == MAPINFO_TYPE_CA)
+ if(ISGAMETYPE(CA))
layout = autocvar_hud_panel_modicons_ca_layout;
- else //if(gametype == MAPINFO_TYPE_FREEZETAG)
+ else //if(ISGAMETYPE(FREEZETAG))
layout = autocvar_hud_panel_modicons_freezetag_layout;
int rows, columns;
float aspect_ratio;
// clientside personal record
string rr;
- if(gametype == MAPINFO_TYPE_CTS)
+ if(ISGAMETYPE(CTS))
rr = CTS_RECORD;
else
rr = RACE_RECORD;
{
if(!autocvar_hud_panel_physics) return;
if(spectatee_status == -1 && (autocvar_hud_panel_physics == 1 || autocvar_hud_panel_physics == 3)) return;
- if(autocvar_hud_panel_physics == 3 && !(gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS)) return;
+ if(autocvar_hud_panel_physics == 3 && !(ISGAMETYPE(RACE) || ISGAMETYPE(CTS))) return;
}
HUD_Panel_LoadCvars();
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_racetimer) return;
- if(!(gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS)) return;
+ if(!(ISGAMETYPE(RACE) || ISGAMETYPE(CTS))) return;
if(spectatee_status == -1) return;
}
IL_EACH(g_radaricons, it.teamradar_icon, {
if ( hud_panel_radar_mouse )
if ( GetResourceAmount(it, RESOURCE_HEALTH) >= 0 )
- if ( it.team == myteam + 1 || gametype == MAPINFO_TYPE_RACE || !teamplay )
+ if ( it.team == myteam + 1 || ISGAMETYPE(RACE) || !teamplay )
{
vector coord = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(it.origin));
if(vdist((mousepos - coord), <, 8))
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_score) return;
- if(spectatee_status == -1 && (gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS)) return;
+ if(spectatee_status == -1 && (ISGAMETYPE(RACE) || ISGAMETYPE(CTS))) return;
}
HUD_Panel_LoadCvars();
return true;
else if (intermission == 2)
return false;
- else if (spectatee_status != -1 && STAT(HEALTH) <= 0 && autocvar_cl_deathscoreboard && gametype != MAPINFO_TYPE_CTS && !active_minigame)
+ else if (spectatee_status != -1 && STAT(HEALTH) <= 0 && autocvar_cl_deathscoreboard && !ISGAMETYPE(CTS) && !active_minigame)
return true;
else if (scoreboard_showscores_force)
return true;
vector hl_rgb = rgb + '0.5 0.5 0.5';
pos.y += hud_fontsize.y;
- drawstring(pos + eX * panel_bg_padding, ((gametype == MAPINFO_TYPE_CTF) ? _("Capture time rankings") : _("Rankings")), hud_fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawstring(pos + eX * panel_bg_padding, ((ISGAMETYPE(CTF)) ? _("Capture time rankings") : _("Rankings")), hud_fontsize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
pos.y += 1.25 * hud_fontsize.y;
if(panel.current_panel_bg != "0")
pos.y += panel_bg_border;
bool have_weapon_stats;
bool Scoreboard_AccuracyStats_WouldDraw(float ypos)
{
- if (gametype == MAPINFO_TYPE_CTS || gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_NEXBALL)
+ if (ISGAMETYPE(CTS) || ISGAMETYPE(RACE) || ISGAMETYPE(NEXBALL))
return false;
if (!autocvar_hud_panel_scoreboard_accuracy || warmup_stage || ypos > 0.91 * vid_conheight)
return false;
if (Scoreboard_AccuracyStats_WouldDraw(pos.y))
pos = Scoreboard_AccuracyStats_Draw(pos, panel_bg_color, bg_size);
- if(gametype == MAPINFO_TYPE_CTS || gametype == MAPINFO_TYPE_RACE || (autocvar_hud_panel_scoreboard_ctf_leaderboard && gametype == MAPINFO_TYPE_CTF && STAT(CTF_SHOWLEADERBOARD))) {
+ if(ISGAMETYPE(CTS) || ISGAMETYPE(RACE) || (autocvar_hud_panel_scoreboard_ctf_leaderboard && ISGAMETYPE(CTF) && STAT(CTF_SHOWLEADERBOARD))) {
if(race_speedaward) {
drawcolorcodedstring(pos, sprintf(_("Speed award: %d%s ^7(%s^7)"), race_speedaward, race_speedaward_unit, ColorTranslateRGB(race_speedaward_holder)), hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
pos.y += 1.25 * hud_fontsize.y;
tl = STAT(TIMELIMIT);
fl = STAT(FRAGLIMIT);
ll = STAT(LEADLIMIT);
- if(gametype == MAPINFO_TYPE_LMS)
+ if(ISGAMETYPE(LMS))
{
if(tl > 0)
str = strcat(str, sprintf(_(" for up to ^1%1.0f minutes^7"), tl));
void HUD_Vote()
{
- if(autocvar_cl_allow_uid2name == -1 && (gametype == MAPINFO_TYPE_CTS || gametype == MAPINFO_TYPE_RACE || (serverflags & SERVERFLAG_PLAYERSTATS)))
+ if(autocvar_cl_allow_uid2name == -1 && (ISGAMETYPE(CTS) || ISGAMETYPE(RACE) || (serverflags & SERVERFLAG_PLAYERSTATS)))
{
// this dialog gets overriden by the uid2name menu dialog, if it exists
// TODO remove this client side uid2name dialog in the next release
bool postinit;
entity gametype;
+// temporary hack
+#define ISGAMETYPE(NAME) (gametype == MAPINFO_TYPE_##NAME)
float FONT_USER = 8;
// FIXME: alpha is negative when dead, breaking death fade
if (!this.csqcmodel_isdead) a *= f;
}
- if (a < ALPHA_MIN_VISIBLE && gametype != MAPINFO_TYPE_CTS) return;
+ if (a < ALPHA_MIN_VISIBLE && ISGAMETYPE(CTS)) return;
if (vdist(this.origin - view_origin, >=, max_shot_distance)) return;
float dist = vlen(this.origin - view_origin);
if (autocvar_hud_shownames_maxdistance)
if(autocvar_r_letterbox == 0)
if(autocvar_viewsize < 120)
{
- if(!(gametype == MAPINFO_TYPE_RACE || gametype == MAPINFO_TYPE_CTS))
+ if(!(ISGAMETYPE(RACE) || ISGAMETYPE(CTS)))
Accuracy_LoadLevels();
HUD_Main();
else if(cvar("r_glsl_postprocess") == 2)
cvar_set("r_glsl_postprocess", "0");
- /*if(gametype == MAPINFO_TYPE_CTF)
+ /*if(ISGAMETYPE(CTF))
{
ctf_view();
} else */
MUTATOR_HOOKFUNCTION(cl_nb, WantEventchase)
{
- if(autocvar_cl_eventchase_nexball && gametype == MAPINFO_TYPE_NEXBALL && !(WepSet_GetFromStat() & WEPSET(NEXBALL)))
+ if(autocvar_cl_eventchase_nexball && ISGAMETYPE(NEXBALL) && !(WepSet_GetFromStat() & WEPSET(NEXBALL)))
return true;
return false;
}