X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud.qc;h=d22459af7677df2327d8266a05b5c8f51f7aed57;hb=530e06120a7b41f6175b1144fedf6903da8c13b0;hp=e97c89e097c75ce3115e5a98ffb5f228ee0cc614;hpb=d3a7bb2616410f0252504af2a84e11fb4dac21a3;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index e97c89e09..d22459af7 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -5,6 +5,7 @@ #include "../common/mapinfo.qh" #include "../common/nades.qh" #include "../server/t_items.qh" +#include "../server/mutators/gamemode_ctf.qh" /* ================== @@ -27,7 +28,7 @@ void draw_BorderPicture(vector theOrigin, string pic, vector theSize, vector the drawpic(theOrigin, pic, theSize, theColor, theAlpha, 0); return; } - if (theBorderSize_x == 0 && theBorderSize_y == 0) // no border + if (theBorderSize.x == 0 && theBorderSize.y == 0) // no border { // draw only the central part drawsubpic(theOrigin, theSize, pic, '0.25 0.25 0', '0.5 0.5 0', theColor, theAlpha, 0); @@ -100,42 +101,42 @@ vector HUD_Get_Num_Color (float x, float maxvalue) float blinkingamt; vector color; if(x >= maxvalue) { - color_x = sin(2*M_PI*time); - color_y = 1; - color_z = sin(2*M_PI*time); + color.x = sin(2*M_PI*time); + color.y = 1; + color.z = sin(2*M_PI*time); } else if(x > maxvalue * 0.75) { - color_x = 0.4 - (x-150)*0.02 * 0.4; //red value between 0.4 -> 0 - color_y = 0.9 + (x-150)*0.02 * 0.1; // green value between 0.9 -> 1 - color_z = 0; + color.x = 0.4 - (x-150)*0.02 * 0.4; //red value between 0.4 -> 0 + color.y = 0.9 + (x-150)*0.02 * 0.1; // green value between 0.9 -> 1 + color.z = 0; } else if(x > maxvalue * 0.5) { - color_x = 1 - (x-100)*0.02 * 0.6; //red value between 1 -> 0.4 - color_y = 1 - (x-100)*0.02 * 0.1; // green value between 1 -> 0.9 - color_z = 1 - (x-100)*0.02; // blue value between 1 -> 0 + color.x = 1 - (x-100)*0.02 * 0.6; //red value between 1 -> 0.4 + color.y = 1 - (x-100)*0.02 * 0.1; // green value between 1 -> 0.9 + color.z = 1 - (x-100)*0.02; // blue value between 1 -> 0 } else if(x > maxvalue * 0.25) { - color_x = 1; - color_y = 1; - color_z = 0.2 + (x-50)*0.02 * 0.8; // blue value between 0.2 -> 1 + color.x = 1; + color.y = 1; + color.z = 0.2 + (x-50)*0.02 * 0.8; // blue value between 0.2 -> 1 } else if(x > maxvalue * 0.1) { - color_x = 1; - color_y = (x-20)*90/27/100; // green value between 0 -> 1 - color_z = (x-20)*90/27/100 * 0.2; // blue value between 0 -> 0.2 + color.x = 1; + color.y = (x-20)*90/27/100; // green value between 0 -> 1 + color.z = (x-20)*90/27/100 * 0.2; // blue value between 0 -> 0.2 } else { - color_x = 1; - color_y = 0; - color_z = 0; + color.x = 1; + color.y = 0; + color.z = 0; } blinkingamt = (1 - x/maxvalue/0.25); if(blinkingamt > 0) { - color_x = color.x - color.x * blinkingamt * sin(2*M_PI*time); - color_y = color.y - color.y * blinkingamt * sin(2*M_PI*time); - color_z = color.z - color.z * blinkingamt * sin(2*M_PI*time); + color.x = color.x - color.x * blinkingamt * sin(2*M_PI*time); + color.y = color.y - color.y * blinkingamt * sin(2*M_PI*time); + color.z = color.z - color.z * blinkingamt * sin(2*M_PI*time); } return color; } @@ -158,7 +159,7 @@ void drawstringright(vector position, string text, vector theScale, vector rgb, void drawstringcenter(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag) { - position_x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * theScale.x); + position.x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * theScale.x); drawstring(position, text, theScale, rgb, theAlpha, flag); } @@ -240,7 +241,7 @@ float race_CheckName(string net_name) { return 0; } -float GetPlayerColorForce(float i) +float GetPlayerColorForce(int i) { if(!teamplay) return 0; @@ -248,7 +249,7 @@ float GetPlayerColorForce(float i) return stof(getplayerkeyvalue(i, "colors")) & 15; } -float GetPlayerColor(float i) +float GetPlayerColor(int i) { if(!playerslots[i].gotscores) // unconnected return NUM_SPECTATOR; @@ -258,7 +259,7 @@ float GetPlayerColor(float i) return GetPlayerColorForce(i); } -string GetPlayerName(float i) +string GetPlayerName(int i) { return ColorTranslateRGB(getplayerkeyvalue(i, "name")); } @@ -400,10 +401,9 @@ void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theA // Weapon icons (#0) // entity weaponorder[WEP_MAXCOUNT]; -void weaponorder_swap(float i, float j, entity pass) +void weaponorder_swap(int i, int j, entity pass) { - entity h; - h = weaponorder[i]; + entity h = weaponorder[i]; weaponorder[i] = weaponorder[j]; weaponorder[j] = h; } @@ -468,7 +468,7 @@ void HUD_Weapons(void) // figure out weapon order (how the weapons are sorted) // TODO make this configurable if(weaponorder_bypriority != autocvar_cl_weaponpriority || !weaponorder[0]) { - float weapon_cnt; + int weapon_cnt; if(weaponorder_bypriority) strunzone(weaponorder_bypriority); if(weaponorder_byimpulse) @@ -539,8 +539,8 @@ void HUD_Weapons(void) columns = ceil(max_panel_size.x / (max_panel_size.y / rows * aspect)); } - weapon_size_x = max_panel_size.x / columns; - weapon_size_y = max_panel_size.y / rows; + weapon_size.x = max_panel_size.x / columns; + weapon_size.y = max_panel_size.y / rows; columns = ceil(weapon_count / rows); } else @@ -551,14 +551,14 @@ void HUD_Weapons(void) rows = ceil(max_panel_size.y / (max_panel_size.x / columns / aspect)); } - weapon_size_x = max_panel_size.x / columns; - weapon_size_y = max_panel_size.y / rows; + weapon_size.x = max_panel_size.x / columns; + weapon_size.y = max_panel_size.y / rows; rows = ceil(weapon_count / columns); } // reduce size of the panel - panel_size_x = columns * weapon_size.x; - panel_size_y = rows * weapon_size.y; + panel_size.x = columns * weapon_size.x; + panel_size.y = rows * weapon_size.y; panel_pos.x += (max_panel_size.x - panel_size.x) / 2; panel_pos.y += (max_panel_size.y - panel_size.y) / 2; @@ -590,8 +590,8 @@ void HUD_Weapons(void) if (autocvar_hud_panel_weapons_timeout_effect == 2 || autocvar_hud_panel_weapons_timeout_effect == 3) { f *= f; // for a cooler movement - center_x = panel_pos.x + panel_size.x/2; - center_y = panel_pos.y + panel_size.y/2; + center.x = panel_pos.x + panel_size.x/2; + center.y = panel_pos.y + panel_size.y/2; screen_ar = vid_conwidth/vid_conheight; if (center.x/center.y < screen_ar) //bottom left { @@ -608,7 +608,7 @@ void HUD_Weapons(void) panel_pos.y -= f * (panel_pos.y + panel_size.y); } if(f == 1) - center_x = -1; // mark the panel as off screen + center.x = -1; // mark the panel as off screen } weaponprevtime = time - (1 - f) * timein_effect_length; } @@ -633,8 +633,8 @@ void HUD_Weapons(void) { f *= f; // for a cooler movement f = 1 - f; - center_x = panel_pos.x + panel_size.x/2; - center_y = panel_pos.y + panel_size.y/2; + center.x = panel_pos.x + panel_size.x/2; + center.y = panel_pos.y + panel_size.y/2; screen_ar = vid_conwidth/vid_conheight; if (center.x/center.y < screen_ar) //bottom left { @@ -657,7 +657,7 @@ void HUD_Weapons(void) // draw the background, then change the virtual size of it to better fit other items inside HUD_Panel_DrawBg(1); - if(center_x == -1) + if(center.x == -1) { draw_endBoldFont(); return; @@ -687,15 +687,15 @@ void HUD_Weapons(void) if(weapon_size.x/weapon_size.y > aspect) { - barsize_x = aspect * weapon_size.y; - barsize_y = weapon_size.y; - baroffset_x = (weapon_size.x - barsize.x) / 2; + barsize.x = aspect * weapon_size.y; + barsize.y = weapon_size.y; + baroffset.x = (weapon_size.x - barsize.x) / 2; } else { - barsize_y = 1/aspect * weapon_size.x; - barsize_x = weapon_size.x; - baroffset_y = (weapon_size.y - barsize.y) / 2; + barsize.y = 1/aspect * weapon_size.x; + barsize.x = weapon_size.x; + baroffset.y = (weapon_size.y - barsize.y) / 2; } } if(autocvar_hud_panel_weapons_accuracy) @@ -847,12 +847,12 @@ void HUD_Weapons(void) // Ammo (#1) void DrawNadeScoreBar(vector myPos, vector mySize, vector color) { - + HUD_Panel_DrawProgressBar( myPos + eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize.x, mySize - eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize.x, - autocvar_hud_panel_ammo_progressbar_name, - getstatf(STAT_NADE_BONUS_SCORE), 0, 0, color, + autocvar_hud_panel_ammo_progressbar_name, + getstatf(STAT_NADE_BONUS_SCORE), 0, 0, color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); } @@ -861,12 +861,12 @@ void DrawAmmoNades(vector myPos, vector mySize, float draw_expanding, float expa { float theAlpha = 1, a, b; vector nade_color, picpos, numpos; - + nade_color = Nade_Color(getstati(STAT_NADE_BONUS_TYPE)); - + a = getstatf(STAT_NADE_BONUS); b = getstatf(STAT_NADE_BONUS_SCORE); - + if(autocvar_hud_panel_ammo_iconalign) { numpos = myPos; @@ -884,10 +884,10 @@ void DrawAmmoNades(vector myPos, vector mySize, float draw_expanding, float expa { if(autocvar_hud_panel_ammo_text) drawstring_aspect(numpos, ftos(a), eX * (2/3) * mySize.x + eY * mySize.y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL); - + if(draw_expanding) drawpic_aspect_skin_expanding(picpos, "nade_nbg", '1 1 0' * mySize.y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL, expand_time); - + drawpic_aspect_skin(picpos, "nade_bg" , '1 1 0' * mySize.y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL); drawpic_aspect_skin(picpos, "nade_nbg" , '1 1 0' * mySize.y, nade_color, panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL); } @@ -1023,23 +1023,23 @@ void HUD_Ammo(void) columns = ceil((total_ammo_count)/rows); ammo_size = eX * mySize.x*(1/columns) + eY * mySize.y*(1/rows); - + vector offset = '0 0 0'; // fteqcc sucks float newSize; if(ammo_size.x/ammo_size.y > 3) { newSize = 3 * ammo_size.y; - offset_x = ammo_size.x - newSize; + offset.x = ammo_size.x - newSize; pos.x += offset.x/2; - ammo_size_x = newSize; + ammo_size.x = newSize; } else { newSize = 1/3 * ammo_size.x; - offset_y = ammo_size.y - newSize; + offset.y = ammo_size.y - newSize; pos.y += offset.y/2; - ammo_size_y = newSize; + ammo_size.y = newSize; } float i; @@ -1114,19 +1114,19 @@ void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, fl { if(mySize.y/mySize.x > 2) { - newSize_y = 2 * mySize.x; - newSize_x = mySize.x; + newSize.y = 2 * mySize.x; + newSize.x = mySize.x; - newPos_y = myPos.y + (mySize.y - newSize.y) / 2; - newPos_x = myPos.x; + newPos.y = myPos.y + (mySize.y - newSize.y) / 2; + newPos.x = myPos.x; } else { - newSize_x = 1/2 * mySize.y; - newSize_y = mySize.y; + newSize.x = 1/2 * mySize.y; + newSize.y = mySize.y; - newPos_x = myPos.x + (mySize.x - newSize.x) / 2; - newPos_y = myPos.y; + newPos.x = myPos.x + (mySize.x - newSize.x) / 2; + newPos.y = myPos.y; } if(icon_right_align) @@ -1152,19 +1152,19 @@ void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, fl if(mySize.x/mySize.y > 3) { - newSize_x = 3 * mySize.y; - newSize_y = mySize.y; + newSize.x = 3 * mySize.y; + newSize.y = mySize.y; - newPos_x = myPos.x + (mySize.x - newSize.x) / 2; - newPos_y = myPos.y; + newPos.x = myPos.x + (mySize.x - newSize.x) / 2; + newPos.y = myPos.y; } else { - newSize_y = 1/3 * mySize.x; - newSize_x = mySize.x; + newSize.y = 1/3 * mySize.x; + newSize.x = mySize.x; - newPos_y = myPos.y + (mySize.y - newSize.y) / 2; - newPos_x = myPos.x; + newPos.y = myPos.y + (mySize.y - newSize.y) / 2; + newPos.x = myPos.x; } if(icon_right_align) // right align @@ -1264,20 +1264,20 @@ void HUD_Powerups(void) if (panel_ar >= 4 || (panel_ar >= 1/4 && panel_ar < 1)) { mySize.x *= (1.0 / 3.0); - superweapons_offset_x = mySize.x; + superweapons_offset.x = mySize.x; if (autocvar_hud_panel_powerups_flip) - shield_offset_x = 2*mySize.x; + shield_offset.x = 2*mySize.x; else - strength_offset_x = 2*mySize.x; + strength_offset.x = 2*mySize.x; } else { mySize.y *= (1.0 / 3.0); - superweapons_offset_y = mySize.y; + superweapons_offset.y = mySize.y; if (autocvar_hud_panel_powerups_flip) - shield_offset_y = 2*mySize.y; + shield_offset.y = 2*mySize.y; else - strength_offset_y = 2*mySize.y; + strength_offset.y = 2*mySize.y; } } else @@ -1286,17 +1286,17 @@ void HUD_Powerups(void) { mySize.x *= 0.5; if (autocvar_hud_panel_powerups_flip) - shield_offset_x = mySize.x; + shield_offset.x = mySize.x; else - strength_offset_x = mySize.x; + strength_offset.x = mySize.x; } else { mySize.y *= 0.5; if (autocvar_hud_panel_powerups_flip) - shield_offset_y = mySize.y; + shield_offset.y = mySize.y; else - strength_offset_y = mySize.y; + strength_offset.y = mySize.y; } } @@ -1510,17 +1510,17 @@ void HUD_HealthArmor(void) { mySize.x *= 0.5; if (autocvar_hud_panel_healtharmor_flip) - health_offset_x = mySize.x; + health_offset.x = mySize.x; else - armor_offset_x = mySize.x; + armor_offset.x = mySize.x; } else { mySize.y *= 0.5; if (autocvar_hud_panel_healtharmor_flip) - health_offset_y = mySize.y; + health_offset.y = mySize.y; else - armor_offset_y = mySize.y; + armor_offset.y = mySize.y; } float health_baralign, armor_baralign, fuel_baralign; @@ -1911,10 +1911,10 @@ void HUD_Radar(void) if (hud_panel_radar_maximized && !autocvar__hud_configure) { panel_size = autocvar_hud_panel_radar_maximized_size; - panel_size_x = bound(0.2, panel_size.x, 1) * vid_conwidth; - panel_size_y = bound(0.2, panel_size.y, 1) * vid_conheight; - panel_pos_x = (vid_conwidth - panel_size.x) / 2; - panel_pos_y = (vid_conheight - panel_size.y) / 2; + panel_size.x = bound(0.2, panel_size.x, 1) * vid_conwidth; + panel_size.y = bound(0.2, panel_size.y, 1) * vid_conheight; + panel_pos.x = (vid_conwidth - panel_size.x) / 2; + panel_pos.y = (vid_conheight - panel_size.y) / 2; string panel_bg; panel_bg = strcat(hud_skin_path, "/border_default"); // always use the default border when maximized @@ -2025,8 +2025,8 @@ void HUD_Radar(void) c2 = rotate('1 0 0' * mi_min.x + '0 1 0' * mi_max.y, teamradar_angle * DEG2RAD); c3 = rotate('1 0 0' * mi_max.x + '0 1 0' * mi_min.y, teamradar_angle * DEG2RAD); span = '0 0 0'; - span_x = max(c0_x, c1_x, c2_x, c3_x) - min(c0_x, c1_x, c2_x, c3_x); - span_y = max(c0_y, c1_y, c2_y, c3_y) - min(c0_y, c1_y, c2_y, c3_y); + span.x = max(c0_x, c1_x, c2_x, c3_x) - min(c0_x, c1_x, c2_x, c3_x); + span.y = max(c0_y, c1_y, c2_y, c3_y) - min(c0_y, c1_y, c2_y, c3_y); // max-min distance must fit the radar in x=x, y=y bigsize = min( @@ -2322,16 +2322,16 @@ void HUD_Score(void) if(score_size.x/score_size.y > 3) { newSize = 3 * score_size.y; - offset_x = score_size.x - newSize; + offset.x = score_size.x - newSize; pos.x += offset.x/2; - score_size_x = newSize; + score_size.x = newSize; } else { newSize = 1/3 * score_size.x; - offset_y = score_size.y - newSize; + offset.y = score_size.y - newSize; pos.y += offset.y/2; - score_size_y = newSize; + score_size.y = newSize; } } else @@ -2409,17 +2409,17 @@ void HUD_RaceTimer (void) vector newSize = '0 0 0'; if(mySize.x/mySize.y > 4) { - newSize_x = 4 * mySize.y; - newSize_y = mySize.y; + newSize.x = 4 * mySize.y; + newSize.y = mySize.y; - pos_x = pos.x + (mySize.x - newSize.x) / 2; + pos.x = pos.x + (mySize.x - newSize.x) / 2; } else { - newSize_y = 1/4 * mySize.x; - newSize_x = mySize.x; + newSize.y = 1/4 * mySize.x; + newSize.x = mySize.x; - pos_y = pos.y + (mySize.y - newSize.y) / 2; + pos.y = pos.y + (mySize.y - newSize.y) / 2; } mySize = newSize; @@ -2617,17 +2617,17 @@ void HUD_Vote(void) vector newSize = '0 0 0'; if(mySize.x/mySize.y > 3) { - newSize_x = 3 * mySize.y; - newSize_y = mySize.y; + newSize.x = 3 * mySize.y; + newSize.y = mySize.y; - pos_x = pos.x + (mySize.x - newSize.x) / 2; + pos.x = pos.x + (mySize.x - newSize.x) / 2; } else { - newSize_y = 1/3 * mySize.x; - newSize_x = mySize.x; + newSize.y = 1/3 * mySize.x; + newSize.x = mySize.x; - pos_y = pos.y + (mySize.y - newSize.y) / 2; + pos.y = pos.y + (mySize.y - newSize.y) / 2; } mySize = newSize; @@ -2713,14 +2713,14 @@ void DrawCAItem(vector myPos, vector mySize, float aspect_ratio, int layout, flo if(mySize.x/mySize.y > aspect_ratio) { i = aspect_ratio * mySize.y; - myPos_x = myPos.x + (mySize.x - i) / 2; - mySize_x = i; + myPos.x = myPos.x + (mySize.x - i) / 2; + mySize.x = i; } else { i = 1/aspect_ratio * mySize.x; - myPos_y = myPos.y + (mySize.y - i) / 2; - mySize_y = i; + myPos.y = myPos.y + (mySize.y - i) / 2; + mySize.y = i; } if(layout) @@ -2768,30 +2768,39 @@ void HUD_Mod_CA(vector myPos, vector mySize) } // CTF HUD modicon section -float redflag_prevframe, blueflag_prevframe; // status during previous frame -float 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 +int 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) { - redflag_prevstatus = blueflag_prevstatus = redflag_prevframe = blueflag_prevframe = redflag_statuschange_time = blueflag_statuschange_time = 0; + redflag_prevstatus = blueflag_prevstatus = yellowflag_prevstatus = pinkflag_prevstatus = neutralflag_prevstatus = 0; + redflag_prevframe = blueflag_prevframe = yellowflag_prevframe = pinkflag_prevframe = neutralflag_prevframe = 0; + redflag_statuschange_time = blueflag_statuschange_time = yellowflag_statuschange_time = pinkflag_statuschange_time = neutralflag_statuschange_time = 0; } void HUD_Mod_CTF(vector pos, vector mySize) { - vector redflag_pos, blueflag_pos; + vector redflag_pos, blueflag_pos, yellowflag_pos, pinkflag_pos, neutralflag_pos; vector flag_size; float f; // every function should have that - float redflag, blueflag; // current status - float redflag_statuschange_elapsedtime, blueflag_statuschange_elapsedtime; // time since the status changed - float 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; + 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 + 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) + if(redflag || blueflag || yellowflag || pinkflag || neutralflag) mod_active = 1; else mod_active = 0; @@ -2800,6 +2809,11 @@ void HUD_Mod_CTF(vector pos, vector mySize) { redflag = 1; blueflag = 2; + if(team_count >= 3) + yellowflag = 2; + if(team_count >= 4) + pinkflag = 3; + ctf_oneflag = neutralflag = 0; // disable neutral flag in hud editor? } // when status CHANGES, set old status into prevstatus and current status into status @@ -2817,40 +2831,66 @@ void HUD_Mod_CTF(vector pos, vector mySize) blueflag_prevframe = blueflag; } + if (yellowflag != yellowflag_prevframe) + { + yellowflag_statuschange_time = time; + yellowflag_prevstatus = yellowflag_prevframe; + yellowflag_prevframe = yellowflag; + } + + if (pinkflag != pinkflag_prevframe) + { + pinkflag_statuschange_time = time; + pinkflag_prevstatus = pinkflag_prevframe; + pinkflag_prevframe = pinkflag; + } + + if (neutralflag != neutralflag_prevframe) + { + neutralflag_statuschange_time = time; + neutralflag_prevstatus = neutralflag_prevframe; + neutralflag_prevframe = neutralflag; + } + redflag_statuschange_elapsedtime = time - redflag_statuschange_time; blueflag_statuschange_elapsedtime = time - blueflag_statuschange_time; + yellowflag_statuschange_elapsedtime = time - yellowflag_statuschange_time; + pinkflag_statuschange_elapsedtime = time - pinkflag_statuschange_time; + neutralflag_statuschange_elapsedtime = time - neutralflag_statuschange_time; - float BLINK_FACTOR = 0.15; - float BLINK_BASE = 0.85; + const float BLINK_FACTOR = 0.15; + const float BLINK_BASE = 0.85; // note: // RMS = sqrt(BLINK_BASE^2 + 0.5 * BLINK_FACTOR^2) // thus // BLINK_BASE = sqrt(RMS^2 - 0.5 * BLINK_FACTOR^2) // ensure RMS == 1 - float BLINK_FREQ = 5; // circle frequency, = 2*pi*frequency in hertz + const float BLINK_FREQ = 5; // circle frequency, = 2*pi*frequency in hertz string red_icon, red_icon_prevstatus; - float red_alpha, red_alpha_prevstatus; + int red_alpha, red_alpha_prevstatus; red_alpha = red_alpha_prevstatus = 1; - switch(redflag) { + switch(redflag) + { case 1: red_icon = "flag_red_taken"; break; case 2: red_icon = "flag_red_lost"; break; case 3: red_icon = "flag_red_carrying"; red_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break; default: - if((stat_items & IT_CTF_SHIELDED) && (myteam == NUM_TEAM_2)) + if((stat_items & CTF_SHIELDED) && (myteam != NUM_TEAM_1)) red_icon = "flag_red_shielded"; else red_icon = string_null; break; } - switch(redflag_prevstatus) { + switch(redflag_prevstatus) + { case 1: red_icon_prevstatus = "flag_red_taken"; break; case 2: red_icon_prevstatus = "flag_red_lost"; break; case 3: red_icon_prevstatus = "flag_red_carrying"; red_alpha_prevstatus = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break; default: if(redflag == 3) red_icon_prevstatus = "flag_red_carrying"; // make it more visible - else if((stat_items & IT_CTF_SHIELDED) && (myteam == NUM_TEAM_2)) + else if((stat_items & CTF_SHIELDED) && (myteam != NUM_TEAM_1)) red_icon_prevstatus = "flag_red_shielded"; else red_icon_prevstatus = string_null; @@ -2858,52 +2898,192 @@ void HUD_Mod_CTF(vector pos, vector mySize) } string blue_icon, blue_icon_prevstatus; - float blue_alpha, blue_alpha_prevstatus; + int blue_alpha, blue_alpha_prevstatus; blue_alpha = blue_alpha_prevstatus = 1; - switch(blueflag) { + switch(blueflag) + { case 1: blue_icon = "flag_blue_taken"; break; case 2: blue_icon = "flag_blue_lost"; break; case 3: blue_icon = "flag_blue_carrying"; blue_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break; default: - if((stat_items & IT_CTF_SHIELDED) && (myteam == NUM_TEAM_1)) + if((stat_items & CTF_SHIELDED) && (myteam != NUM_TEAM_2)) blue_icon = "flag_blue_shielded"; else blue_icon = string_null; break; } - switch(blueflag_prevstatus) { + switch(blueflag_prevstatus) + { case 1: blue_icon_prevstatus = "flag_blue_taken"; break; case 2: blue_icon_prevstatus = "flag_blue_lost"; break; case 3: blue_icon_prevstatus = "flag_blue_carrying"; blue_alpha_prevstatus = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break; default: if(blueflag == 3) blue_icon_prevstatus = "flag_blue_carrying"; // make it more visible - else if((stat_items & IT_CTF_SHIELDED) && (myteam == NUM_TEAM_1)) + else if((stat_items & CTF_SHIELDED) && (myteam != NUM_TEAM_2)) blue_icon_prevstatus = "flag_blue_shielded"; else blue_icon_prevstatus = string_null; break; } - if(mySize.x > mySize.y) { - if (myteam == NUM_TEAM_1) { // always draw own flag on left + string yellow_icon, yellow_icon_prevstatus; + int yellow_alpha, yellow_alpha_prevstatus; + yellow_alpha = yellow_alpha_prevstatus = 1; + switch(yellowflag) + { + case 1: yellow_icon = "flag_yellow_taken"; break; + case 2: yellow_icon = "flag_yellow_lost"; break; + case 3: yellow_icon = "flag_yellow_carrying"; yellow_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break; + default: + if((stat_items & CTF_SHIELDED) && (myteam != NUM_TEAM_3)) + yellow_icon = "flag_yellow_shielded"; + else + yellow_icon = string_null; + break; + } + switch(yellowflag_prevstatus) + { + case 1: yellow_icon_prevstatus = "flag_yellow_taken"; break; + case 2: yellow_icon_prevstatus = "flag_yellow_lost"; break; + case 3: yellow_icon_prevstatus = "flag_yellow_carrying"; yellow_alpha_prevstatus = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break; + default: + if(yellowflag == 3) + yellow_icon_prevstatus = "flag_yellow_carrying"; // make it more visible + else if((stat_items & CTF_SHIELDED) && (myteam != NUM_TEAM_3)) + yellow_icon_prevstatus = "flag_yellow_shielded"; + else + yellow_icon_prevstatus = string_null; + break; + } + + string pink_icon, pink_icon_prevstatus; + int pink_alpha, pink_alpha_prevstatus; + pink_alpha = pink_alpha_prevstatus = 1; + switch(pinkflag) + { + case 1: pink_icon = "flag_pink_taken"; break; + case 2: pink_icon = "flag_pink_lost"; break; + case 3: pink_icon = "flag_pink_carrying"; pink_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break; + default: + if((stat_items & CTF_SHIELDED) && (myteam != NUM_TEAM_4)) + pink_icon = "flag_pink_shielded"; + else + pink_icon = string_null; + break; + } + switch(pinkflag_prevstatus) + { + case 1: pink_icon_prevstatus = "flag_pink_taken"; break; + case 2: pink_icon_prevstatus = "flag_pink_lost"; break; + case 3: pink_icon_prevstatus = "flag_pink_carrying"; pink_alpha_prevstatus = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break; + default: + if(pinkflag == 3) + pink_icon_prevstatus = "flag_pink_carrying"; // make it more visible + else if((stat_items & CTF_SHIELDED) && (myteam != NUM_TEAM_4)) + pink_icon_prevstatus = "flag_pink_shielded"; + else + pink_icon_prevstatus = string_null; + break; + } + + string neutral_icon, neutral_icon_prevstatus; + int neutral_alpha, neutral_alpha_prevstatus; + neutral_alpha = neutral_alpha_prevstatus = 1; + switch(neutralflag) + { + case 1: neutral_icon = "flag_neutral_taken"; break; + case 2: neutral_icon = "flag_neutral_lost"; break; + case 3: neutral_icon = "flag_neutral_carrying"; neutral_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break; + default: + if((stat_items & CTF_SHIELDED)) + neutral_icon = "flag_neutral_shielded"; + else + neutral_icon = string_null; + break; + } + switch(neutralflag_prevstatus) + { + case 1: neutral_icon_prevstatus = "flag_neutral_taken"; break; + case 2: neutral_icon_prevstatus = "flag_neutral_lost"; break; + case 3: neutral_icon_prevstatus = "flag_neutral_carrying"; neutral_alpha_prevstatus = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ); break; + default: + if(neutralflag == 3) + neutral_icon_prevstatus = "flag_neutral_carrying"; // make it more visible + else if((stat_items & CTF_SHIELDED)) + neutral_icon_prevstatus = "flag_neutral_shielded"; + else + neutral_icon_prevstatus = string_null; + break; + } + + if(ctf_oneflag) + { + // hacky, but these aren't needed + red_icon = red_icon_prevstatus = blue_icon = blue_icon_prevstatus = yellow_icon = yellow_icon_prevstatus = pink_icon = pink_icon_prevstatus = string_null; + fs = fs2 = fs3 = 1; + } + else 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: + { redflag_pos = pos; - blueflag_pos = pos + eX * 0.5 * mySize.x; - } else { - blueflag_pos = pos; - redflag_pos = pos + eX * 0.5 * mySize.x; + blueflag_pos = pos + eX * fs2 * size1; + yellowflag_pos = pos - eX * fs2 * size1; + pinkflag_pos = pos + eX * fs3 * size1; + break; } - flag_size = eX * 0.5 * mySize.x + eY * mySize.y; - } else { - if (myteam == NUM_TEAM_1) { // always draw own flag on left - redflag_pos = pos; - blueflag_pos = pos + eY * 0.5 * mySize.y; - } else { + case NUM_TEAM_2: + { + redflag_pos = pos + eX * fs2 * size1; blueflag_pos = pos; - redflag_pos = pos + eY * 0.5 * mySize.y; + yellowflag_pos = pos - eX * fs2 * size1; + pinkflag_pos = pos + eX * fs3 * size1; + break; + } + case NUM_TEAM_3: + { + redflag_pos = pos + eX * fs3 * size1; + blueflag_pos = pos - eX * fs2 * size1; + yellowflag_pos = pos; + pinkflag_pos = pos + eX * fs2 * size1; + break; + } + case NUM_TEAM_4: + { + redflag_pos = pos - eX * fs2 * size1; + blueflag_pos = pos + eX * fs3 * size1; + yellowflag_pos = pos + eX * fs2 * size1; + pinkflag_pos = pos; + break; } - flag_size = eY * 0.5 * mySize.y + eX * mySize.x; } + neutralflag_pos = pos; + flag_size = e1 * fs * size1 + e2 * size2; f = bound(0, redflag_statuschange_elapsedtime*2, 1); if(red_icon_prevstatus && f < 1) @@ -2916,6 +3096,24 @@ void HUD_Mod_CTF(vector pos, vector mySize) drawpic_aspect_skin_expanding(blueflag_pos, blue_icon_prevstatus, flag_size, '1 1 1', panel_fg_alpha * blue_alpha_prevstatus, DRAWFLAG_NORMAL, f); if(blue_icon) drawpic_aspect_skin(blueflag_pos, blue_icon, flag_size, '1 1 1', panel_fg_alpha * blue_alpha * f, DRAWFLAG_NORMAL); + + f = bound(0, yellowflag_statuschange_elapsedtime*2, 1); + if(yellow_icon_prevstatus && f < 1) + drawpic_aspect_skin_expanding(yellowflag_pos, yellow_icon_prevstatus, flag_size, '1 1 1', panel_fg_alpha * yellow_alpha_prevstatus, DRAWFLAG_NORMAL, f); + if(yellow_icon) + drawpic_aspect_skin(yellowflag_pos, yellow_icon, flag_size, '1 1 1', panel_fg_alpha * yellow_alpha * f, DRAWFLAG_NORMAL); + + f = bound(0, pinkflag_statuschange_elapsedtime*2, 1); + if(pink_icon_prevstatus && f < 1) + drawpic_aspect_skin_expanding(pinkflag_pos, pink_icon_prevstatus, flag_size, '1 1 1', panel_fg_alpha * pink_alpha_prevstatus, DRAWFLAG_NORMAL, f); + if(pink_icon) + drawpic_aspect_skin(pinkflag_pos, pink_icon, flag_size, '1 1 1', panel_fg_alpha * pink_alpha * f, DRAWFLAG_NORMAL); + + f = bound(0, neutralflag_statuschange_elapsedtime*2, 1); + if(neutral_icon_prevstatus && f < 1) + drawpic_aspect_skin_expanding(neutralflag_pos, neutral_icon_prevstatus, flag_size, '1 1 1', panel_fg_alpha * neutral_alpha_prevstatus, DRAWFLAG_NORMAL, f); + if(neutral_icon) + drawpic_aspect_skin(neutralflag_pos, neutral_icon, flag_size, '1 1 1', panel_fg_alpha * neutral_alpha * f, DRAWFLAG_NORMAL); } // Keyhunt HUD modicon section @@ -3303,14 +3501,14 @@ void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, int layout, fl if(mySize.x/mySize.y > aspect_ratio) { i = aspect_ratio * mySize.y; - myPos_x = myPos.x + (mySize.x - i) / 2; - mySize_x = i; + myPos.x = myPos.x + (mySize.x - i) / 2; + mySize.x = i; } else { i = 1/aspect_ratio * mySize.x; - myPos_y = myPos.y + (mySize.y - i) / 2; - mySize_y = i; + myPos.y = myPos.y + (mySize.y - i) / 2; + mySize.y = i; } if (layout) // show text too @@ -3451,17 +3649,17 @@ void HUD_PressedKeys(void) vector newSize = '0 0 0'; if(mySize.x/mySize.y > aspect) { - newSize_x = aspect * mySize.y; - newSize_y = mySize.y; + newSize.x = aspect * mySize.y; + newSize.y = mySize.y; - pos_x = pos.x + (mySize.x - newSize.x) / 2; + pos.x = pos.x + (mySize.x - newSize.x) / 2; } else { - newSize_y = 1/aspect * mySize.x; - newSize_x = mySize.x; + newSize.y = 1/aspect * mySize.x; + newSize.x = mySize.x; - pos_y = pos.y + (mySize.y - newSize.y) / 2; + pos.y = pos.y + (mySize.y - newSize.y) / 2; } mySize = newSize; } @@ -3514,8 +3712,8 @@ void HUD_Chat(void) if(autocvar__con_chat_maximized && !autocvar__hud_configure) // draw at full screen height if maximized { - panel_pos_y = panel_bg_border; - panel_size_y = vid_conheight - panel_bg_border * 2; + panel_pos.y = panel_bg_border; + panel_size.y = vid_conheight - panel_bg_border * 2; if(panel.current_panel_bg == "0") // force a border when maximized { string panel_bg; @@ -3635,7 +3833,7 @@ void HUD_EngineInfo(void) // #define drawInfoMessage(s) do { \ if(autocvar_hud_panel_infomessages_flip) \ - o_x = pos.x + mySize.x - stringwidth(s, true, fontsize); \ + o.x = pos.x + mySize.x - stringwidth(s, true, fontsize); \ drawcolorcodedstring(o, s, fontsize, a, DRAWFLAG_NORMAL); \ o.y += fontsize.y; \ } while(0) @@ -3662,17 +3860,17 @@ void HUD_InfoMessages(void) vector newSize = '0 0 0'; if(mySize.x/mySize.y > 5) { - newSize_x = 5 * mySize.y; - newSize_y = mySize.y; + newSize.x = 5 * mySize.y; + newSize.y = mySize.y; - pos_x = pos.x + (mySize.x - newSize.x) / 2; + pos.x = pos.x + (mySize.x - newSize.x) / 2; } else { - newSize_y = 1/5 * mySize.x; - newSize_x = mySize.x; + newSize.y = 1/5 * mySize.x; + newSize.x = mySize.x; - pos_y = pos.y + (mySize.y - newSize.y) / 2; + pos.y = pos.y + (mySize.y - newSize.y) / 2; } mySize = newSize; @@ -3780,7 +3978,7 @@ void HUD_InfoMessages(void) tm = teams.sort_next; if (tm) { - for(0; tm.sort_next; tm = tm.sort_next) + for (; tm.sort_next; tm = tm.sort_next) { if(!tm.team_size || tm.team == NUM_SPECTATOR) continue; @@ -3917,17 +4115,17 @@ void HUD_Physics(void) { panel_size.x *= 0.5; if (autocvar_hud_panel_physics_flip) - speed_offset_x = panel_size.x; + speed_offset.x = panel_size.x; else - acceleration_offset_x = panel_size.x; + acceleration_offset.x = panel_size.x; } else { panel_size.y *= 0.5; if (autocvar_hud_panel_physics_flip) - speed_offset_y = panel_size.y; + speed_offset.y = panel_size.y; else - acceleration_offset_y = panel_size.y; + acceleration_offset.y = panel_size.y; } float speed_baralign, acceleration_baralign; if (autocvar_hud_panel_physics_baralign == 1) @@ -3954,26 +4152,26 @@ void HUD_Physics(void) vector tmp_offset = '0 0 0', tmp_size = '0 0 0'; if (autocvar_hud_panel_physics_text == 1 || autocvar_hud_panel_physics_text == 2) { - tmp_size_x = panel_size.x * 0.75; - tmp_size_y = panel_size.y * text_scale; + tmp_size.x = panel_size.x * 0.75; + tmp_size.y = panel_size.y * text_scale; if (speed_baralign) - tmp_offset_x = panel_size.x - tmp_size.x; + tmp_offset.x = panel_size.x - tmp_size.x; //else //tmp_offset_x = 0; - tmp_offset_y = (panel_size.y - tmp_size.y) / 2; + tmp_offset.y = (panel_size.y - tmp_size.y) / 2; drawstring_aspect(panel_pos + speed_offset + tmp_offset, ftos(speed), tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); //draw speed unit if (speed_baralign) - tmp_offset_x = 0; + tmp_offset.x = 0; else - tmp_offset_x = tmp_size.x; + tmp_offset.x = tmp_size.x; if (autocvar_hud_panel_physics_speed_unit_show) { //tmp_offset_y = 0; - tmp_size_x = panel_size.x * (1 - 0.75); - tmp_size_y = panel_size.y * 0.4 * text_scale; - tmp_offset_y = (panel_size.y * 0.4 - tmp_size.y) / 2; + tmp_size.x = panel_size.x * (1 - 0.75); + tmp_size.y = panel_size.y * 0.4 * text_scale; + tmp_offset.y = (panel_size.y * 0.4 - tmp_size.y) / 2; drawstring_aspect(panel_pos + speed_offset + tmp_offset, unit, tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); } } @@ -4017,8 +4215,8 @@ void HUD_Physics(void) peak_offsetX = (1 - min(top_speed, max_speed)/max_speed) * panel_size.x; else // if (speed_baralign == 2) peak_offsetX = min(top_speed, max_speed)/max_speed * panel_size.x * 0.5; - peak_size_x = floor(panel_size.x * 0.01 + 1.5); - peak_size_y = panel_size.y; + peak_size.x = floor(panel_size.x * 0.01 + 1.5); + peak_size.y = panel_size.y; if (speed_baralign == 2) // draw two peaks, on both sides { drawfill(panel_pos + speed_offset + eX * (0.5 * panel_size.x + peak_offsetX - peak_size.x), peak_size, autocvar_hud_progressbar_speed_color, f * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); @@ -4029,9 +4227,9 @@ void HUD_Physics(void) } //top speed - tmp_offset_y = panel_size.y * 0.4; - tmp_size_x = panel_size.x * (1 - 0.75); - tmp_size_y = (panel_size.y - tmp_offset.y) * text_scale; + tmp_offset.y = panel_size.y * 0.4; + tmp_size.x = panel_size.x * (1 - 0.75); + tmp_size.y = (panel_size.y - tmp_offset.y) * text_scale; tmp_offset.y += (panel_size.y - tmp_offset.y - tmp_size.y) / 2; drawstring_aspect(panel_pos + speed_offset + tmp_offset, ftos(top_speed), tmp_size, '1 0 0', f * panel_fg_alpha, DRAWFLAG_NORMAL); } @@ -4058,12 +4256,12 @@ void HUD_Physics(void) tmp_size = acceleration_progressbar_scale * panel_size.x * eX + panel_size.y * eY; if (acceleration_baralign == 1) - tmp_offset_x = panel_size.x - tmp_size.x; + tmp_offset.x = panel_size.x - tmp_size.x; else if (acceleration_baralign == 2 || acceleration_baralign == 3) - tmp_offset_x = (panel_size.x - tmp_size.x) / 2; + tmp_offset.x = (panel_size.x - tmp_size.x) / 2; else - tmp_offset_x = 0; - tmp_offset_y = 0; + tmp_offset.x = 0; + tmp_offset.y = 0; } else { @@ -4073,10 +4271,10 @@ void HUD_Physics(void) HUD_Panel_DrawProgressBar(panel_pos + acceleration_offset + tmp_offset, tmp_size, "accelbar", f, 0, acceleration_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL); } - tmp_size_x = panel_size.x; - tmp_size_y = panel_size.y * text_scale; - tmp_offset_x = 0; - tmp_offset_y = (panel_size.y - tmp_size.y) / 2; + tmp_size.x = panel_size.x; + tmp_size.y = panel_size.y * text_scale; + tmp_offset.x = 0; + tmp_offset.y = (panel_size.y - tmp_size.y) / 2; if (autocvar_hud_panel_physics_text == 1 || autocvar_hud_panel_physics_text == 3) drawstring_aspect(panel_pos + acceleration_offset + tmp_offset, strcat(ftos_decimals(acceleration, 2), "g"), tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL); @@ -4241,7 +4439,7 @@ void HUD_CenterPrint (void) if(target_pos.y > panel_pos.y) { panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha); - panel_size_y = min(panel_size.y, vid_conheight - scoreboard_bottom); + panel_size.y = min(panel_size.y, vid_conheight - scoreboard_bottom); } } @@ -4356,7 +4554,7 @@ void HUD_CenterPrint (void) if (ts != "") { if (align) - pos_x = panel_pos.x + (panel_size.x - stringwidth(ts, true, fontsize)) * align; + pos.x = panel_pos.x + (panel_size.x - stringwidth(ts, true, fontsize)) * align; if (a > 0.5/255.0) // Otherwise guaranteed invisible - don't show. This is checked a second time after some multiplications with other factors were done so temporary changes of these cannot cause flicker. drawcolorcodedstring(pos + eY * 0.5 * (1 - sz) * fontsize.y, ts, fontsize, a, DRAWFLAG_NORMAL); pos.y += fontsize.y; @@ -4371,7 +4569,7 @@ void HUD_CenterPrint (void) msg_size = pos.y - msg_size; if (autocvar_hud_panel_centerprint_flip) { - pos_y = current_msg_posY - CENTERPRINT_SPACING * fontsize.y; + pos.y = current_msg_posY - CENTERPRINT_SPACING * fontsize.y; if (a < 1 && centerprint_msgID[j] == 0) // messages with id can be replaced just after they are faded out, so never move over them the next messages pos.y += (msg_size + CENTERPRINT_SPACING * fontsize.y) * (1 - sqrt(sz)); @@ -4418,7 +4616,7 @@ void HUD_Buffs(void) { buffs = Buff_Type_first.items; // force first buff } - + float b = 0; // counter to tell other functions that we have buffs entity e; string s = ""; @@ -4451,7 +4649,7 @@ void HUD_Buffs(void) //float is_vertical = (panel_ar < 1); //float buff_iconalign = autocvar_hud_panel_buffs_iconalign; vector buff_offset = '0 0 0'; - + for(e = Buff_Type_first; e; e = e.enemy) if(buffs & e.items) { //DrawNumIcon(pos + buff_offset, mySize, shield, "shield", is_vertical, buff_iconalign, '1 1 1', 1);