]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud.qc
hud_*.cfg file corrections part one (fix centerprint positioning/size, score_rankings...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud.qc
index 76a2db6794315aa1372ae80f97ac2749d01fc6f7..459af161afcabfe128fb0d5ad69afadbd1cde93b 100644 (file)
@@ -1801,10 +1801,56 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s
                                else
                                        print (sprintf(_("^1%s^1 is now conserved for centuries to come\n"), s1));
                        }
-               } else if(type == DEATH_TURRET) {
+               } else if(DEATH_ISTURRET(type)) {
                        HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
                        if(alsoprint)
-                               print (sprintf(_("^1%s^1 was mowed down by a turret \n"), s1));
+                       {
+                           if(gentle)
+                    print (sprintf(_("^1%s^1 ran into a turret\n"), s1));
+                else
+                {                                
+                    switch(type)
+                    {
+                        case DEATH_TURRET_EWHEEL:
+                            print (sprintf(_("^1%s^1 was laserd down by a eWheel turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_FLAC:
+                            print (sprintf(_("^1%s^1 got caught in the flac \n"), s1));
+                            break;
+                        case DEATH_TURRET_MACHINEGUN:
+                            print (sprintf(_("^1%s^1 was riddeld full of riddled by a machinegun turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_WALKER_GUN:
+                            print (sprintf(_("^1%s^1 got served a led enrichment by a walker turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_WALKER_MEELE:
+                            print (sprintf(_("^1%s^1 was impaled by a walker turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_WALKER_ROCKET:
+                            print (sprintf(_("^1%s^1 was rocketed to hell by a walker turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_HELLION:
+                            print (sprintf(_("^1%s^1 was blasted away hellion turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_HK:
+                            print (sprintf(_("^1%s^1 could not hide from the hunter turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_MLRS:
+                            print (sprintf(_("^1%s^1 got turned into smoldering gibs by a mlrs turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_PLASMA:
+                            print (sprintf(_("^1%s^1 got served some superheated plasma from a plasma turret \n"), s1));
+                            break;
+                        case DEATH_TURRET_PHASER:
+                            print (sprintf(_("^1%s^1 was phased out \n"), s1));
+                            break;
+                        case DEATH_TURRET_TESLA:                               
+                            print (sprintf(_("^1%s^1 was electrocuted by a tesla turret \n"), s1));
+                            break;
+                    }
+                }
+                       }
+                               
                } else if (type == DEATH_CUSTOM) {
                        HUD_KillNotify_Push(s1, "", 0, DEATH_CUSTOM);
                        if(alsoprint)
@@ -2351,14 +2397,34 @@ void HUD_Radar(void)
 {
        if (!autocvar__hud_configure)
        {
-               if (autocvar_hud_panel_radar == 0) return;
-               if (autocvar_hud_panel_radar != 2 && !teamplay) return;
+               if (hud_panel_radar_maximized)
+               {
+                       if (!hud_draw_maximized) return;
+               }
+               else
+               {
+                       if (autocvar_hud_panel_radar == 0) return;
+                       if (autocvar_hud_panel_radar != 2 && !teamplay) return;
+               }
        }
        else
                hud_configure_active_panel = HUD_PANEL_RADAR;
 
        HUD_Panel_UpdateCvars(radar);
        HUD_Panel_ApplyFadeAlpha();
+
+       if (hud_panel_radar_maximized && !autocvar__hud_configure)
+       {
+               panel_size = autocvar_hud_panel_radar_maximized_size;
+               panel_size_x = bound(0.2, panel_size_x, 1) * vid_conwidth;
+               panel_size_y = bound(0.2, panel_size_y, 1) * vid_conheight;
+               panel_pos_x = (vid_conwidth - panel_size_x) / 2;
+               panel_pos_y = (vid_conheight - panel_size_y) / 2;
+               
+               panel_bg = strcat(hud_skin_path, "/border_default"); // always use the default border when maximized
+               if(precache_pic(panel_bg) == "") { panel_bg = "gfx/hud/default/border_default"; } // fallback
+       }
+
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
@@ -2370,8 +2436,8 @@ void HUD_Radar(void)
                mySize -= '2 2 0' * panel_bg_padding;
        }
 
-       local float color2;
-       local entity tm;
+       float color2;
+       entity tm;
        float scale2d, normalsize, bigsize;
        float f;
 
@@ -2941,7 +3007,7 @@ float vote_change; // "time" when vote_active changed
 
 void HUD_VoteWindow(void) 
 {
-       if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE))
+       if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE || (serverflags & SERVERFLAG_PLAYERSTATS)))
        {
                vote_active = 1;
                if (autocvar__hud_configure)
@@ -2951,7 +3017,9 @@ void HUD_VoteWindow(void)
                        print(_("^1You must answer before entering hud configure mode\n"));
                        cvar_set("_hud_configure", "0");
                }
-               vote_called_vote = strzone(_("^2Name ^7instead of \"^1Unregistered player^7\" in stats"));
+               if(vote_called_vote)
+                       strunzone(vote_called_vote);
+               vote_called_vote = strzone(_("^2Name ^7instead of \"^1Anonymous player^7\" in stats"));
                uid2name_dialog = 1;
        }
 
@@ -3859,6 +3927,8 @@ void HUD_Chat(void)
                                cvar_set("con_chatrect", "0");
                        return;
                }
+               if(autocvar__con_chat_maximized)
+                       if(!hud_draw_maximized) return;
        }
        else
                hud_configure_active_panel = HUD_PANEL_CHAT;
@@ -4601,6 +4671,8 @@ void HUD_CenterPrint (void)
                        else
                                continue;
                }
+               
+               // fade the centerprint in/out 
                if (centerprint_time[j] < 0 || centerprint_expire_time[j] - centerprint_fadetime > time)
                {
                        a = bound(0, (time - (centerprint_expire_time[j] - centerprint_time[j])) / centerprint_fadetime, 1);
@@ -4610,10 +4682,14 @@ void HUD_CenterPrint (void)
                        a = (centerprint_expire_time[j] - time) / centerprint_fadetime;
                }
                
-               a = a * (bound(0.5, (1 - (i / 2)), 1) * bound(0.5, (1 - (i / 10)), 1));
-               sz = 0.8 + a * (1 - 0.8);
-
+               // also fade it based on positioning
+               a = a * bound(0.5, (1 - (i / 2)), 1); // pass one: all messages after the first have half alpha
+               a = a * bound(0.5, (1 - (i / 10)), 1); // pass two: after that, gradually lower alpha even more for each message
+               
+               // finally set the size based on the new alpha
+               sz = 0.75 + a * (1 - 0.75); 
                drawfontscale = sz * '1 1 0';
+               
                if (centerprint_countdown_num[j])
                        n = tokenizebyseparator(sprintf(centerprint_messages[j], centerprint_countdown_num[j]), "\n");
                else
@@ -4671,13 +4747,13 @@ void HUD_CenterPrint (void)
                {
                        pos_y = current_msg_pos_y - CENTERPRINT_SPACING * fontsize_y;
                        if (a < 1 && centerprint_msgID[j] == 0) // messages with id can be replaced just after they are faded out, so never move over them the next messages
-                               pos_y += (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(a));
+                               pos_y += (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(sz));
                }
                else
                {
                        pos_y += CENTERPRINT_SPACING * fontsize_y;
                        if (a < 1 && centerprint_msgID[j] == 0) // messages with id can be replaced just after they are faded out, so never move over them the next messages
-                               pos_y -= (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(a));
+                               pos_y -= (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(sz));
                }
        }
        drawfontscale = '1 1 0';
@@ -4885,15 +4961,17 @@ void HUD_Main (void)
                }
        }
 
+       hud_draw_maximized = 0;
        // draw panels in order specified by panel_order array
-       for(i = HUD_PANEL_NUM - 1; i >= 0; --i) {
-               if(i != HUD_PANEL_CHAT || !autocvar__con_chat_maximized) // don't draw maximized chat panel twice!
-                       HUD_DrawPanel(panel_order[i]);
-       }
+       for(i = HUD_PANEL_NUM - 1; i >= 0; --i)
+               HUD_DrawPanel(panel_order[i]);
 
-       // draw chat panel on top if it is maximized
+       hud_draw_maximized = 1; // panels that may be maximized must check this var
+       // draw maximized panels on top
+       if(hud_panel_radar_maximized)
+               HUD_Radar();
        if(autocvar__con_chat_maximized)
-               HUD_Chat(); // HUD_DrawPanel(HUD_PANEL_CHAT);
+               HUD_Chat();
 
        if(autocvar__hud_configure)
        {