]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud.qc
fix a load of things concerning the scoreboard, leftalign scoreboard, make centerprin...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud.qc
index 0bf4c5051bc41c04f01e135369f9106eee35d1df..cd44e450f3ce23061539f788ce14da5970bbfc5d 100644 (file)
@@ -131,7 +131,7 @@ float stringwidth_nocolors(string s, vector theSize)
 #define CENTERPRINT_MAX_LINES 30
 string centerprint_messages[CENTERPRINT_MAX_LINES];
 float centerprint_width[CENTERPRINT_MAX_LINES];
-vector centerprint_start;
+float centerprint_time;
 float centerprint_expire;
 float centerprint_num;
 float centerprint_offset_hint;
@@ -182,6 +182,8 @@ void centerprint(string strMessage)
                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);
@@ -208,8 +210,6 @@ void centerprint(string strMessage)
        if(havail > vid_conheight - 70)
                havail = vid_conheight - 70; // avoid overlapping HUD
 
-       centerprint_start_x = 0;
-
 #if 0
        float forbiddenmin, forbiddenmax, allowedmin, allowedmax, preferred;
 
@@ -260,14 +260,6 @@ void centerprint(string strMessage)
                centerprint_start_y = bound(forbiddenmax, preferred, allowedmax);
        }
 #else
-       centerprint_start_y =
-               min(
-                       max(
-                               max(scoreboard_bottom, vid_conheight * 0.5 + 16),
-                               (havail - h)/2
-                       ),
-                       havail - h
-               );
 #endif
 
        centerprint_num = i;
@@ -279,32 +271,35 @@ void HUD_DrawCenterPrint (void)
        float i;
        vector pos;
        string ts;
-       float a;
+       float a, sz;
 
-       //if(time > centerprint_expire)
-       //      return;
-
-       //a = bound(0, 1 - 2 * (time - centerprint_expire), 1);
-       a = bound(0, 1 - 4 * (time - centerprint_expire), 1);
-       //sz = 1.2 / (a + 0.2);
+       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);
+
        pos = centerprint_start;
        for (i=0; i<centerprint_num; i = i + 1)
        {
-               pos_x = (vid_conwidth - centerprint_width[i]) * 0.5;
                ts = centerprint_messages[i];
+               drawfontscale = sz * '1 1 0';
+               drawfont = hud_bigfont;
+               pos_x = (vid_conwidth - stringwidth(ts, TRUE, centerprint_fontsize)) * 0.5;
                if (ts != "")
                {
-                       drawcolorcodedstring(pos, ts, centerprint_fontsize, a, DRAWFLAG_NORMAL);
-                       //  - '0 0.5 0' * (sz - 1) * centerprint_fontsize_x - '0.5 0 0' * (sz - 1) * centerprint_width[i] * centerprint_fontsize_y, centerprint_fontsize * sz
+                       drawcolorcodedstring(pos + '0 1 0' * (1 - sz) * 0.5 *centerprint_fontsize_y, ts, centerprint_fontsize, a, DRAWFLAG_NORMAL);
                        pos_y = pos_y + centerprint_fontsize_y;
                }
                else
                        // half height for empty lines looks better
-                       pos_y = pos_y + centerprint_fontsize_y * 0.5;
+                       pos_y = pos_y + sz * centerprint_fontsize_y * 0.5;
+               drawfontscale = '1 1 0';
+               drawfont = hud_font;
        }
 }
 
@@ -421,13 +416,13 @@ void HUD_Panel_ExportCfg(string cfgname)
        if(fh >= 0)
        {
                fputs(fh, strcat("seta hud_skin \"", cvar_string("hud_skin"), "\"", "\n"));
-               fputs(fh, strcat("seta hud_bg \"", cvar_string("hud_bg"), "\"", "\n"));
-               fputs(fh, strcat("seta hud_bg_color \"", cvar_string("hud_bg_color"), "\"", "\n"));
-               fputs(fh, strcat("seta hud_bg_color_team \"", cvar_string("hud_bg_color_team"), "\"", "\n"));
-               fputs(fh, strcat("seta hud_bg_alpha \"", cvar_string("hud_bg_alpha"), "\"", "\n"));
-               fputs(fh, strcat("seta hud_bg_border \"", cvar_string("hud_bg_border"), "\"", "\n"));
-               fputs(fh, strcat("seta hud_bg_padding \"", cvar_string("hud_bg_padding"), "\"", "\n"));
-               fputs(fh, strcat("seta hud_fg_alpha \"", cvar_string("hud_fg_alpha"), "\"", "\n"));
+               fputs(fh, strcat("seta hud_panel_bg \"", cvar_string("hud_panel_bg"), "\"", "\n"));
+               fputs(fh, strcat("seta hud_panel_bg_color \"", cvar_string("hud_panel_bg_color"), "\"", "\n"));
+               fputs(fh, strcat("seta hud_panel_bg_color_team \"", cvar_string("hud_panel_bg_color_team"), "\"", "\n"));
+               fputs(fh, strcat("seta hud_panel_bg_alpha \"", cvar_string("hud_panel_bg_alpha"), "\"", "\n"));
+               fputs(fh, strcat("seta hud_panel_bg_border \"", cvar_string("hud_panel_bg_border"), "\"", "\n"));
+               fputs(fh, strcat("seta hud_panel_bg_padding \"", cvar_string("hud_panel_bg_padding"), "\"", "\n"));
+               fputs(fh, strcat("seta hud_panel_fg_alpha \"", cvar_string("hud_panel_fg_alpha"), "\"", "\n"));
                fputs(fh, "\n");
 
                fputs(fh, strcat("seta hud_dock \"", cvar_string("hud_dock"), "\"", "\n"));
@@ -453,6 +448,9 @@ void HUD_Panel_ExportCfg(string cfgname)
                fputs(fh, strcat("seta hud_configure_grid_ysize \"", cvar_string("hud_configure_grid_ysize"), "\"", "\n"));
                fputs(fh, "\n");
 
+               fputs(fh, strcat("seta scr_centerpos \"", cvar_string("scr_centerpos"), "\"", "\n"));
+               fputs(fh, "\n");
+
                // common cvars for all panels
                float i;
                for (i = 0; i < HUD_PANEL_NUM; ++i)
@@ -477,7 +475,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        fputs(fh, strcat("seta hud_panel_", panel_name, "_complainbubble_color_unavailable \"", cvar_string(strcat("hud_panel_", panel_name, "_complainbubble_color_unavailable")), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_panel_", panel_name, "_ammo_color \"", cvar_string(strcat("hud_panel_", panel_name, "_ammo_color")), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_panel_", panel_name, "_ammo_alpha \"", cvar_string(strcat("hud_panel_", panel_name, "_ammo_alpha")), "\"", "\n"));
-                                       fputs(fh, strcat("seta hud_panel_", panel_name, "_aspect \"", cvar_string(strcat("hud_panel_", panel_name, "_ammo_alpha")), "\"", "\n"));
+                                       fputs(fh, strcat("seta hud_panel_", panel_name, "_aspect \"", cvar_string(strcat("hud_panel_", panel_name, "_aspect")), "\"", "\n"));
                                        break;
                                case HUD_PANEL_AMMO:
                                        fputs(fh, strcat("seta hud_panel_", panel_name, "_onlycurrent \"", cvar_string(strcat("hud_panel_", panel_name, "_onlycurrent")), "\"", "\n"));
@@ -487,11 +485,13 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        fputs(fh, strcat("seta hud_panel_", panel_name, "_flip \"", cvar_string(strcat("hud_panel_", panel_name, "_flip")), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_panel_", panel_name, "_iconalign \"", cvar_string(strcat("hud_panel_", panel_name, "_iconalign")), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_panel_", panel_name, "_baralign \"", cvar_string(strcat("hud_panel_", panel_name, "_baralign")), "\"", "\n"));
+                                       fputs(fh, strcat("seta hud_panel_", panel_name, "_progressbar \"", cvar_string(strcat("hud_panel_", panel_name, "_progressbar")), "\"", "\n"));
                                        break;
                                case HUD_PANEL_HEALTHARMOR:
                                        fputs(fh, strcat("seta hud_panel_", panel_name, "_flip \"", cvar_string(strcat("hud_panel_", panel_name, "_flip")), "\n"));
                                        fputs(fh, strcat("seta hud_panel_", panel_name, "_iconalign \"", cvar_string(strcat("hud_panel_", panel_name, "_iconalign")), "\"", "\n"));
                                        fputs(fh, strcat("seta hud_panel_", panel_name, "_baralign \"", cvar_string(strcat("hud_panel_", panel_name, "_baralign")), "\"", "\n"));
+                                       fputs(fh, strcat("seta hud_panel_", panel_name, "_progressbar \"", cvar_string(strcat("hud_panel_", panel_name, "_progressbar")), "\"", "\n"));
                                        break;
                                case HUD_PANEL_NOTIFY:
                                        fputs(fh, strcat("seta hud_panel_", panel_name, "_flip \"", cvar_string(strcat("hud_panel_", panel_name, "_flip")), "\"", "\n"));
@@ -1378,10 +1378,6 @@ float GetAmmoTypeForWep(float i)
        }
 }
 
-#define acc_color(i) stov(cvar_string(strcat("hud_panel_weapons_accuracy_color", ftos(i))))
-#define MAX_ACCURACY_LEVELS 10
-float acc_lev[MAX_ACCURACY_LEVELS];
-
 void HUD_Weapons(void)
 {
        if(!autocvar_hud_panel_weapons && !autocvar__hud_configure)
@@ -1467,17 +1463,6 @@ void HUD_Weapons(void)
        vector wpnpos;
        vector wpnsize;
 
-       float acc_levels;
-       if(autocvar_hud_panel_weapons_accuracy && !(gametype == GAME_RACE || gametype == GAME_CTS))
-       {
-               acc_levels = tokenize(cvar_string("hud_panel_weapons_accuracy_color_levels"));
-               if (acc_levels > MAX_ACCURACY_LEVELS)
-                       acc_levels = MAX_ACCURACY_LEVELS;
-
-               for (i = 0; i < acc_levels; ++i)
-                       acc_lev[i] = stof(argv(i));
-       }
-
        for(i = 0; i < weapon_cnt; ++i)
        {
                wpnpos = pos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows);
@@ -1709,9 +1694,15 @@ void DrawAmmoItem(vector myPos, vector mySize, float itemcode, float currently_s
                drawpic_aspect_skin(newPos, "ammo_current_bg", newSize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 
        drawfont = hud_bigfont;
-       drawstring_aspect(numpos, ftos(a), eX * (2/3) * newSize_x + eY * newSize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+       if(a > 0)
+               drawstring_aspect(numpos, ftos(a), eX * (2/3) * newSize_x + eY * newSize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+       else // "ghost" ammo count
+               drawstring_aspect(numpos, ftos(a), eX * (2/3) * newSize_x + eY * newSize_y, '0 0 0', panel_fg_alpha * alpha * 0.5, DRAWFLAG_NORMAL);
        drawfont = hud_font;
-       drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * newSize_y, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+       if(a > 0)
+               drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * newSize_y, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+       else // "ghost" ammo icon
+               drawpic_aspect_skin(picpos, GetAmmoPicture(itemcode), '1 1 0' * newSize_y, '0 0 0', panel_fg_alpha * alpha * 0.5, DRAWFLAG_NORMAL);
 }
 
 void HUD_Ammo(void)
@@ -1908,8 +1899,11 @@ void HUD_Powerups(void) {
                                barsize = eX * 0.5 * mySize_x * min(1, leftcnt/30) + eY * mySize_y;
                        }
 
-                       HUD_Panel_GetProgressBarColor(leftname)
-                       HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+                       if(autocvar_hud_panel_powerups_progressbar)
+                       {
+                               HUD_Panel_GetProgressBarColor(leftname)
+                               HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
+                       }
                        if(leftcnt > 1)
                                DrawNumIcon(autocvar_hud_panel_powerups_iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, '1 1 1', 1);
                        if(leftcnt <= 5)
@@ -1926,8 +1920,11 @@ void HUD_Powerups(void) {
                                barsize = eX * 0.5 * mySize_x * min(1, rightcnt/30) + eY * mySize_y;
                        }
 
-                       HUD_Panel_GetProgressBarColor(rightname)
-                       HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1) * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       if(autocvar_hud_panel_powerups_progressbar)
+                       {
+                               HUD_Panel_GetProgressBarColor(rightname)
+                               HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1) * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       }
                        if(rightcnt > 1)
                                DrawNumIcon(autocvar_hud_panel_powerups_iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, '1 1 1', 1);
                        if(rightcnt <= 5)
@@ -1946,8 +1943,11 @@ void HUD_Powerups(void) {
                                barsize = eX * mySize_x * min(1, leftcnt/30) + eY * 0.5 * mySize_y;
                        }
 
-                       HUD_Panel_GetProgressBarColor(leftname)
-                       HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1) * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       if(autocvar_hud_panel_powerups_progressbar)
+                       {
+                               HUD_Panel_GetProgressBarColor(leftname)
+                               HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1) * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       }
                        if(leftcnt > 1)
                                DrawNumIcon(autocvar_hud_panel_powerups_iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, '1 1 1', 1);
                        if(leftcnt <= 5)
@@ -1964,8 +1964,11 @@ void HUD_Powerups(void) {
                                barsize = eX * mySize_x * min(1, rightcnt/30) + eY * 0.5 * mySize_y;
                        }
 
-                       HUD_Panel_GetProgressBarColor(rightname)
-                       HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1) * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       if(autocvar_hud_panel_powerups_progressbar)
+                       {
+                               HUD_Panel_GetProgressBarColor(rightname)
+                               HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1) * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       }
                        if(rightcnt > 1)
                                DrawNumIcon(autocvar_hud_panel_powerups_iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, '1 1 1', 1);
                        if(rightcnt <= 5)
@@ -1992,8 +1995,11 @@ void HUD_Powerups(void) {
                                numpos = pos + eY * 0.4 * mySize_x;
                        }
 
-                       HUD_Panel_GetProgressBarColor(leftname)
-                       HUD_Panel_DrawProgressBar(barpos, 1, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1) * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       if(autocvar_hud_panel_powerups_progressbar)
+                       {
+                               HUD_Panel_GetProgressBarColor(leftname)
+                               HUD_Panel_DrawProgressBar(barpos, 1, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1) * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       }
                        if(leftcnt <= 5)
                                drawpic_aspect_skin_expanding(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, bound(0, (leftcnt - leftexact) / 0.5, 1));
                        if(leftcnt > 1)
@@ -2019,8 +2025,11 @@ void HUD_Powerups(void) {
                                numpos = pos + eY * mySize_y - eY * 0.25 * mySize_x + eX * 0.5 * mySize_x;
                        }
 
-                       HUD_Panel_GetProgressBarColor(rightname)
-                       HUD_Panel_DrawProgressBar(barpos, 1, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1) * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       if(autocvar_hud_panel_powerups_progressbar)
+                       {
+                               HUD_Panel_GetProgressBarColor(rightname)
+                               HUD_Panel_DrawProgressBar(barpos, 1, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1) * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       }
                        if(rightcnt <= 5)
                                drawpic_aspect_skin_expanding(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, bound(0, (rightcnt - rightexact) / 0.5, 1));
                        if(rightcnt > 1)
@@ -2093,16 +2102,22 @@ void HUD_HealthArmor(void)
                if(v_z) // NOT fully armored
                {
                        biggercount = "health";
-                       HUD_Panel_GetProgressBarColor("health")
-                       HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       if(autocvar_hud_panel_healtharmor_progressbar)
+                       {
+                               HUD_Panel_GetProgressBarColor("health")
+                               HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       }
                        if(armor)
                                drawpic_aspect_skin(pos + eX * mySize_x - eX * 0.5 * mySize_y, "armor", '0.5 0.5 0' * mySize_y, '1 1 1', panel_fg_alpha * armor / health, DRAWFLAG_NORMAL);
                }
                else
                {
                        biggercount = "armor";
-                       HUD_Panel_GetProgressBarColor("armor")
-                       HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       if(autocvar_hud_panel_healtharmor_progressbar)
+                       {
+                               HUD_Panel_GetProgressBarColor("armor")
+                               HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       }
                        if(health)
                                drawpic_aspect_skin(pos + eX * mySize_x - eX * 0.5 * mySize_y, "health", '0.5 0.5 0' * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                }
@@ -2164,8 +2179,11 @@ void HUD_HealthArmor(void)
                                        barsize = eX * 0.5 * mySize_x * min(1, leftcnt/200) + eY * mySize_y;
                                }
 
-                               HUD_Panel_GetProgressBarColor(leftname)
-                               HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               if(autocvar_hud_panel_healtharmor_progressbar)
+                               {
+                                       HUD_Panel_GetProgressBarColor(leftname)
+                                       HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               }
                                DrawNumIcon(autocvar_hud_panel_healtharmor_iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, HUD_Get_Num_Color(leftcnt, 200), 1);
                        }
 
@@ -2179,9 +2197,12 @@ void HUD_HealthArmor(void)
                                        barsize = eX * 0.5 * mySize_x * min(1, rightcnt/200) + eY * mySize_y;
                                }
 
-                               HUD_Panel_GetProgressBarColor(rightname)
-                               HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                               DrawNumIcon(autocvar_hud_panel_healtharmor_iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, HUD_Get_Num_Color(leftcnt, 200), 1);
+                               if(autocvar_hud_panel_healtharmor_progressbar)
+                               {
+                                       HUD_Panel_GetProgressBarColor(rightname)
+                                       HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               }
+                               DrawNumIcon(autocvar_hud_panel_healtharmor_iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, HUD_Get_Num_Color(rightcnt, 200), 1);
                        }
 
                        if(fuel)
@@ -2209,8 +2230,11 @@ void HUD_HealthArmor(void)
                                        barsize = eX * mySize_x * min(1, leftcnt/200) + eY * 0.5 * mySize_y;
                                }
 
-                               HUD_Panel_GetProgressBarColor(leftname)
-                               HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               if(autocvar_hud_panel_healtharmor_progressbar)
+                               {
+                                       HUD_Panel_GetProgressBarColor(leftname)
+                                       HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               }
                                DrawNumIcon(autocvar_hud_panel_healtharmor_iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, HUD_Get_Num_Color(leftcnt, 200), 1);
                        }
 
@@ -2224,9 +2248,12 @@ void HUD_HealthArmor(void)
                                        barsize = eX * mySize_x * min(1, rightcnt/200) + eY * 0.5 * mySize_y;
                                }
 
-                               HUD_Panel_GetProgressBarColor(rightname)
-                               HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                               DrawNumIcon(autocvar_hud_panel_healtharmor_iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, HUD_Get_Num_Color(leftcnt, 200), 1);
+                               if(autocvar_hud_panel_healtharmor_progressbar)
+                               {
+                                       HUD_Panel_GetProgressBarColor(rightname)
+                                       HUD_Panel_DrawProgressBar(barpos, 0, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               }
+                               DrawNumIcon(autocvar_hud_panel_healtharmor_iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, HUD_Get_Num_Color(rightcnt, 200), 1);
                        }
 
                        if(fuel)
@@ -2262,8 +2289,11 @@ void HUD_HealthArmor(void)
                                        numpos = pos + eY * 0.4 * mySize_x;
                                }
 
-                               HUD_Panel_GetProgressBarColor(leftname)
-                               HUD_Panel_DrawProgressBar(barpos, 1, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               if(autocvar_hud_panel_healtharmor_progressbar)
+                               {
+                                       HUD_Panel_GetProgressBarColor(leftname)
+                                       HUD_Panel_DrawProgressBar(barpos, 1, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               }
                                drawpic_aspect_skin(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', leftalpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                                drawstring_aspect(numpos, ftos(leftcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, HUD_Get_Num_Color(leftcnt, 200), panel_fg_alpha, DRAWFLAG_NORMAL);
                        }
@@ -2286,8 +2316,11 @@ void HUD_HealthArmor(void)
                                        numpos = pos + eY * mySize_y - eY * 0.25 * mySize_x + eX * 0.5 * mySize_x;
                                }
 
-                               HUD_Panel_GetProgressBarColor(rightname)
-                               HUD_Panel_DrawProgressBar(barpos, 1, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               if(autocvar_hud_panel_healtharmor_progressbar)
+                               {
+                                       HUD_Panel_GetProgressBarColor(rightname)
+                                       HUD_Panel_DrawProgressBar(barpos, 1, barsize, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               }
                                drawpic_aspect_skin(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', rightalpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                                drawstring_aspect(numpos, ftos(rightcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, HUD_Get_Num_Color(rightcnt, 200), panel_fg_alpha, DRAWFLAG_NORMAL);
                        }
@@ -2368,7 +2401,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg)
                if(WEP_VALID(w)) {
                        HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
                        if (alsoprint)
-                               print("^1", s1, "^1 ", Weapon_SuicideMessage(type), "\n");
+                               print("^1", sprintf(Weapon_SuicideMessage(type), strcat(s1, "^1")), "\n");
                } else if (type == DEATH_KILL) {
                        HUD_KillNotify_Push(s1, "", 0, DEATH_KILL);
                        if (alsoprint)
@@ -2408,9 +2441,9 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg)
        } else if(msg == MSG_KILL) {
                w = DEATH_WEAPONOF(type);
                if(WEP_VALID(w)) {
-                       HUD_KillNotify_Push(s2, s1, 1, w);
+                       HUD_KillNotify_Push(s1, s2, 1, type);
                        if (alsoprint)
-                               print("^1", s1, "^1 ", Weapon_KillMessage(type), "\n");
+                               print("^1", sprintf(Weapon_KillMessage(type), strcat(s2, "^1"), strcat(s1, "^1")), "\n"); // default order: victim, killer
                }
                else if(type == KILL_TEAM_RED || type == KILL_TEAM_BLUE || type == KILL_TEAM_SPREE) {
                        HUD_KillNotify_Push(s1, s2, 1, type);
@@ -2438,8 +2471,13 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg)
                else if(type == KILL_FIRST_BLOOD)
                        print("^1",s1, "^1 drew first blood", "\n");
                // TODO: icon!
-               else if (type == DEATH_TELEFRAG)
-                       print ("^1",s1, "^1 was telefragged by ", s2, "\n");
+               else if (type == DEATH_TELEFRAG) {
+                       HUD_KillNotify_Push(s2, s1, 1, DEATH_TELEFRAG);
+                       if(gentle)
+                               print ("^1",s1, "^1 tried to occupy ", s2, "^1's teleport destination space\n");
+                       else
+                               print ("^1",s1, "^1 was telefragged by ", s2, "\n");
+               }
                else if (type == DEATH_DROWN) {
                        HUD_KillNotify_Push(s2, s1, 1, DEATH_DROWN);
                        if(alsoprint)
@@ -2717,7 +2755,7 @@ void HUD_Centerprint(string s1, string s2, float type, float msg)
                                centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Don't shoot your team mates!"));
                } else if (type == DEATH_QUIET) {
                        // do nothing
-               } else if (type == DEATH_KILL) {
+               } else { // generic message
                        if(gentle)
                                centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You need to be more careful!"));
                        else
@@ -2760,7 +2798,7 @@ void HUD_Centerprint(string s1, string s2, float type, float msg)
                        } else {
                                centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You fragged ^7", s1, s2));
                        }
-               } else if (type == KILL_FRAGGED) {
+               } else { // generic message
                        if(gentle) {
                                centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were scored against by ^7", s1, s2));
                        } else {
@@ -2811,7 +2849,7 @@ void HUD_Notify (void)
        float width_attacker;
        string attacker, victim;
 
-       float i, j;
+       float i, j, w;
        for(j = 0; j < entries; ++j)
        {
                s = "";
@@ -2835,6 +2873,9 @@ void HUD_Notify (void)
                                a = 0;
                }
 
+               w = -1;
+               w = DEATH_WEAPONOF(killnotify_deathtype[j]);
+
                // TODO: maybe print in team colors?
                //
                // Y [used by] X
@@ -2965,9 +3006,17 @@ void HUD_Notify (void)
                        {
                                s = "weaponelectro";
                        }
-                       else if(WEP_VALID(killnotify_deathtype[j]))
+                       else if(killnotify_deathtype[j] & HITTYPE_SECONDARY && w == WEP_LASER)
                        {
-                               self = get_weaponinfo(killnotify_deathtype[j]);
+                               s = "notify_melee_laser";
+                       }
+                       else if(killnotify_deathtype[j] & HITTYPE_SECONDARY && w == WEP_SHOTGUN)
+                       {
+                               s = "notify_melee_shotgun";
+                       }
+                       else if(WEP_VALID(w))
+                       {
+                               self = get_weaponinfo(w);
                                s = strcat("weapon", self.netname);
                        }
                        else if(killnotify_deathtype[j] == KILL_TEAM_RED)
@@ -2978,6 +3027,10 @@ void HUD_Notify (void)
                        {
                                s = "notify_teamkill_red";
                        }
+                       else if(killnotify_deathtype[j] == DEATH_TELEFRAG)
+                       {
+                               s = "notify_telefrag";
+                       }
                        else if(killnotify_deathtype[j] == DEATH_DROWN)
                        {
                                s = "notify_water";
@@ -3192,7 +3245,7 @@ void HUD_Radar(void)
                mySize_y
        );
 
-       draw_teamradar_background(hud_panel_radar_background_alpha, hud_panel_radar_foreground_alpha);
+       draw_teamradar_background(hud_panel_radar_foreground_alpha);
 
        for(tm = world; (tm = find(tm, classname, "radarlink")); )
                draw_teamradar_link(tm.origin, tm.velocity, tm.team);
@@ -4185,11 +4238,22 @@ void HUD_Chat(void)
 
        active_panel = HUD_PANEL_CHAT;
        HUD_Panel_UpdateCvars(chat);
+
+       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;
+               if(panel_bg == "0")
+                       panel_bg = "border"; // force a border when maximized
+               panel_bg_alpha = max(0.75, panel_bg_alpha); // force an alpha of at least 0.75
+       }
+
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
 
        HUD_Panel_DrawBg(1);
+
        if(panel_bg_padding)
        {
                pos += '1 1 0' * panel_bg_padding;
@@ -4301,18 +4365,18 @@ void HUD_InfoMessages(void)
                mySize -= '2 2 0' * panel_bg_padding;
        }
 
-       // always force 6:1 aspect
+       // always force 5:1 aspect
        vector newSize;
-       if(mySize_x/mySize_y > 6)
+       if(mySize_x/mySize_y > 5)
        {
-               newSize_x = 6 * mySize_y;
+               newSize_x = 5 * mySize_y;
                newSize_y = mySize_y;
 
                pos_x = pos_x + (mySize_x - newSize_x) / 2;
        }
        else
        {
-               newSize_y = 1/6 * mySize_x;
+               newSize_y = 1/5 * mySize_x;
                newSize_x = mySize_x;
 
                pos_y = pos_y + (mySize_y - newSize_y) / 2;
@@ -4324,24 +4388,23 @@ void HUD_InfoMessages(void)
        o = pos;
 
        vector fontsize;
-       fontsize = '0.25 0.25 0' * mySize_y;
+       fontsize = '0.20 0.20 0' * mySize_y;
        
        string s;
        if(!autocvar__hud_configure)
        {
                if(spectatee_status && !intermission)
                {
-                       //drawfont = hud_bigfont;
                        if(spectatee_status == -1)
                                s = "^1Observing";
                        else
-                               s = GetPlayerName(spectatee_status - 1);
+                               s = strcat("^1Spectating: ^7", GetPlayerName(spectatee_status - 1));
 
-                       //s = textShortenToWidth(s, mySize_y, 0.5 * height, stringwidth_colors);
-                       //drawcolorcodedstring(pos + eY * 0.25 * height, s, 0.5 * height, panel_fg_alpha, DRAWFLAG_NORMAL);
-                       //drawfont = hud_font;
+                       if(autocvar_hud_panel_infomessages_flip)
+                               o_x = pos_x + mySize_x - stringwidth(s, TRUE, fontsize); 
+                       drawcolorcodedstring(o, s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+                       o += eY * fontsize_y;
 
-                       // spectator text in the upper right corner
                        if(spectatee_status == -1)
                                s = strcat("^1Press ^3", getcommandkey("primary fire", "+attack"), "^1 to spectate");
                        else
@@ -4545,11 +4608,11 @@ void HUD_ShowSpeed(void)
        pos = (vid_conheight - numsize_y) * cvar("cl_showspeed_position");
 
        drawfont = hud_bigfont;
-       drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', hud_fg_alpha, DRAWFLAG_NORMAL);
+       drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
 
        if (cvar("cl_showspeed_z") == 1) {
                zspeed = strcat(ftos(fabs(floor( pmove_vel_z * conversion_factor + 0.5 ))), unit);
-               drawstringcenter(eX + pos * eY + numsize_y * eY, zspeed, numsize * 0.5, '1 1 1', hud_fg_alpha, DRAWFLAG_NORMAL);
+               drawstringcenter(eX + pos * eY + numsize_y * eY, zspeed, numsize * 0.5, '1 1 1', autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
        }
 
        drawfont = hud_font;
@@ -4595,9 +4658,9 @@ void HUD_ShowAcceleration(void)
        }
 
        if (acceleration > 0)
-               HUD_Panel_DrawProgressBar(pos, 0, acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * hud_fg_alpha, DRAWFLAG_NORMAL);
+               HUD_Panel_DrawProgressBar(pos, 0, acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
        else if (acceleration < 0)
-               HUD_Panel_DrawProgressBar(pos + acceleration * scale * '40 0 0', 0, -acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * hud_fg_alpha, DRAWFLAG_NORMAL);
+               HUD_Panel_DrawProgressBar(pos + acceleration * scale * '40 0 0', 0, -acceleration * scale * '40 0 0' + sz * eY, rgb, alpha * autocvar_hud_panel_fg_alpha, DRAWFLAG_NORMAL);
 }
 
 void HUD_Reset (void)
@@ -4647,11 +4710,19 @@ void HUD_Main (void)
 {
        hud_skin_path = strcat("gfx/hud/", autocvar_hud_skin);
 
+       // global hud alpha fade
        if(disable_menu_alphacheck == 1)
-               menu_fade_alpha = 1;
+               hud_fade_alpha = 1;
        else
-               menu_fade_alpha = (1 - autocvar__menu_alpha);
-       hud_fg_alpha = cvar("hud_fg_alpha");
+               hud_fade_alpha = (1 - autocvar__menu_alpha);
+
+       if(scoreboard_fade_alpha)
+               hud_fade_alpha = (1 - scoreboard_fade_alpha);
+
+       if(intermission == 2) // no hud during mapvote
+               hud_fade_alpha = 0;
+       else if(autocvar__menu_alpha == 0 && scoreboard_fade_alpha == 0)
+               hud_fade_alpha = 1;
 
        hud_border_thickness = bound(0, cvar("hud_border_thickness"), 5);
        hud_accuracy_border_thickness = bound(0, cvar_or("hud_accuracy_border_thickness", 1), 5);
@@ -4705,7 +4776,7 @@ void HUD_Main (void)
                if(precache_pic(pic) == "") {
                        pic = "gfx/hud/default/dock";
                }
-               drawpic('0 0 0', pic, eX * vid_conwidth + eY * vid_conheight, color, autocvar_hud_dock_alpha * menu_fade_alpha, DRAWFLAG_NORMAL); // no aspect ratio forcing on dock...
+               drawpic('0 0 0', pic, eX * vid_conwidth + eY * vid_conheight, color, autocvar_hud_dock_alpha * hud_fade_alpha, DRAWFLAG_NORMAL); // no aspect ratio forcing on dock...
        }
 
        // cache the panel order into the panel_order array
@@ -4720,9 +4791,14 @@ void HUD_Main (void)
        }
        // draw panels in order specified by panel_order array
        for(i = HUD_PANEL_NUM - 1; i >= 0; --i) {
-               HUD_DrawPanel(panel_order[i]);
+               if(i != HUD_PANEL_CHAT || !autocvar__con_chat_maximized) // don't draw maximized chat panel twice!
+                       HUD_DrawPanel(panel_order[i]);
        }
 
+       // draw chat panel on top if it is maximized
+       if(autocvar__con_chat_maximized)
+               HUD_DrawPanel(HUD_PANEL_CHAT);
+
        // TODO hud_'ify these
        if (cvar("cl_showspeed"))
                HUD_ShowSpeed();