}
}
+// VIP mod icons
+float redvip_prevframe, bluevip_prevframe, yellowvip_prevframe, pinkvip_prevframe; // status during previous frame
+float redvip_prevstatus, bluevip_prevstatus, yellowvip_prevstatus, pinkvip_prevstatus; // last remembered status
+float redvip_statuschange_time, bluevip_statuschange_time, yellowvip_statuschange_time, pinkvip_statuschange_time; // time when the status changed
+void HUD_Mod_VIP_Reset(void)
+{
+ redvip_prevstatus = bluevip_prevstatus = yellowvip_prevstatus = pinkvip_prevstatus = redvip_prevframe = bluevip_prevframe = yellowvip_prevframe = pinkvip_prevframe = redvip_statuschange_time = bluevip_statuschange_time = yellowvip_statuschange_time = pinkvip_statuschange_time = 0;
+}
+void HUD_Mod_VIP(vector pos, vector mySize)
+{
+ vector redvip_pos, bluevip_pos, yellowvip_pos, pinkvip_pos;
+ vector vip_size;
+ vector e1, e2;
+ float size1, size2;
+ float fs, fs2, fs3;
+ float f; // every function should have that
+
+ float redvip, bluevip, yellowvip, pinkvip, is_vip; // current status
+ float redvip_statuschange_elapsedtime, bluevip_statuschange_elapsedtime, yellowvip_statuschange_elapsedtime, pinkvip_statuschange_elapsedtime; // time since the status changed
+
+ redvip = (getstatf(STAT_VIP_RED) != 0);
+ bluevip = (getstatf(STAT_VIP_BLUE) != 0);
+ yellowvip = (getstatf(STAT_VIP_YELLOW) != 0);
+ pinkvip = (getstatf(STAT_VIP_PINK) != 0);
+ is_vip = (getstati(STAT_VIP) != 0);
+
+ if(redvip || bluevip || yellowvip || pinkvip)
+ mod_active = 1;
+ else
+ mod_active = 0;
+
+ // when status CHANGES, set old status into prevstatus and current status into status
+ if (redvip != redvip_prevframe)
+ {
+ redvip_statuschange_time = time;
+ redvip_prevstatus = redvip_prevframe;
+ redvip_prevframe = redvip;
+ }
+
+ if (bluevip != bluevip_prevframe)
+ {
+ bluevip_statuschange_time = time;
+ bluevip_prevstatus = bluevip_prevframe;
+ bluevip_prevframe = bluevip;
+ }
+
+ if (yellowvip != yellowvip_prevframe)
+ {
+ yellowvip_statuschange_time = time;
+ yellowvip_prevstatus = yellowvip_prevframe;
+ yellowvip_prevframe = yellowvip;
+ }
+
+ if (pinkvip != pinkvip_prevframe)
+ {
+ pinkvip_statuschange_time = time;
+ pinkvip_prevstatus = pinkvip_prevframe;
+ pinkvip_prevframe = pinkvip;
+ }
+
+ redvip_statuschange_elapsedtime = time - redvip_statuschange_time;
+ bluevip_statuschange_elapsedtime = time - bluevip_statuschange_time;
+ yellowvip_statuschange_elapsedtime = time - yellowvip_statuschange_time;
+ pinkvip_statuschange_elapsedtime = time - pinkvip_statuschange_time;
+
+ switch(team_count)
+ {
+ default:
+ case 2: fs = 0.5; fs2 = 0.5; fs3 = 0.5; break;
+ case 3: fs = 1; fs2 = 0.35; fs3 = 0.35; break;
+ case 4: fs = 0.75; fs2 = 0.25; fs3 = 0.5; break;
+ }
+
+ if(mySize_x > mySize_y)
+ {
+ size1 = mySize_x;
+ size2 = mySize_y;
+ e1 = eX;
+ e2 = eY;
+ }
+ else
+ {
+ size1 = mySize_y;
+ size2 = mySize_x;
+ e1 = eY;
+ e2 = eX;
+ }
+
+ switch(myteam)
+ {
+ default:
+ case NUM_TEAM_1:
+ {
+ redvip_pos = pos;
+ bluevip_pos = pos + eX * fs2 * size1;
+ yellowvip_pos = pos - eX * fs2 * size1;
+ pinkvip_pos = pos + eX * fs3 * size1;
+ break;
+ }
+ case NUM_TEAM_2:
+ {
+ redvip_pos = pos + eX * fs2 * size1;
+ bluevip_pos = pos;
+ yellowvip_pos = pos - eX * fs2 * size1;
+ pinkvip_pos = pos + eX * fs3 * size1;
+ break;
+ }
+ case NUM_TEAM_3:
+ {
+ redvip_pos = pos + eX * fs3 * size1;
+ bluevip_pos = pos - eX * fs2 * size1;
+ yellowvip_pos = pos;
+ pinkvip_pos = pos + eX * fs2 * size1;
+ break;
+ }
+ case NUM_TEAM_4:
+ {
+ redvip_pos = pos - eX * fs2 * size1;
+ bluevip_pos = pos + eX * fs3 * size1;
+ yellowvip_pos = pos + eX * fs2 * size1;
+ pinkvip_pos = pos;
+ break;
+ }
+ }
+ vip_size = e1 * fs * size1 + e2 * size2;
+
+ string red_icon = "", red_icon_prevstatus = "";
+ string blue_icon = "", blue_icon_prevstatus = "";
+ string yellow_icon = "", yellow_icon_prevstatus = "";
+ string pink_icon = "", pink_icon_prevstatus = "";
+
+ if(redvip) { red_icon = "player_red"; }
+ if(bluevip) { blue_icon = "player_blue"; }
+ if(yellowvip) { yellow_icon = "player_yellow"; }
+ if(pinkvip) { pink_icon = "player_pink"; }
+
+ if(redvip_prevframe) { red_icon_prevstatus = "player_red"; }
+ if(bluevip_prevframe) { blue_icon_prevstatus = "player_blue"; }
+ if(yellowvip_prevframe) { yellow_icon_prevstatus = "player_yellow"; }
+ if(pinkvip_prevframe) { pink_icon_prevstatus = "player_pink"; }
+
+ if(is_vip)
+ switch(myteam)
+ {
+ case NUM_TEAM_1: red_icon = "notify_balldropped"; break;
+ case NUM_TEAM_2: blue_icon = "notify_balldropped"; break;
+ case NUM_TEAM_3: yellow_icon = "notify_balldropped"; break;
+ case NUM_TEAM_4: pink_icon = "notify_balldropped"; break;
+ }
+
+ f = bound(0, redvip_statuschange_elapsedtime*2, 1);
+ if(red_icon_prevstatus && f < 1)
+ drawpic_aspect_skin_expanding(redvip_pos, red_icon_prevstatus, vip_size, '1 1 1', panel_fg_alpha * 1, DRAWFLAG_NORMAL, f);
+ if(red_icon)
+ drawpic_aspect_skin(redvip_pos, red_icon, vip_size, '1 1 1', panel_fg_alpha * 1 * f, DRAWFLAG_NORMAL);
+
+ f = bound(0, bluevip_statuschange_elapsedtime*2, 1);
+ if(blue_icon_prevstatus && f < 1)
+ drawpic_aspect_skin_expanding(bluevip_pos, blue_icon_prevstatus, vip_size, '1 1 1', panel_fg_alpha * 1, DRAWFLAG_NORMAL, f);
+ if(blue_icon)
+ drawpic_aspect_skin(bluevip_pos, blue_icon, vip_size, '1 1 1', panel_fg_alpha * 1 * f, DRAWFLAG_NORMAL);
+
+ f = bound(0, yellowvip_statuschange_elapsedtime*2, 1);
+ if(yellow_icon_prevstatus && f < 1)
+ drawpic_aspect_skin_expanding(yellowvip_pos, yellow_icon_prevstatus, vip_size, '1 1 1', panel_fg_alpha * 1, DRAWFLAG_NORMAL, f);
+ if(yellow_icon)
+ drawpic_aspect_skin(yellowvip_pos, yellow_icon, vip_size, '1 1 1', panel_fg_alpha * 1 * f, DRAWFLAG_NORMAL);
+
+ f = bound(0, pinkvip_statuschange_elapsedtime*2, 1);
+ if(pink_icon_prevstatus && f < 1)
+ drawpic_aspect_skin_expanding(pinkvip_pos, pink_icon_prevstatus, vip_size, '1 1 1', panel_fg_alpha * 1, DRAWFLAG_NORMAL, f);
+ if(pink_icon)
+ drawpic_aspect_skin(pinkvip_pos, pink_icon, vip_size, '1 1 1', panel_fg_alpha * 1 * f, DRAWFLAG_NORMAL);
+}
+
// CTF HUD modicon section
- float redflag_prevframe, blueflag_prevframe, yellowflag_prevframe, pinkflag_prevframe, neutralflag_prevframe; // status during previous frame
- float redflag_prevstatus, blueflag_prevstatus, yellowflag_prevstatus, pinkflag_prevstatus, neutralflag_prevstatus; // last remembered status
-float redflag_prevframe, blueflag_prevframe; // status during previous frame
-int redflag_prevstatus, blueflag_prevstatus; // last remembered status
-float redflag_statuschange_time, blueflag_statuschange_time; // time when the status changed
++int redflag_prevframe, blueflag_prevframe, yellowflag_prevframe, pinkflag_prevframe, neutralflag_prevframe; // status during previous frame
++int redflag_prevstatus, blueflag_prevstatus, yellowflag_prevstatus, pinkflag_prevstatus, neutralflag_prevstatus; // last remembered status
+float redflag_statuschange_time, blueflag_statuschange_time, yellowflag_statuschange_time, pinkflag_statuschange_time, neutralflag_statuschange_time; // time when the status changed
void HUD_Mod_CTF_Reset(void)
{
vector flag_size;
float f; // every function should have that
- float redflag, blueflag, yellowflag, pinkflag, neutralflag; // current status
- int redflag, blueflag; // current status
- float redflag_statuschange_elapsedtime, blueflag_statuschange_elapsedtime; // time since the status changed
- int stat_items;
-
- stat_items = getstati(STAT_ITEMS, 0, 24);
- redflag = (stat_items/IT_RED_FLAG_TAKEN) & 3;
- blueflag = (stat_items/IT_BLUE_FLAG_TAKEN) & 3;
-
- if(redflag || blueflag)
++ int redflag, blueflag, yellowflag, pinkflag, neutralflag; // current status
+ float redflag_statuschange_elapsedtime, blueflag_statuschange_elapsedtime, yellowflag_statuschange_elapsedtime, pinkflag_statuschange_elapsedtime, neutralflag_statuschange_elapsedtime; // time since the status changed
- float ctf_oneflag; // one-flag CTF mode enabled/disabled
- float stat_items = getstati(STAT_CTF_FLAGSTATUS, 0, 24);
++ bool ctf_oneflag; // one-flag CTF mode enabled/disabled
++ int stat_items = getstati(STAT_CTF_FLAGSTATUS, 0, 24);
+ float fs, fs2, fs3, size1, size2;
+ vector e1, e2;
+
+ redflag = (stat_items/CTF_RED_FLAG_TAKEN) & 3;
+ blueflag = (stat_items/CTF_BLUE_FLAG_TAKEN) & 3;
+ yellowflag = (stat_items/CTF_YELLOW_FLAG_TAKEN) & 3;
+ pinkflag = (stat_items/CTF_PINK_FLAG_TAKEN) & 3;
+ neutralflag = (stat_items/CTF_NEUTRAL_FLAG_TAKEN) & 3;
+
+ ctf_oneflag = (stat_items & CTF_FLAG_NEUTRAL);
+
+ if(redflag || blueflag || yellowflag || pinkflag || neutralflag)
mod_active = 1;
else
mod_active = 0;
void HUD_Mod_KH(vector pos, vector mySize)
{
- mod_active = 1; // keyhunt should never hide the mod icons panel
-
// Read current state
- float state = getstati(STAT_KH_KEYSTATUS);
- float i, key_state;
- float all_keys, team1_keys, team2_keys, team3_keys, team4_keys, dropped_keys, carrying_keys;
- int state = getstati(STAT_KH_KEYS);
++ int state = getstati(STAT_KH_KEYSTATUS);
+ int i, key_state;
+ int all_keys, team1_keys, team2_keys, team3_keys, team4_keys, dropped_keys, carrying_keys;
all_keys = team1_keys = team2_keys = team3_keys = team4_keys = dropped_keys = carrying_keys = 0;
+ if(state)
+ mod_active = 1;
+ else
+ mod_active = 0;
+
for(i = 0; i < 4; ++i)
{
key_state = (bitshift(state, i * -5) & 31) - 1;