X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud.qc;h=3299648da6f95b78fac741078bad690097ba7825;hb=9a2efec7718c9dd4805a8982f475f86f05509979;hp=9eb99ba59c08f3ef3d87a10e7ddd0121209e4efb;hpb=ec7ff827741a81d266e004e720644f57d480a4f3;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 9eb99ba59..3299648da 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -142,183 +142,6 @@ float stringwidth_nocolors(string s, vector theSize) return stringwidth(s, FALSE, theSize); } -#define CENTERPRINT_MAX_LINES 30 -string centerprint_messages[CENTERPRINT_MAX_LINES]; -float centerprint_width[CENTERPRINT_MAX_LINES]; -float centerprint_time; -float centerprint_expire; -float centerprint_num; -float centerprint_offset_hint; -vector centerprint_fontsize; - -void centerprint(string strMessage) -{ - float i, j, n, hcount; - string s; - - centerprint_fontsize = HUD_GetFontsize("scr_centersize"); - - centerprint_expire = min(centerprint_expire, time); // if any of the returns happens, this message will fade out - - if(autocvar_scr_centertime <= 0) - return; - - if(strMessage == "") - return; - - // strip trailing newlines - j = strlen(strMessage) - 1; - while(substring(strMessage, j, 1) == "\n" && j >= 0) - j = j - 1; - strMessage = substring(strMessage, 0, j + 1); - - if(strMessage == "") - return; - - // strip leading newlines and remember them, they are a hint that the message should be lower on the screen - j = 0; - while(substring(strMessage, j, 1) == "\n" && j < strlen(strMessage)) - j = j + 1; - strMessage = substring(strMessage, j, strlen(strMessage) - j); - centerprint_offset_hint = j; - - if(strMessage == "") - return; - - // if we get here, we have a message. Initialize its height. - centerprint_num = 0; - - n = tokenizebyseparator(strMessage, "\n"); - i = hcount = 0; - for(j = 0; j < n; ++j) - { - getWrappedLine_remaining = argv(j); - while(getWrappedLine_remaining) - { - s = getWrappedLine(vid_conwidth * 0.75, centerprint_fontsize, stringwidth_colors); - if(centerprint_messages[i] != s) // don't fade the same message in, looks stupid - centerprint_time = time; - if(centerprint_messages[i]) - strunzone(centerprint_messages[i]); - centerprint_messages[i] = strzone(s); - centerprint_width[i] = stringwidth(s, TRUE, centerprint_fontsize); - ++i; - - // half height for empty lines looks better - if(s == "") - hcount += 0.5; - else - hcount += 1; - - if(i >= CENTERPRINT_MAX_LINES) - break; - } - } - - float h, havail; - h = centerprint_fontsize_y*hcount; - - havail = vid_conheight; - if(autocvar_con_chatpos < 0) - havail -= (-autocvar_con_chatpos + autocvar_con_chat) * autocvar_con_chatsize; // avoid overlapping chat - if(havail > vid_conheight - 70) - havail = vid_conheight - 70; // avoid overlapping HUD - -#if 0 - float forbiddenmin, forbiddenmax, allowedmin, allowedmax, preferred; - - // here, the centerprint would cover the crosshair. REALLY BAD. - forbiddenmin = vid_conheight * 0.5 - h - 16; - forbiddenmax = vid_conheight * 0.5 + 16; - - allowedmin = scoreboard_bottom; - allowedmax = havail - h; - preferred = (havail - h)/2; - - - // possible orderings (total: 4! / 4 = 6) - // allowedmin allowedmax forbiddenmin forbiddenmax - // forbiddenmin forbiddenmax allowedmin allowedmax - if(allowedmax < forbiddenmin || allowedmin > forbiddenmax) - { - // forbidden doesn't matter in this case - centerprint_start_y = bound(allowedmin, preferred, allowedmax); - } - // allowedmin forbiddenmin allowedmax forbiddenmax - else if(allowedmin < forbiddenmin && allowedmax < forbiddenmax) - { - centerprint_start_y = bound(allowedmin, preferred, forbiddenmin); - } - // allowedmin forbiddenmin forbiddenmax allowedmax - else if(allowedmin < forbiddenmin) - { - // make sure the forbidden zone is not covered - if(preferred > (forbiddenmin + forbiddenmax) * 0.5) - centerprint_start_y = bound(allowedmin, preferred, forbiddenmin); - else - centerprint_start_y = bound(forbiddenmax, preferred, allowedmin); - } - // forbiddenmin allowedmin allowedmax forbiddenmax - else if(allowedmax < forbiddenmax) - { - // it's better to leave the allowed zone (overlap with scoreboard) than - // to cover the forbidden zone (crosshair) - if(preferred > (forbiddenmin + forbiddenmax) * 0.5) - centerprint_start_y = forbiddenmax; - else - centerprint_start_y = forbiddenmin; - } - // forbiddenmin allowedmin forbiddenmax allowedmax - else - { - centerprint_start_y = bound(forbiddenmax, preferred, allowedmax); - } -#else -#endif - - centerprint_num = i; - - centerprint_expire = time + autocvar_scr_centertime; -} - -void HUD_DrawCenterPrint (void) -{ - float i; - vector pos; - string ts; - float a, sz; - - if(time - centerprint_time < 0.25) - a = (time - centerprint_time) / 0.25; - else - a = bound(0, 1 - 4 * (time - centerprint_expire), 1); - - if(a <= 0) - return; - - sz = 0.8 + (a / 5); - - if(centerprint_num * autocvar_scr_centersize > 24 && scoreboard_active) // 24 = height of Scoreboard text - centerprint_start_y = scoreboard_bottom + centerprint_fontsize_y; - - pos = centerprint_start; - for (i=0; i 0) //before observing, now spectating - || (prev_spectatee_status > 0 && spectatee_status > 0 && prev_spectatee_status != spectatee_status) //changed spectated player - ) - { - //no effect - saved_health = 0; - saved_armor = 0; - health_time = 0; - armor_time = 0; - } - else if(prev_spectatee_status == -1 || (prev_spectatee_status > 0 && !spectatee_status)) //before spectating/observing, now playing - health_time = -1; + armor = getstati(STAT_ARMOR); - if (health_time == -1) - { - //start the load effect - saved_health = -2; - saved_armor = -2; - health_time = time; - armor_time = time; - prev_health = 0; - prev_armor = 0; - } + // code to check for spectatee_status changes is in Ent_ClientData() + // prev_p_health and prev_health can be set to -1 there + + if (prev_p_health == -1) + { + // no effect + health_beforedamage = 0; + armor_beforedamage = 0; + health_damagetime = 0; + armor_damagetime = 0; + prev_health = health; + prev_armor = armor; + old_p_health = health; + old_p_armor = armor; + prev_p_health = health; + prev_p_armor = armor; + } + else if (prev_health == -1) + { + //start the load effect + health_damagetime = 0; + armor_damagetime = 0; + prev_health = 0; + prev_armor = 0; } - armor = getstati(STAT_ARMOR); fuel = getstati(STAT_FUEL); } else @@ -1467,34 +1299,39 @@ void HUD_HealthArmor(void) pain_health_alpha = 1; if (autocvar_hud_panel_healtharmor_progressbar_gfx) { - if (saved_health == -1) + if (autocvar_hud_panel_healtharmor_progressbar_gfx_smooth > 0) { - if (prev_health == 0 || prev_health - health >= 3) + if (fabs(prev_health - health) >= autocvar_hud_panel_healtharmor_progressbar_gfx_smooth) + { + if (time - old_p_healthtime < 1) + old_p_health = prev_p_health; + else + old_p_health = prev_health; + old_p_healthtime = time; + } + if (time - old_p_healthtime < 1) { - health_time = time; - saved_health = prev_health; + p_health += (old_p_health - health) * (1 - (time - old_p_healthtime)); + prev_p_health = p_health; } } - if (saved_health != -1) + if (autocvar_hud_panel_healtharmor_progressbar_gfx_damage > 0) { - float d = time - health_time; - if (d < 1) + if (prev_health - health >= autocvar_hud_panel_healtharmor_progressbar_gfx_damage) { - if (saved_health == -2) - p_health *= sqrt(d); - else - { - HUD_Panel_DrawProgressBar(pos + health_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_health, saved_health/maxhealth, is_vertical, health_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * (1 - d * d), DRAWFLAG_NORMAL); - if (prev_health - health >= 1) //refresh the effect if repeatedly damaged - health_time = time; - } + if (time - health_damagetime >= 1) + health_beforedamage = prev_health; + health_damagetime = time; + } + if (time - health_damagetime < 1) + { + float health_damagealpha = 1 - (time - health_damagetime)*(time - health_damagetime); + HUD_Panel_DrawProgressBar(pos + health_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_health, health_beforedamage/maxhealth, is_vertical, health_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * health_damagealpha, DRAWFLAG_NORMAL); } - else - saved_health = -1; //damage effect ended } prev_health = health; - if (health <= 40 && saved_health != -2) + if (health <= autocvar_hud_panel_healtharmor_progressbar_gfx_lowhealth) { float BLINK_FACTOR = 0.15; float BLINK_BASE = 0.85; @@ -1517,30 +1354,35 @@ void HUD_HealthArmor(void) p_armor = armor; if (autocvar_hud_panel_healtharmor_progressbar_gfx) { - if (saved_armor == -1) + if (autocvar_hud_panel_healtharmor_progressbar_gfx_smooth > 0) { - if (prev_armor == 0 || prev_armor - armor >= 3) + if (fabs(prev_armor - armor) >= autocvar_hud_panel_healtharmor_progressbar_gfx_smooth) { - armor_time = time; - saved_armor = prev_armor; + if (time - old_p_armortime < 1) + old_p_armor = prev_p_armor; + else + old_p_armor = prev_armor; + old_p_armortime = time; + } + if (time - old_p_armortime < 1) + { + p_armor += (old_p_armor - armor) * (1 - (time - old_p_armortime)); + prev_p_armor = p_armor; } } - if (saved_armor != -1) + if (autocvar_hud_panel_healtharmor_progressbar_gfx_damage > 0) { - float d = time - armor_time; - if (d < 1) + if (prev_armor - armor >= autocvar_hud_panel_healtharmor_progressbar_gfx_damage) { - if (saved_armor == -2) - p_armor *= sqrt(d); - else - { - HUD_Panel_DrawProgressBar(pos + armor_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, saved_armor/maxarmor, is_vertical, armor_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * (1 - d * d), DRAWFLAG_NORMAL); - if (prev_armor - armor >= 1) //refresh the effect if repeatedly damaged - armor_time = time; - } + if (time - armor_damagetime >= 1) + armor_beforedamage = prev_armor; + armor_damagetime = time; + } + if (time - armor_damagetime < 1) + { + float armor_damagealpha = 1 - (time - armor_damagetime)*(time - armor_damagetime); + HUD_Panel_DrawProgressBar(pos + armor_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, armor_beforedamage/maxarmor, is_vertical, armor_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * armor_damagealpha, DRAWFLAG_NORMAL); } - else - saved_armor = -1; //damage effect ended } prev_armor = armor; } @@ -1661,7 +1503,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s } else if(msg == MSG_KILL) { w = DEATH_WEAPONOF(type); if(WEP_VALID(w)) { - if((w == WEP_SNIPERRIFLE || w == WEP_MINSTANEX) && type & HITTYPE_HEADSHOT) // all headshot weapons go here + if((w == WEP_RIFLE || w == WEP_MINSTANEX) && type & HITTYPE_HEADSHOT) // all headshot weapons go here HUD_KillNotify_Push(s1, s2, 1, DEATH_HEADSHOT); else HUD_KillNotify_Push(s1, s2, 1, type); @@ -1831,7 +1673,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s print (sprintf(_("%s^7 is a ^1BERSERKER!\n"), s1)); } else if(type == KILL_SPREE_25) { if(gentle) - print (sprintf(_("%s^7 made ^1TWENTY FIFE SCORES IN A ROW!\n"), s1)); + print (sprintf(_("%s^7 made ^1TWENTY FIVE SCORES IN A ROW!\n"), s1)); else print (sprintf(_("%s^7 inflicts ^1CARNAGE!\n"), s1)); } else if(type == KILL_SPREE_30) { @@ -1973,92 +1815,90 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s } } -#define DAMAGE_CENTERPRINT_SPACER NEWLINES - void HUD_Centerprint(string s1, string s2, float type, float msg) { float gentle; gentle = (autocvar_cl_gentle || autocvar_cl_gentle_messages); if(msg == MSG_SUICIDE) { if (type == DEATH_TEAMCHANGE) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("You are now on: %s"), s1))); + centerprint(strcat(sprintf(_("You are now on: %s"), s1))); } else if (type == DEATH_AUTOTEAMCHANGE) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("You have been moved into a different team to improve team balance\nYou are now on: %s"), s1))); + centerprint(strcat(sprintf(_("You have been moved into a different team to improve team balance\nYou are now on: %s"), s1))); } else if (type == DEATH_CAMP) { if(gentle) - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1Reconsider your tactics, camper!"))); + centerprint(strcat(_("^1Reconsider your tactics, camper!"))); else - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1Die camper!"))); + centerprint(strcat(_("^1Die camper!"))); } else if (type == DEATH_NOAMMO) { if(gentle) - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1You are reinserted into the game for running out of ammo..."))); + centerprint(strcat(_("^1You are reinserted into the game for running out of ammo..."))); else - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1You were killed for running out of ammo..."))); + centerprint(strcat(_("^1You were killed for running out of ammo..."))); } else if (type == DEATH_ROT) { if(gentle) - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1You need to preserve your health"))); + centerprint(strcat(_("^1You need to preserve your health"))); else - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1You grew too old without taking your medicine"))); + centerprint(strcat(_("^1You grew too old without taking your medicine"))); } else if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) { if(gentle) - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1Don't go against team mates!"))); + centerprint(strcat(_("^1Don't go against team mates!"))); else - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1Don't shoot your team mates!"))); + centerprint(strcat(_("^1Don't shoot your team mates!"))); } else if (type == DEATH_QUIET) { // do nothing } else { // generic message if(gentle) - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1You need to be more careful!"))); + centerprint(strcat(_("^1You need to be more careful!"))); else - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1You killed your own dumb self!"))); + centerprint(strcat(_("^1You killed your own dumb self!"))); } } else if(msg == MSG_KILL) { if (type == KILL_TEAM_RED || type == KILL_TEAM_BLUE) { if(gentle) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1Moron! You went against %s, a team mate!"), s1))); + centerprint(strcat(sprintf(_("^1Moron! You went against %s, a team mate!"), s1))); } else { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1Moron! You fragged %s, a team mate!"), s1))); + centerprint(strcat(sprintf(_("^1Moron! You fragged %s, a team mate!"), s1))); } } else if (type == KILL_FIRST_BLOOD) { if(gentle) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1First score"))); + centerprint(strcat(_("^1First score"))); } else { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1First blood"))); + centerprint(strcat(_("^1First blood"))); } } else if (type == KILL_FIRST_VICTIM) { if(gentle) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1First casualty"))); + centerprint(strcat(_("^1First casualty"))); } else { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1First victim"))); + centerprint(strcat(_("^1First victim"))); } } else if (type == KILL_TYPEFRAG) { // s2 contains "advanced kill messages" such as ping, handicap... if(gentle) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1You scored against ^7%s^1 who was typing!"), s1), s2)); + centerprint(strcat(sprintf(_("^1You scored against ^7%s^1 who was typing!"), s1), s2)); } else { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1You typefragged ^7%s"), s1), s2)); + centerprint(strcat(sprintf(_("^1You typefragged ^7%s"), s1), s2)); } } else if (type == KILL_TYPEFRAGGED) { if(gentle) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1You were scored against by ^7%s^1 while you were typing!"), s1), s2)); + centerprint(strcat(sprintf(_("^1You were scored against by ^7%s^1 while you were typing!"), s1), s2)); } else { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1You were typefragged by ^7%s"), s1), s2)); + centerprint(strcat(sprintf(_("^1You were typefragged by ^7%s"), s1), s2)); } } else if (type == KILL_FRAG) { if(gentle) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^4You scored against ^7%s"), s1), s2)); + centerprint(strcat(sprintf(_("^4You scored against ^7%s"), s1), s2)); } else { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^4You fragged ^7%s"), s1), s2)); + centerprint(strcat(sprintf(_("^4You fragged ^7%s"), s1), s2)); } } else { // generic message if(gentle) { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1You were scored against by ^7%s"), s1), s2)); + centerprint(strcat(sprintf(_("^1You were scored against by ^7%s"), s1), s2)); } else { - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, sprintf(_("^1You were fragged by ^7%s"), s1), s2)); + centerprint(strcat(sprintf(_("^1You were fragged by ^7%s"), s1), s2)); } } } else if(msg == MSG_KILL_ACTION) { // TODO: invent more centerprints here? - centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, _("^1Watch your step!"))); + centerprint(strcat(_("^1Watch your step!"))); } } @@ -2560,6 +2400,128 @@ void HUD_Radar(void) // Score (#7) // void HUD_UpdatePlayerTeams(); +void HUD_Score_Rankings(vector pos, vector mySize, entity me, float team_count) +{ + float score; + entity tm, pl; +#define SCOREPANEL_MAX_ENTRIES 6 +#define SCOREPANEL_ASPECTRATIO 2 + const float entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize_y/mySize_x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES); + const vector fontsize = '1 1 0' * (mySize_y/entries); + + vector rgb, score_color; + rgb = '1 1 1'; + score_color = '1 1 1'; + + const float name_size = mySize_x*0.75; + const float spacing_size = mySize_x*0.04; + const float highlight_alpha = 0.2; + float i, me_printed, first_pl; + string s; + i, first_pl = 0; + if (autocvar__hud_configure) + { + float players_per_team; + if (team_count) + { + // show team scores in the first line + float score_size = mySize_x / team_count; + players_per_team = max(2, ceil((entries - 1) / team_count)); + for(i=0; i= time) + { + if(centerprint_messages[j]) + strunzone(centerprint_messages[j]); + centerprint_messages[j] == strzone(msg_without_CPID(strMessage)); + centerprint_time[j] = time; + return; + } + if(centerprint_messages[j] == strMessage) + { + centerprint_time[j] = time; + centerprint_msgID[j] = new_id; + return; + } + } + + --cpm_index; + if (cpm_index == -1) + cpm_index = CENTERPRINT_MAX_MSGS - 1; + if(centerprint_messages[cpm_index]) + strunzone(centerprint_messages[cpm_index]); + if (new_id) + centerprint_messages[cpm_index] = strzone(msg_without_CPID(strMessage)); + else + centerprint_messages[cpm_index] = strzone(strMessage); + centerprint_msgID[cpm_index] = new_id; + centerprint_time[cpm_index] = time; +} + +// CenterPrint (#16) +// +void HUD_CenterPrint (void) +{ + if(!autocvar__hud_configure) + { + if(!autocvar_hud_panel_centerprint) return; + } + else + hud_configure_active_panel = HUD_PANEL_CENTERPRINT; + + HUD_Panel_UpdateCvars(centerprint); + + HUD_Panel_DrawBg(1); + if(panel_bg_padding) + { + panel_pos += '1 1 0' * panel_bg_padding; + panel_size -= '2 2 0' * panel_bg_padding; + } + + float entries, height; + vector fontsize; + // entries = bound(1, floor(CENTERPRINT_MAX_ENTRIES * 4 * panel_size_y/panel_size_x), CENTERPRINT_MAX_ENTRIES); + // height = panel_size_y/entries; + // fontsize = '1 1 0' * height; + height = vid_conheight/40 * autocvar_hud_panel_centerprint_fontscale; + fontsize = '1 1 0' * height; + entries = bound(1, floor(panel_size_y/height), CENTERPRINT_MAX_ENTRIES); + + float i, j, k, n; + float a, sz, fade, align; + vector pos; + string ts; + + pos = panel_pos; + fade = min(autocvar_hud_panel_centerprint_time/8, 0.25); + align = bound(0, autocvar_hud_panel_centerprint_align, 1); + for (i=0, j=cpm_index; i time) + { + a = 1; + sz = 1; + } + else if (centerprint_time[j] + autocvar_hud_panel_centerprint_time > time) + { + a = (centerprint_time[j] + autocvar_hud_panel_centerprint_time - time) / fade; + sz = 0.8 + a * (1 - 0.8); + } + + drawfontscale = sz * '1 1 0'; + n = tokenizebyseparator(centerprint_messages[j], "\n"); + for(k = 0; k < n; ++k) + { + getWrappedLine_remaining = argv(k); + while(getWrappedLine_remaining) + { + ts = getWrappedLine(panel_size_x, fontsize, stringwidth_colors); + if (ts != "") + { + if (align) + pos_x = panel_pos_x + (panel_size_x - stringwidth(ts, TRUE, fontsize)) * align; + drawcolorcodedstring(pos + '0 1 0' * 1.5 * (1 - sz) * fontsize_y, ts, fontsize, a, DRAWFLAG_NORMAL); + pos_y += fontsize_y * 1.5; + } + else + pos_y += fontsize_y; + if (pos_y > panel_pos_y + panel_size_y - fontsize_y) + { + drawfontscale = '1 1 0'; + return; + } + } + } + if (a < 1) + pos_y -= 1.5 * fontsize_y * (1 - a*a); + drawfontscale = '1 1 0'; + } +} + /* ================== Main HUD system @@ -4482,6 +4512,8 @@ switch (id) {\ HUD_InfoMessages(); break;\ case (HUD_PANEL_PHYSICS):\ HUD_Physics(); break;\ + case (HUD_PANEL_CENTERPRINT):\ + HUD_CenterPrint(); break;\ } ENDS_WITH_CURLY_BRACE void HUD_Main (void) @@ -4497,7 +4529,18 @@ void HUD_Main (void) hud_fade_alpha = (1 - scoreboard_fade_alpha); if(intermission == 2) // no hud during mapvote + { + if (autocvar__hud_configure) //force exit from hud config + { + if (menu_enabled) + { + menu_enabled = 0; + localcmd("togglemenu\n"); + } + cvar_set("_hud_configure", "0"); + } hud_fade_alpha = 0; + } else if(autocvar__menu_alpha == 0 && scoreboard_fade_alpha == 0) hud_fade_alpha = 1;