]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud.qc
fade vote dialog in/out when needed/not needed
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud.qc
index 4e7628f3fdaf8da08018ac1eeadcff9c11b55ed3..f04bcc4e650865f9b7889b908e4c7a2b47034615 100644 (file)
@@ -565,6 +565,7 @@ string HUD_Panel_GetName(float id)
                case 9: return "vote"; break;
                case 10: return "modicons"; break;
                case 11: return "pressedkeys"; break;
+               case 12: return "chat"; break;
                default: return "";
        }
 }
@@ -579,6 +580,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                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"));
@@ -587,6 +589,7 @@ void HUD_Panel_ExportCfg(string cfgname)
 
                fputs(fh, strcat("seta hud_dock \"", cvar_string("hud_dock"), "\"", "\n"));
                fputs(fh, strcat("seta hud_dock_color \"", cvar_string("hud_dock_color"), "\"", "\n"));
+               fputs(fh, strcat("seta hud_dock_color_team \"", cvar_string("hud_dock_color_team"), "\"", "\n"));
                fputs(fh, strcat("seta hud_dock_alpha \"", ftos(cvar("hud_dock_alpha")), "\"", "\n"));
                fputs(fh, "\n");
 
@@ -608,6 +611,7 @@ void HUD_Panel_ExportCfg(string cfgname)
                        fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_size \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_size")), "\"", "\n"));
                        fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg")), "\"", "\n"));
                        fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_color \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_color")), "\"", "\n"));
+                       fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_color_team \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_color_team")), "\"", "\n"));
                        fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_alpha \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_alpha")), "\"", "\n"));
                        fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_border \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_border")), "\"", "\n"));
                        fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_bg_padding \"", cvar_string(strcat("hud_", HUD_Panel_GetName(i), "_bg_padding")), "\"", "\n"));
@@ -627,6 +631,9 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_flip ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_flip"))), "\n"));
                                        fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_mirror ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_mirror"))), "\n"));
                                        break;
+                               case 4:
+                                       fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_flip ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_flip"))), "\n"));
+                                       break;
                                case 9:
                                        fputs(fh, strcat("seta hud_", HUD_Panel_GetName(i), "_alreadyvoted_alpha ", ftos(cvar(strcat("hud_", HUD_Panel_GetName(i), "_alreadyvoted_alpha"))), "\n"));
                                        break;
@@ -658,6 +665,10 @@ vector HUD_Panel_GetMinSize(float id)
                        if(cvar("hud_healtharmor") == 2)
                                mySize_y = 0.23; // 0.23 * width, trial and error...
                        break;
+               case 4: 
+                       mySize_x = 0.8; // 8/10 * height, as panel cant support more than 10 entries...
+                       mySize_y = 1/8; // 1/8 * width
+                       break;
                case 5: 
                        mySize_y = 1/4.1; // 1/4.1 * width, trial and error...
                        break;
@@ -730,12 +741,24 @@ vector HUD_Panel_GetColor(float id)
        float f;
        vector color_vec;
        string color;
-       color = cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_color"));
+
+       // fetch per-panel color
+       if(teamplay && cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_color_team")) != "") {
+               f = stof(getplayerkey(self.sv_entnum, "colors"));
+               color = vtos(colormapPaletteColor(mod(f, 16), 1) * cvar(strcat("hud_", HUD_Panel_GetName(id), "_bg_color_team")));
+       }
+       else
+               color = cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_color"));
        color_vec = stov(color);
-       if(color == "") {
+
+       if(color == "") { // fetch default color
                color = cvar_string("hud_bg_color");
                color_vec = stov(color);
-               if(color == "shirt") {
+               if(teamplay && cvar(strcat("hud_bg_color_team"))) {
+                       f = stof(getplayerkey(self.sv_entnum, "colors"));
+                       color_vec = colormapPaletteColor(mod(f, 16), 1) * cvar("hud_bg_color_team");
+               }
+               else if(color == "shirt") {
                        f = stof(getplayerkey(self.sv_entnum, "colors"));
                        color_vec = colormapPaletteColor(floor(f / 16), 0);
                }
@@ -762,7 +785,11 @@ vector HUD_Panel_Dock_GetColor(void)
        string color;
        color = cvar_string("hud_dock_color");
        color_vec = stov(color);
-       if(color == "shirt") {
+       if(teamplay && cvar(strcat("hud_dock_color_team"))) {
+               f = stof(getplayerkey(self.sv_entnum, "colors"));
+               color_vec = colormapPaletteColor(mod(f, 16), 1) * cvar("hud_dock_color_team");
+       }
+       else if(color == "shirt") {
                f = stof(getplayerkey(self.sv_entnum, "colors"));
                color_vec = colormapPaletteColor(floor(f / 16), 0);
        }
@@ -788,14 +815,17 @@ float HUD_Panel_GetPadding(float id)
        padding = cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg_padding"));
        if(padding == "")
                padding = cvar_string("hud_bg_padding");
-       return stof(padding);
+
+       vector mySize;
+       mySize = HUD_Panel_GetSize(id);
+       float smallestsize;
+       smallestsize = min(mySize_x, mySize_y);
+       return min(smallestsize/2, stof(padding));
 }
 
 // draw the background/borders
-void HUD_Panel_DrawBg(float id, vector pos, vector mySize)
+void HUD_Panel_DrawBg(float id, vector pos, vector mySize, float alpha)
 {
-       float alpha;
-
        if(!hud_configure && cvar_string(strcat("hud_", HUD_Panel_GetName(id), "_bg")) == "0")
                return;
 
@@ -806,7 +836,6 @@ void HUD_Panel_DrawBg(float id, vector pos, vector mySize)
 
        if(bg == "0" && hud_configure) {
                bg = "border"; // we probably want to see a background in config mode at all times...
-               alpha = cvar("hud_configure_bg_minalpha");
        }
 
        if(bg != "0")
@@ -820,6 +849,9 @@ void HUD_Panel_DrawBg(float id, vector pos, vector mySize)
                if(!alpha)
                        alpha = HUD_Panel_GetAlpha(id);
 
+               if(hud_configure)
+                       alpha = max(cvar("hud_configure_bg_minalpha"), alpha);
+
                draw_BorderPicture(pos - '1 1 0' * border, strcat("gfx/hud/", cvar_string("hud_skin"), "/", bg), mySize + '1 1 0' * 2 * border, color, alpha, '1 1 0' * (border/BORDER_MULTIPLIER));
        }
 }
@@ -1050,6 +1082,12 @@ void HUD_Panel_SetPosSize(float id, vector resizeorigin)
        mySize_x = max(0.025 * vid_conwidth, mySize_x);
        mySize_y = max(0.025 * vid_conheight, mySize_y);
 
+       if(id == 12) // some panels have their own restrictions, like the chat panel (which actually only moves the engine chat print around). Looks bad if it's too small.
+       {
+               mySize_x = max(15 * cvar("con_chatsize"), mySize_x);
+               mySize_y = max(2 * cvar("con_chatsize") + 2 * HUD_Panel_GetPadding(id), mySize_y);
+       }
+
        // cap against panel's own limits
        vector minSize;
        minSize = HUD_Panel_GetMinSize(id); // mySize_x at least minSize_x * mySize_y, and vice versa
@@ -1288,7 +1326,7 @@ void HUD_WeaponIcons()
        }
        heapsort(weapon_cnt, weaponorder_swap, weaponorder_cmp, world);
 
-       HUD_Panel_DrawBg(id, pos, mySize);
+       HUD_Panel_DrawBg(id, pos, mySize, 0);
        float padding;
        padding = HUD_Panel_GetPadding(id);
        if(padding)
@@ -1418,7 +1456,7 @@ void HUD_Inventory()
        pos = HUD_Panel_GetPos(id);
        mySize = HUD_Panel_GetSize(id);
 
-       HUD_Panel_DrawBg(id, pos, mySize);
+       HUD_Panel_DrawBg(id, pos, mySize, 0);
        float padding;
        padding = HUD_Panel_GetPadding(id);
        if(padding)
@@ -1515,7 +1553,7 @@ void HUD_Powerups() {
        pos = HUD_Panel_GetPos(id);
        mySize = HUD_Panel_GetSize(id);
 
-       HUD_Panel_DrawBg(id, pos, mySize);
+       HUD_Panel_DrawBg(id, pos, mySize, 0);
        float padding;
        padding = HUD_Panel_GetPadding(id);
        if(padding)
@@ -1726,7 +1764,7 @@ void HUD_HealthArmor(void)
        pos = HUD_Panel_GetPos(id);
        mySize = HUD_Panel_GetSize(id);
 
-       HUD_Panel_DrawBg(id, pos, mySize);
+       HUD_Panel_DrawBg(id, pos, mySize, 0);
        float padding;
        padding = HUD_Panel_GetPadding(id);
        if(padding)
@@ -1979,6 +2017,377 @@ void HUD_HealthArmor(void)
 // ___TODO___ !!!
 // Notification area (#4)
 //
+
+string Weapon_SuicideMessage(float deathtype)
+{
+       w_deathtype = deathtype;
+       get_weaponinfo(DEATH_WEAPONOF(deathtype)).weapon_func(WR_SUICIDEMESSAGE);
+       return w_deathtypestring;
+}
+
+string Weapon_KillMessage(float deathtype)
+{
+       w_deathtype = deathtype;
+       get_weaponinfo(DEATH_WEAPONOF(deathtype)).weapon_func(WR_KILLMESSAGE);
+       return w_deathtypestring;
+}
+
+float killnotify_times[10];
+float killnotify_deathtype[10];
+string killnotify_attackers[10];
+string killnotify_victims[10];
+void HUD_KillNotify_Push(string attacker, string victim, float wpn)
+{
+       float i;
+       for (i = 9; i > 0; --i) {
+               killnotify_times[i] = killnotify_times[i-1];
+               killnotify_deathtype[i] = killnotify_deathtype[i-1];
+               if(killnotify_attackers[i])
+                       strunzone(killnotify_attackers[i]);
+               killnotify_attackers[i] = strzone(killnotify_attackers[i-1]);
+               if(killnotify_victims[i])
+                       strunzone(killnotify_victims[i]);
+               killnotify_victims[i] = strzone(killnotify_victims[i-1]);
+       }
+       killnotify_times[0] = time;
+       killnotify_deathtype[0] = wpn;
+       if(killnotify_attackers[0])
+               strunzone(killnotify_attackers[0]);
+       killnotify_attackers[0] = strzone(attacker);
+       if(killnotify_victims[0])
+               strunzone(killnotify_victims[0]);
+       killnotify_victims[0] = strzone(victim);
+}
+
+void HUD_KillNotify(string s1, string s2, string s3, float type, float msg)
+{
+       float w;
+       if(msg == MSG_SUICIDE) {
+               HUD_KillNotify_Push(s1, "", DEATH_KILL);
+
+               // TODO: cl_gentle
+               w = DEATH_WEAPONOF(type);
+               if(WEP_VALID(w)) {
+                       if (!HUD_Panel_CheckActive(4) || cvar("hud_notify_print"))
+                               print("^1", s1, "^1 ", Weapon_SuicideMessage(type), "\n");
+               }
+               else if (type == DEATH_KILL)
+                       print ("^1",s1, "^1 couldn't take it anymore\n");
+               else if (type == DEATH_ROT)
+                       print ("^1",s1, "^1 died\n");
+               else if (type == DEATH_NOAMMO)
+                       print ("^7",s1, "^7 committed suicide. What's the point of living without ammo?\n");
+               else if (type == DEATH_CAMP)
+                       print ("^1",s1, "^1 thought they found a nice camping ground\n");
+               else if (type == DEATH_MIRRORDAMAGE)
+                       print ("^1",s1, "^1 didn't become friends with the Lord of Teamplay\n");
+               else if (type == DEATH_CHEAT)
+                       print ("^1",s1, "^1 unfairly eliminated themself\n");
+               else if (type == DEATH_FIRE)
+                       print ("^1",s1, "^1 burned to death\n");
+               else if (type != DEATH_TEAMCHANGE && type != DEATH_QUIET)
+                       print ("^1",s1, "^1 couldn't resist the urge to self-destruct\n");
+               if (stof(s2) > 2) // killcount > 2
+                       print ("^1",s1,"^1 ended it all after a ",s2," kill spree\n");
+       } else if(msg == MSG_KILL) {
+               w = DEATH_WEAPONOF(type);
+               if(WEP_VALID(w)) {
+                       HUD_KillNotify_Push(s2, s1, w);
+                       if (!HUD_Panel_CheckActive(4) || cvar("hud_notify_print"))
+                               print("^1", s1, "^1 ", Weapon_KillMessage(type), "\n");
+               }
+               else if(type == KILL_TEAM || type == KILL_TEAM_SPREE) {
+                               if(cvar("cl_gentle")) {
+                                       print ("^1", s1, "^1 took action against a team mate\n");
+                               } else {
+                                       print ("^1", s1, "^1 mows down a team mate\n");
+                               }
+                               if (stof(s2) > 2 && type == KILL_TEAM_SPREE) {
+                                       if(cvar("cl_gentle"))
+                                               print ("^1",s1,"^1 ended a ",s2," scoring spree by going against a team mate\n");
+                                       else
+                                               print ("^1",s1,"^1 ended a ",s2," kill spree by killing a team mate\n");
+                               }
+                               else if (stof(s2) > 2) {
+                                       if(cvar("cl_gentle"))
+                                               print ("^1",s1,"'s ^1",s2," scoring spree was ended by a team mate!\n");
+                                       else
+                                               print ("^1",s1,"'s ^1",s2," kill spree was ended by a team mate!\n");
+                               }
+               }
+               else if(type == KILL_FIRST_BLOOD)
+                       print("^1",s1, "^1 drew first blood", "\n");
+               else if (type == DEATH_TELEFRAG)
+                       print ("^1",s1, "^1 was telefragged by ", s2, "\n");
+               else if (type == DEATH_DROWN) {
+                       HUD_KillNotify_Push(s2, s1, DEATH_FALL);
+                       print ("^1",s1, "^1 was drowned by ", s2, "\n");
+               }
+               else if (type == DEATH_SLIME) {
+                       HUD_KillNotify_Push(s2, s1, DEATH_FALL);
+                       print ("^1",s1, "^1 was slimed by ", s2, "\n");
+               }
+               else if (type == DEATH_LAVA) {
+                       HUD_KillNotify_Push(s2, s1, DEATH_FALL);
+                       print ("^1",s1, "^1 was cooked by ", s2, "\n");
+               }
+               else if (type == DEATH_FALL) {
+                       HUD_KillNotify_Push(s2, s1, DEATH_FALL);
+                       print ("^1",s1, "^1 was grounded by ", s2, "\n");
+               }
+               else if (type == DEATH_SHOOTING_STAR) {
+                       HUD_KillNotify_Push(s2, s1, DEATH_FALL);
+                       print ("^1",s1, "^1 was shot into space by ", s2, "\n");
+               }
+               else if (type == DEATH_SWAMP) {
+                       HUD_KillNotify_Push(s2, s1, DEATH_FALL);
+                       print ("^1",s1, "^1 was conserved by ", s2, "\n");
+               }
+               else if (type == DEATH_HURTTRIGGER && s3 != "")
+               {
+                       HUD_KillNotify_Push(s2, s1, DEATH_FALL);
+                       // p ?!?! :o
+                       //if(p < 0)
+                               print("^1", s1, "^1 ", s3, " ", s2, "\n");
+                       //else
+                       //      bprint("^1", s1, "^1 ", substring(s3, 0, p), s2, "^1", substring(s3, p+1, strlen(s3) - (p+1)), "\n");
+               }
+               else if(type == DEATH_SBCRUSH)
+                       print ("^1",s1, "^1 was crushed by ^1", s2, "\n");
+               else if(type == DEATH_SBMINIGUN)
+                       print ("^1",s1, "^1 got shredded by ^1", s2, "\n");
+               else if(type == DEATH_SBROCKET)
+                       print ("^1",s1, "^1 was blased to bits by ^1", s2, "\n");
+               else if(type == DEATH_SBBLOWUP)
+                       print ("^1",s1, "^1 got cought in the destruction of ^1", s2, "'s vehicle\n");
+
+               else if(type == DEATH_WAKIGUN)
+                       print ("^1",s1, "^1 was bolted down by ^1", s2, "\n");
+               else if(type == DEATH_WAKIROCKET)
+                       print ("^1",s1, "^1 could find no shelter from ^1", s2, "'s rockets\n");
+               else if(type == DEATH_WAKIBLOWUP)
+                       print ("^1",s1, "^1 dies when ^1", s2, "'s wakizashi dies.\n");
+
+               else if(type == DEATH_TURRET)
+                       print ("^1",s1, "^1 was pushed into the line of fire by ^1", s2, "\n");
+               else if(type == DEATH_TOUCHEXPLODE)
+                       print ("^1",s1, "^1 was pushed into an accident by ^1", s2, "\n");
+               else if(type == DEATH_CHEAT)
+                       print ("^1",s1, "^1 was unfairly eliminated by ^1", s2, "\n");
+               else if (type == DEATH_FIRE)
+                       print ("^1",s1, "^1 was burnt to death by ^1", s2, "\n");
+               else if (type == DEATH_CUSTOM)
+                       print ("^1",s1, "^1 ", s2, "\n");
+               else
+                       print ("^1",s1, "^1 was fragged by ", s2, "\n");
+       } else if(msg == MSG_SPREE) {
+               if(type == KILL_END_SPREE) {
+                       if(cvar("cl_gentle"))
+                               print ("^1",s1,"'s ^1", s2, " scoring spree was ended by ", s3, "\n");
+                       else
+                               print ("^1",s1,"'s ^1", s2, " kill spree was ended by ", s3, "\n");
+               } else if(type == KILL_SPREE) {
+                       if(cvar("cl_gentle"))
+                               print ("^1",s1,"^1 made ",s2," scores in a row\n");
+                       else
+                               print ("^1",s1,"^1 has ",s2," frags in a row\n");
+               } else if(type == KILL_SPREE_3) {
+                       if(cvar("cl_gentle"))
+                               print (s1,"^7 made a ^1TRIPLE SCORE\n");
+                       else
+                               print (s1,"^7 made a ^1TRIPLE FRAG\n");
+               } else if(type == KILL_SPREE_5) {
+                       if(cvar("cl_gentle"))
+                               print (s1,"^7 unleashes ^1SCORING RAGE\n");
+                       else
+                               print (s1,"^7 unleashes ^1RAGE\n");
+               } else if(type == KILL_SPREE_10) {
+                       if(cvar("cl_gentle"))
+                               print (s1,"^7 made ^1TEN SCORES IN A ROW!\n");
+                       else
+                               print (s1,"^7 starts the ^1MASSACRE!\n");
+               } else if(type == KILL_SPREE_15) {
+                       if(cvar("cl_gentle"))
+                               print (s1,"^7 made ^1FIFTEEN SCORES IN A ROW!\n");
+                       else
+                               print (s1,"^7 executes ^1MAYHEM!\n");
+               } else if(type == KILL_SPREE_20) {
+                       if(cvar("cl_gentle"))
+                               print (s1,"^7 made ^1TWENTY SCORES IN A ROW!\n");
+                       else
+                               print (s1,"^7 is a ^1BERSERKER!\n");
+               } else if(type == KILL_SPREE_25) {
+                       if(cvar("cl_gentle"))
+                               print (s1,"^7 made ^1TWENTY FIFE SCORES IN A ROW!\n");
+                       else
+                               print (s1,"^7 inflicts ^1CARNAGE!\n");
+               } else if(type == KILL_SPREE_30) {
+                       if(cvar("cl_gentle"))
+                               print (s1,"^7 made ^1THIRTY SCORES IN A ROW!\n");
+                       else
+                               print (s1,"^7 unleashes ^1ARMAGEDDON!\n");
+               }
+       } else if(msg == MSG_KILL_ACTION) { // wtf is this? isnt it basically the same as MSG_SUICIDE?
+               HUD_KillNotify_Push(s1, "", DEATH_KILL);
+               if (type == DEATH_DROWN) {
+                       if(cvar("cl_gentle"))
+                               print ("^1",s1, "^1 was in the water for too long\n");
+                       else
+                               print ("^1",s1, "^1 drowned\n");
+               }
+               else if (type == DEATH_SLIME)
+                       print ("^1",s1, "^1 was slimed\n");
+               else if (type == DEATH_LAVA) {
+                       if(cvar("cl_gentle"))
+                               print ("^1",s1, "^1 found a hot place\n");
+                       else
+                               print ("^1",s1, "^1 turned into hot slag\n");
+               }
+               else if (type == DEATH_FALL) {
+                       if(cvar("cl_gentle"))
+                               print ("^1",s1, "^1 tested gravity (and it worked)\n");
+                       else
+                               print ("^1",s1, "^1 hit the ground with a crunch\n");
+               }
+               else if (type == DEATH_SHOOTING_STAR)
+                       print ("^1",s1, "^1 became a shooting star\n");
+               else if (type == DEATH_SWAMP) {
+                       if(cvar("cl_gentle"))
+                               print ("^1",s1, "^1 discovered a swamp\n");
+                       else
+                               print ("^1",s1, "^1 is now conserved for centuries to come\n");
+               }
+               else if(type == DEATH_TURRET)
+                       print ("^1",s1, "^1 was mowed down by a turret \n");
+               else if (type == DEATH_CUSTOM)
+                       print ("^1",s1, "^1 ", s2, "\n");
+               else if(type == DEATH_TOUCHEXPLODE)
+                       print ("^1",s1, "^1 died in an accident\n");
+               else if(type == DEATH_CHEAT)
+                       print ("^1",s1, "^1 was unfairly eliminated\n");
+               else if(type == DEATH_FIRE) {
+                       if(cvar("cl_gentle"))
+                               print ("^1",s1, "^1 felt a little hot\n");
+                       else
+                               print ("^1",s1, "^1 burnt to death\n");
+               }
+               else {
+                       if(cvar("cl_gentle"))
+                               print ("^1",s1, "^1 needs a restart\n");
+                       else
+                               print ("^1",s1, "^1 died\n");
+               }
+       } else if(msg == MSG_KILL_ACTION_SPREE) {
+               HUD_KillNotify_Push(s1, "", DEATH_KILL);
+               if(cvar("cl_gentle"))
+                       print ("^1",s1,"^1 needs a restart after a ",s2," scoring spree\n");
+               else
+                       print ("^1",s1,"^1 died with a ",s2," kill spree\n");
+       } else if(msg == MSG_INFO) {
+               if(type == INFO_GOTFLAG) {
+                       HUD_KillNotify_Push(s1, s2, INFO_GOTFLAG);
+                       print(s1, "^7 got the ", s2, "\n");
+               } else if(type == INFO_LOSTFLAG) {
+                       HUD_KillNotify_Push(s1, s2, INFO_LOSTFLAG);
+                       print(s1, "^7 lost the ", s2, "\n");
+               } else if(type == INFO_PICKUPFLAG) {
+                       HUD_KillNotify_Push(s1, s2, INFO_GOTFLAG);
+                       print(s1, "^7 picked up the ", s2, "\n");
+               } else if(type == INFO_RETURNFLAG) {
+                       HUD_KillNotify_Push(s1, s2, INFO_RETURNFLAG);
+                       print(s1, "^7 returned the ", s2, "\n");
+               }
+       }
+
+}
+
+#define DAMAGE_CENTERPRINT_SPACER NEWLINES
+
+void HUD_Centerprint(string s1, float type, float msg)
+{
+       if(msg == MSG_SUICIDE) {
+               if (type == DEATH_TEAMCHANGE) {
+                       centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "You are now on: ", s1));
+               } else if (type == DEATH_AUTOTEAMCHANGE) {
+                       centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "You have been moved into a different team to improve team balance\nYou are now on: ", s1));
+               } else if (type == DEATH_CAMP) {
+                       if(cvar("cl_gentle"))
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Reconsider your tactics, camper!"));
+                       else
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Die camper!"));
+               } else if (type == DEATH_NOAMMO) {
+                       if(cvar("cl_gentle"))
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^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..."));
+               } else if (type == DEATH_ROT) {
+                       if(cvar("cl_gentle"))
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You need to preserve your health"));
+                       else
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You grew too old without taking your medicine"));
+               } else if (type == DEATH_MIRRORDAMAGE) {
+                       if(cvar("cl_gentle"))
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Don't go against team mates!"));
+                       else
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Don't shoot your team mates!"));
+               } else if (type == DEATH_QUIET) {
+                       // do nothing
+               } else if (type == DEATH_KILL) {
+                       if(cvar("cl_gentle"))
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You need to be more careful!"));
+                       else
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You killed your own dumb self!"));
+               }
+       } else if(msg == MSG_KILL) {
+               if (type == KILL_TEAM) {
+                       if(cvar("cl_gentle")) {
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Moron! You went against a team mate!"));
+                       } else {
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Moron! You fragged ", s1, ", a team mate!"));
+                       }
+               } else if (type == KILL_FIRST_BLOOD) {
+                       if(cvar("cl_gentle")) {
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First score"));
+                       } else {
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First blood"));
+                       }
+               } else if (type == KILL_FIRST_VICTIM) {
+                       if(cvar("cl_gentle")) {
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First casualty"));
+                       } else {
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1First victim"));
+                       }
+               } else if (type == KILL_TYPEFRAG) {
+                       if(cvar("cl_gentle")) {
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You scored against ^7", s1, "^7 who was typing!"));
+                       } else {
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You typefragged ^7", s1));
+                       }
+               } else if (type == KILL_TYPEFRAGGED) {
+                       if(cvar("cl_gentle")) {
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were scored against by ^7", s1, "^7 while you were typing!"));
+                       } else {
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1You were typefragged by ^7", s1));
+                       }
+               } else if (type == KILL_FRAG) {
+                       if(cvar("cl_gentle")) {
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You scored against ^7", s1));
+                       } else {
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You fragged ^7", s1));
+                       }
+               } else if (type == KILL_FRAGGED) {
+                       if(cvar("cl_gentle")) {
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You were scored against by ^7", s1));
+                       } else {
+                               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^4You were fragged by ^7", s1));
+                       }
+               }
+       } else if(msg == MSG_KILL_ACTION) {
+               // TODO: invent more centerprints here?
+               centerprint(strcat(DAMAGE_CENTERPRINT_SPACER, "^1Watch your step!", s1));
+       }
+}
+
 void HUD_Notify (void)
 {
        float id = 4;
@@ -1986,7 +2395,7 @@ void HUD_Notify (void)
        pos = HUD_Panel_GetPos(id);
        mySize = HUD_Panel_GetSize(id);
 
-       HUD_Panel_DrawBg(id, pos, mySize);
+       HUD_Panel_DrawBg(id, pos, mySize, 0);
        float padding;
        padding = HUD_Panel_GetPadding(id);
        if(padding)
@@ -1995,6 +2404,94 @@ void HUD_Notify (void)
                mySize -= '2 2 0' * padding;
        }
 
+       float entries, height;
+       entries = bound(1, floor(8 * mySize_y/mySize_x), 10);
+       height = mySize_y/entries;
+       
+       vector fontsize;
+       fontsize = '0.33 0.33 0' * height;
+
+       float a;
+       float when;
+       when = cvar("hud_notify_time");
+       float fadetime;
+       fadetime = cvar("hud_notify_fadetime");
+
+       string s;
+
+       float i, j;
+       for(j = 0; j < entries; ++j)
+       {
+               if(cvar("hud_notify_flip"))
+                       i = j;
+               else // rather nasty hack for ordering items from the bottom up
+                       i = entries - j - 1;
+
+               if(fadetime)
+               {
+                       if(killnotify_times[j] + when > time)
+                               a = 1;
+                       else
+                               a = bound(0, (killnotify_times[j] + when + fadetime - time) / fadetime, 1);
+               }
+               else
+               {
+                       if(killnotify_times[j] + when > time)
+                               a = 1;
+                       else
+                               a = 0;
+               }
+
+               // X [did action to] Y
+               if(WEP_VALID(killnotify_deathtype[j]))
+               {
+                       self = get_weaponinfo(killnotify_deathtype[j]);
+                       drawpic_skin(pos + eX * 0.5 * mySize_x - eX * 0.5 * height + eY * 0.25 * height + eY * i * height, strcat("weapon", self.netname), '1 0.5 0' * height, '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);
+                       drawcolorcodedstring(pos + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[j], 0.5 * mySize_x - 0.5 * height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL);
+                       drawcolorcodedstring(pos + eY * 0.33 * height + eX * 0.5 * mySize_x + eX * 0.5 * height + eY * i * height, textShortenToWidth(killnotify_victims[j], 0.5 * mySize_x - 0.5 * height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL);
+               }
+               else if(killnotify_deathtype[j] == DEATH_FALL)
+               {
+                       drawpic_skin(pos + eX * 0.5 * mySize_x - eX * 0.5 * height + eY * 0.25 * height + eY * i * height, "notify_pushoffedge", '1 0.5 0' * height, '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);       
+                       drawcolorcodedstring(pos + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[j], 0.5 * mySize_x - 0.5 * height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL);
+                       drawcolorcodedstring(pos + eY * 0.33 * height + eX * 0.5 * mySize_x + eX * 0.5 * height + eY * i * height, textShortenToWidth(killnotify_victims[j], 0.5 * mySize_x - 0.5 * height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL);
+               }
+
+               // Y [used by] X
+               else if(killnotify_deathtype[j] == DEATH_KILL)
+               {
+                       drawpic_skin(pos + eY * 0.25 * height + eY * i * height, "notify_selfkill", '1 0.5 0' * height, '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);    
+                       drawcolorcodedstring(pos + eX * height + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[j], mySize_x - height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL);
+               }
+               else if(killnotify_deathtype[j] == INFO_GOTFLAG)
+               {
+                       if(killnotify_victims[j] == "^1RED^7 flag")
+                               s = "red";
+                       else
+                               s = "blue";
+                       drawpic_skin(pos + eY * i * height, strcat("flag_", s, "_carrying"), '1 1 0' * height, '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);     
+                       drawcolorcodedstring(pos + eX * height + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[j], mySize_x - height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL);
+               }
+               else if(killnotify_deathtype[j] == INFO_RETURNFLAG)
+               {
+                       if(killnotify_victims[j] == "^1RED^7 flag")
+                               s = "red";
+                       else
+                               s = "blue";
+                       drawpic_skin(pos + eY * i * height, strcat("flag_", s, "_taken"), '1 1 0' * height, '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL);        
+                       drawcolorcodedstring(pos + eX * height + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[j], mySize_x - height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL);
+               }
+               else if(killnotify_deathtype[j] == INFO_LOSTFLAG)
+               {
+                       if(killnotify_victims[j] == "^1RED^7 flag")
+                               s = "red";
+                       else
+                               s = "blue";
+                       drawpic_skin(pos + eY * i * height, strcat("flag_", s, "_lost"), '1 1 0' * height, '1 1 1', hud_alpha_fg * a, DRAWFLAG_NORMAL); 
+                       drawcolorcodedstring(pos + eX * height + eY * 0.33 * height + eY * i * height, textShortenToWidth(killnotify_attackers[j], mySize_x - height, fontsize, stringwidth_colors), fontsize, hud_alpha_fg * a, DRAWFLAG_NORMAL);
+               }
+       }
+       /* This will come later.
        string s;
        entity tm;
        if(spectatee_status && !intermission)
@@ -2110,6 +2607,7 @@ void HUD_Notify (void)
                        }
                }
        }
+       */
 }
 
 // Timer (#5)
@@ -2121,7 +2619,7 @@ void HUD_Timer()
        pos = HUD_Panel_GetPos(id);
        mySize = HUD_Panel_GetSize(id);
 
-       HUD_Panel_DrawBg(id, pos, mySize);
+       HUD_Panel_DrawBg(id, pos, mySize, 0);
        float padding;
        padding = HUD_Panel_GetPadding(id);
        if(padding)
@@ -2180,7 +2678,7 @@ void HUD_Radar(void)
        pos = HUD_Panel_GetPos(id);
        mySize = HUD_Panel_GetSize(id);
 
-       HUD_Panel_DrawBg(id, pos, mySize);
+       HUD_Panel_DrawBg(id, pos, mySize, 0);
        float padding;
        padding = HUD_Panel_GetPadding(id);
        if(padding)
@@ -2306,7 +2804,7 @@ void HUD_Score()
        pos = HUD_Panel_GetPos(id);
        mySize = HUD_Panel_GetSize(id);
 
-       HUD_Panel_DrawBg(id, pos, mySize);
+       HUD_Panel_DrawBg(id, pos, mySize, 0);
        float padding;
        padding = HUD_Panel_GetPadding(id);
        if(padding)
@@ -2454,7 +2952,7 @@ void HUD_RaceTimer (void) {
        pos = HUD_Panel_GetPos(id);
        mySize = HUD_Panel_GetSize(id);
 
-       HUD_Panel_DrawBg(id, pos, mySize);
+       HUD_Panel_DrawBg(id, pos, mySize, 0);
        float padding;
        padding = HUD_Panel_GetPadding(id);
        if(padding)
@@ -2601,23 +3099,27 @@ void HUD_VoteWindow(void)
        float a;
        if(vote_active != vote_prev) {
                vote_change = time;
-               vote_prev = bound(0, vote_active, 1);
+               vote_prev = vote_active;
        }
 
-       if(vote_active)
+       if(vote_active || hud_configure)
                vote_alpha = bound(0, (time - vote_change) * 2, 1);
        else
                vote_alpha = bound(0, 1 - (time - vote_change) * 2, 1);
 
        if(hud_configure)
        {
-               vote_alpha = 1;
                vote_yescount = 3;
                vote_nocount = 2;
                vote_needed = 4;
        }
 
-       HUD_Panel_DrawBg(id, pos, mySize);
+       if(!vote_alpha)
+               return;
+
+       a = vote_alpha * bound(cvar_or("hud_vote_alreadyvoted_alpha", 0.75), 1 - vote_highlighted, 1);
+
+       HUD_Panel_DrawBg(id, pos, mySize, a * hud_alpha_bg);
        float padding;
        padding = HUD_Panel_GetPadding(id);
        if(padding)
@@ -2626,44 +3128,41 @@ void HUD_VoteWindow(void)
                mySize -= '2 2 0' * padding;
        }
 
-       if(vote_alpha) {
-               a = vote_alpha * bound(cvar_or("hud_vote_alreadyvoted_alpha", 0.75), 1 - vote_highlighted, 1);
+       drawpic_skin(pos, "voteprogress_back", mySize, '1 1 1', a * hud_alpha_bg, DRAWFLAG_NORMAL);
 
-               drawpic_skin(pos, "voteprogress_back", mySize, HUD_Panel_GetColor(id), a * hud_alpha_bg, DRAWFLAG_NORMAL);
+       s = "A vote has been called for: ";
+       drawstring(pos + '0.5 0 0' * mySize_x + '0 0.1 0' * mySize_y - eX * stringwidth(s, FALSE, '1 1 0' * 0.5 * mySize_y*(1/5)), s, '1 1 0' * mySize_y*(1/5), '1 1 1', a * hud_alpha_fg, DRAWFLAG_NORMAL);
+       s = textShortenToWidth(vote_called_vote, mySize_x * 0.96, '1 1 0' * mySize_y*(1/5), stringwidth_colors); // TODO: broken?
+       if(hud_configure)
+               s = "Configure the HUD";
+       drawcolorcodedstring(pos + '0.52 0 0' * mySize_x + '0 0.3 0' * mySize_y - eX * stringwidth(s, FALSE, '1 1 0' * 0.5 * mySize_y*(1/6)), s, '1 1 0' * mySize_y*(1/6), a * hud_alpha_fg, DRAWFLAG_NORMAL);
 
-               s = "A vote has been called for: ";
-               drawstring(pos + '0.5 0 0' * mySize_x + '0 0.1 0' * mySize_y - eX * stringwidth(s, FALSE, '1 1 0' * 0.5 * mySize_y*(1/5)), s, '1 1 0' * mySize_y*(1/5), '1 1 1', a * hud_alpha_fg, DRAWFLAG_NORMAL);
-               s = textShortenToWidth(vote_called_vote, mySize_x * 0.96, '10 0 0', stringwidth_colors); // TODO: broken?
-               if(hud_configure)
-                       s = "Configure the HUD";
-               drawcolorcodedstring(pos + '0.52 0 0' * mySize_x + '0 0.3 0' * mySize_y - eX * stringwidth(s, FALSE, '1 1 0' * 0.5 * mySize_y*(1/6)), s, '1 1 0' * mySize_y*(1/6), a * hud_alpha_fg, DRAWFLAG_NORMAL);
+       // print the yes/no counts
+       s = strcat("Yes: ", ftos(vote_yescount));
+       drawstring(pos + '0 0.6 0' * mySize_y + '0.02 0 0' * mySize_x, s, '1 1 0' * mySize_y*(1/6) , eY, a * hud_alpha_fg, DRAWFLAG_NORMAL);
+       s = strcat("No: ", ftos(vote_nocount));
+       drawstring(pos + '0 0.6 0' * mySize_y + '0.98 0 0' * mySize_x - eX * stringwidth(s, FALSE, '1 1 0' * mySize_y*(1/6)), s, '1 1 0' * mySize_y*(1/6), eX, a * hud_alpha_fg, DRAWFLAG_NORMAL);
 
-               // print the yes/no counts
-               s = strcat("Yes: ", ftos(vote_yescount));
-               drawstring(pos + '0 0.6 0' * mySize_y + '0.02 0 0' * mySize_x, s, '1 1 0' * mySize_y*(1/6) , eY, a * hud_alpha_fg, DRAWFLAG_NORMAL);
-               s = strcat("No: ", ftos(vote_nocount));
-               drawstring(pos + '0 0.6 0' * mySize_y + '0.98 0 0' * mySize_x - eX * stringwidth(s, FALSE, '1 1 0' * mySize_y*(1/6)), s, '1 1 0' * mySize_y*(1/6), eX, a * hud_alpha_fg, DRAWFLAG_NORMAL);
+       // draw the progress bars
+       drawsetcliparea(pos_x, pos_y, mySize_x * 0.5 * (vote_yescount/vote_needed), mySize_y);
+       drawpic_skin(pos, "voteprogress_prog", mySize, eY, a * hud_alpha_fg, DRAWFLAG_NORMAL);
 
-               // draw the progress bars
-               drawsetcliparea(pos_x, pos_y, mySize_x * 0.5 * (vote_yescount/vote_needed), mySize_y);
-               drawpic_skin(pos, "voteprogress_prog", mySize, eY, a * hud_alpha_fg, DRAWFLAG_NORMAL);
+       drawsetcliparea(pos_x + mySize_x - mySize_x * 0.5 * (vote_nocount/vote_needed), pos_y, mySize_x * 0.5, mySize_y);
+       drawpic_skin(pos, "voteprogress_prog", mySize, eX, a * hud_alpha_fg, DRAWFLAG_NORMAL);
 
-               drawsetcliparea(pos_x + mySize_x - mySize_x * 0.5 * (vote_nocount/vote_needed), pos_y, mySize_x * 0.5, mySize_y);
-               drawpic_skin(pos, "voteprogress_prog", mySize, eX, a * hud_alpha_fg, DRAWFLAG_NORMAL);
+       // draw the highlights
+       if(vote_highlighted == 1) {
+               drawsetcliparea(pos_x, pos_y, mySize_x * 0.5, mySize_y);
+               drawpic_skin(pos, "voteprogress_voted", mySize, eY, a * hud_alpha_fg, DRAWFLAG_NORMAL);
+       }
+       else if(vote_highlighted == 2) {
+               drawsetcliparea(pos_x + 0.5 * mySize_x, pos_y, mySize_x * 0.5, mySize_y);
+               drawpic_skin(pos, "voteprogress_voted", mySize, eX, a * hud_alpha_fg, DRAWFLAG_NORMAL);
+       }
 
-               // draw the highlights
-               if(vote_highlighted == 1) {
-                       drawsetcliparea(pos_x, pos_y, mySize_x * 0.5, mySize_y);
-                       drawpic_skin(pos, "voteprogress_voted", mySize, eY, a * hud_alpha_fg, DRAWFLAG_NORMAL);
-               }
-               else if(vote_highlighted == 2) {
-                       drawsetcliparea(pos_x + 0.5 * mySize_x, pos_y, mySize_x * 0.5, mySize_y);
-                       drawpic_skin(pos, "voteprogress_voted", mySize, eX, a * hud_alpha_fg, DRAWFLAG_NORMAL);
-               }
+       drawresetcliparea();
 
-               drawresetcliparea();
-       }
-       else if(!vote_active) {
+       if(!vote_active) {
                vote_highlighted = 0;
        }
 }
@@ -3083,7 +3582,7 @@ void HUD_ModIcons(void)
        pos = HUD_Panel_GetPos(id);
        mySize = HUD_Panel_GetSize(id);
 
-       HUD_Panel_DrawBg(id, pos, mySize);
+       HUD_Panel_DrawBg(id, pos, mySize, 0);
        float padding;
        padding = HUD_Panel_GetPadding(id);
        if(padding)
@@ -3112,7 +3611,7 @@ void HUD_DrawPressedKeys(void)
        pos = HUD_Panel_GetPos(id);
        mySize = HUD_Panel_GetSize(id);
 
-       HUD_Panel_DrawBg(id, pos, mySize);
+       HUD_Panel_DrawBg(id, pos, mySize, 0);
        float padding;
        padding = HUD_Panel_GetPadding(id);
        if(padding)
@@ -3133,6 +3632,50 @@ void HUD_DrawPressedKeys(void)
        drawpic_skin(pos + eX * mySize_x - eX * 0.372 * mySize_x +      eY * 0.486 * mySize_y, ((pressedkeys & KEY_RIGHT) ? "key_right_inv.tga" : "key_right.tga"),           '1 1 0' * 0.46 * mySize_y, '1 1 1', hud_alpha_fg, DRAWFLAG_NORMAL);
 }
 
+// Handle chat as a panel (#12)
+//
+float chat_prevtime;
+void HUD_Chat(void)
+{
+       float id = 12;
+       vector pos, mySize;
+       pos = HUD_Panel_GetPos(id);
+       mySize = HUD_Panel_GetSize(id);
+
+       HUD_Panel_DrawBg(id, pos, mySize, 0);
+       float padding;
+       padding = HUD_Panel_GetPadding(id);
+       if(padding)
+       {
+               pos += '1 1 0' * padding;
+               mySize -= '2 2 0' * padding;
+       }
+
+       cvar_set("con_csqcpositioning", "1");
+
+       cvar_set("con_chatrect_x", ftos(pos_x/vid_conwidth));
+       cvar_set("con_chatrect_y", ftos(pos_y/vid_conheight));
+
+       cvar_set("con_chatwidth", ftos(mySize_x/vid_conwidth));
+       cvar_set("con_chat", ftos(floor(mySize_y/cvar("con_chatsize") - 0.5)));
+
+       if(hud_configure)
+       {
+               if(chat_prevtime != floor(time/5))
+               {
+                       chat_prevtime = floor(time/5);
+
+                       float sound_prev;
+                       sound_prev = cvar("con_chatsound");
+
+                       // disable chat bleep
+                       cvar_set("con_chatsound", "0");
+                       print("\x01Player^7: This is the chat area\n");
+                       cvar_set("con_chatsound", ftos(sound_prev));
+               }
+       }
+}
+
 /*
 ==================
 Main HUD system
@@ -3257,6 +3800,23 @@ void HUD_Main (void)
        hud_configure = cvar("_hud_configure");
 
        // Drawing stuff
+
+       // HUD configure visible grid
+       if(hud_configure && cvar("hud_configure_grid") && cvar("hud_configure_grid_alpha"))
+       {
+               float i;
+               // x-axis
+               for(i = 0; i < vid_conwidth/max(2, cvar("hud_configure_grid_x")); ++i)
+               {
+                       drawfill(eX * i * max(2, cvar("hud_configure_grid_x")), eX + eY * vid_conheight, '0.5 0.5 0.5', cvar("hud_configure_grid_alpha"), DRAWFLAG_NORMAL);
+               }
+               // y-axis
+               for(i = 0; i < vid_conheight/max(2, cvar("hud_configure_grid_y")); ++i)
+               {
+                       drawfill(eY * i * max(2, cvar("hud_configure_grid_y")), eY + eX * vid_conwidth, '0.5 0.5 0.5', cvar("hud_configure_grid_alpha"), DRAWFLAG_NORMAL);
+               }
+       }
+
        if(cvar_string("hud_dock") != "")
                drawpic_skin('0 0 0', cvar_string("hud_dock"), eX * vid_conwidth + eY * vid_conheight, HUD_Panel_Dock_GetColor(), cvar("hud_dock_alpha"), DRAWFLAG_NORMAL);
 
@@ -3289,6 +3849,10 @@ void HUD_Main (void)
        if(HUD_Panel_CheckActive(11))
                if(spectatee_status > 0 || cvar("hud_pressedkeys") >= 2 || hud_configure)
                        HUD_DrawPressedKeys();
+       if(HUD_Panel_CheckActive(12))
+               HUD_Chat();
+       else
+               cvar_set("con_csqcpositioning", "0");
 
        // TODO hud_'ify these
        if (cvar("cl_showspeed"))