]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/master' into samual/hud_updates
authorSamual <samual@xonotic.org>
Sun, 16 Oct 2011 16:17:34 +0000 (12:17 -0400)
committerSamual <samual@xonotic.org>
Sun, 16 Oct 2011 16:17:34 +0000 (12:17 -0400)
25 files changed:
defaultXonotic.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_old.cfg
hud_luminos_xhair_minimal.cfg
hud_nexuiz.cfg
qcsrc/client/hud.qc
qcsrc/client/hud_config.qc
qcsrc/server/autocvars.qh
qcsrc/server/g_damage.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/w_electro.qc
qcsrc/server/w_grenadelauncher.qc
qcsrc/server/w_hagar.qc
qcsrc/server/w_hlac.qc
qcsrc/server/w_hook.qc
qcsrc/server/w_minelayer.qc
qcsrc/server/w_minstanex.qc
qcsrc/server/w_nex.qc
qcsrc/server/w_rifle.qc
qcsrc/server/w_rocketlauncher.qc
qcsrc/server/w_seeker.qc
qcsrc/server/w_shotgun.qc
qcsrc/server/w_uzi.qc

index f92882f4424da8b0ca0f2693e7be3a64e0916e95..20ed351695bf96e5afd7f48df493dd120ddc4615 100644 (file)
@@ -366,10 +366,10 @@ set g_respawn_ghosts_maxtime 6 "maximum amount of time a respawn ghost can last,
 set sv_gibhealth 100 "Minus health a dead body must have in order to get gibbed"
 
 // fragmessage: This allows extra information to be displayed with the frag centerprints. 
-set sv_fragmessage_information_ping 1 "Enable ping display information, 0 = Never display; 1 = Always display (If the player is a bot, it will say bot instead of the ping.)"
-set sv_fragmessage_information_handicap 1 "Enable handicap display information, 0 = Never display; 1 = Only when the player has handicap on; 2 = Always display (Displays Off if off)"
-set sv_fragmessage_information_stats 1 "Enable statistics (health/armor) display information, 0 = Never display; 1 = Always display (Only available for the person who was killed)"
-set sv_fragmessage_information_typefrag 1 "Enable typefrag display information, 0 = Never display; 1 = Always display"
+set sv_fraginfo_ping 1 "Enable ping display information, 0 = Never display; 1 = Always display (If the player is a bot, it will say bot instead of the ping.)"
+set sv_fraginfo_handicap 1 "Enable handicap display information, 0 = Never display; 1 = Only when the player has handicap on; 2 = Always display (Displays Off if off)"
+set sv_fraginfo_stats 1 "Enable statistics (health/armor) display information, 0 = Never display; 1 = Always display (Only available for the person who was killed)"
+set sv_fraginfo_typefrag 1 "Enable typefrag display information, 0 = Never display; 1 = Always display"
 
 // use default physics
 set sv_friction_on_land 0
@@ -1478,8 +1478,6 @@ alias +hud_panel_radar_maximized "cl_cmd hud_panel_radar_maximized 1"
 alias -hud_panel_radar_maximized "cl_cmd hud_panel_radar_maximized 0"
 alias hud_panel_radar_maximized "cl_cmd hud_panel_radar_maximized"
 
-seta hud_panel_score_rankings 0 "show rankings: 1 always show my own score; 2 pure rankings"
-
 seta hud_panel_engineinfo_framecounter_time 0.1 "time between framerate display updates"
 seta hud_panel_engineinfo_framecounter_decimals 0 "amount of decimals to show"
 seta hud_panel_engineinfo_framecounter_exponentialmovingaverage 1 "use an averaging method for calculating fps instead of counting frametime like engine does"
index 0e4e4495b50bfe0a6433806b45f0e303655a38d8..f53264ee7eef0d1c14d7ee4ea2c99edda0a05018 100644 (file)
@@ -30,24 +30,26 @@ seta hud_configure_grid_xsize "0.010000"
 seta hud_configure_grid_ysize "0.010000"
 
 seta hud_panel_weapons 1
-seta hud_panel_weapons_pos "0.940000 0.180000"
-seta hud_panel_weapons_size "0.060000 0.610000"
+seta hud_panel_weapons_pos "0.930000 0.170000"
+seta hud_panel_weapons_size "0.070000 0.650000"
 seta hud_panel_weapons_bg "border_small_weapons"
 seta hud_panel_weapons_bg_color ""
 seta hud_panel_weapons_bg_color_team ""
 seta hud_panel_weapons_bg_alpha ""
 seta hud_panel_weapons_bg_border ""
-seta hud_panel_weapons_bg_padding ""
+seta hud_panel_weapons_bg_padding "4"
 seta hud_panel_weapons_complainbubble "1"
-seta hud_panel_weapons_complainbubble_padding "-10"
+seta hud_panel_weapons_complainbubble_padding "2"
+seta hud_panel_weapons_complainbubble_time "4"
+seta hud_panel_weapons_complainbubble_fadetime "2"
 seta hud_panel_weapons_complainbubble_color_outofammo "0.8 0 0"
 seta hud_panel_weapons_complainbubble_color_donthave "0.8 0.5 0"
 seta hud_panel_weapons_complainbubble_color_unavailable "0 0.3 0.8"
 seta hud_panel_weapons_ammo_color "0 1 0"
 seta hud_panel_weapons_ammo_alpha "1"
 seta hud_panel_weapons_aspect "2"
-seta hud_panel_weapons_timeout "3"
-seta hud_panel_weapons_timeout_effect "2"
+seta hud_panel_weapons_timeout "5"
+seta hud_panel_weapons_timeout_effect "3"
 
 seta hud_panel_ammo 1
 seta hud_panel_ammo_pos "0.330000 0.960000"
@@ -142,6 +144,7 @@ seta hud_panel_score_bg_color_team ""
 seta hud_panel_score_bg_alpha ""
 seta hud_panel_score_bg_border ""
 seta hud_panel_score_bg_padding "0"
+seta hud_panel_score_rankings 1
 
 seta hud_panel_racetimer 1
 seta hud_panel_racetimer_pos "0.360000 0.110000"
@@ -156,7 +159,7 @@ seta hud_panel_racetimer_bg_padding ""
 seta hud_panel_vote 1
 seta hud_panel_vote_pos "0.710000 0.660000"
 seta hud_panel_vote_size "0.210000 0.100000"
-seta hud_panel_vote_bg "border_vote"
+seta hud_panel_vote_bg ""
 seta hud_panel_vote_bg_color ""
 seta hud_panel_vote_bg_color_team ""
 seta hud_panel_vote_bg_alpha ""
@@ -232,8 +235,8 @@ seta hud_panel_physics_progressbar "1"
 seta hud_panel_physics_text "1"
 
 seta hud_panel_centerprint 1
-seta hud_panel_centerprint_pos "0.175000 0.260000"
-seta hud_panel_centerprint_size "0.650000 0.210000"
+seta hud_panel_centerprint_pos "0.175000 0.220000"
+seta hud_panel_centerprint_size "0.650000 0.220000"
 seta hud_panel_centerprint_bg "0"
 seta hud_panel_centerprint_bg_color ""
 seta hud_panel_centerprint_bg_color_team ""
@@ -241,7 +244,7 @@ seta hud_panel_centerprint_bg_alpha ""
 seta hud_panel_centerprint_bg_border ""
 seta hud_panel_centerprint_bg_padding ""
 seta hud_panel_centerprint_align "0.5"
-seta hud_panel_centerprint_flip "1"
+seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1"
 seta hud_panel_centerprint_time "3"
 seta hud_panel_centerprint_fadetime "0.25"
index 9d255bb4acba033271d12e8b6de8371f11149bee..4d82af0689c5761a6400522a07139cf01ff579fc 100644 (file)
@@ -40,6 +40,8 @@ seta hud_panel_weapons_bg_border ""
 seta hud_panel_weapons_bg_padding ""
 seta hud_panel_weapons_complainbubble "1"
 seta hud_panel_weapons_complainbubble_padding "-10"
+seta hud_panel_weapons_complainbubble_time "1"
+seta hud_panel_weapons_complainbubble_fadetime "0.25"
 seta hud_panel_weapons_complainbubble_color_outofammo "0.8 0 0"
 seta hud_panel_weapons_complainbubble_color_donthave "0.8 0.5 0"
 seta hud_panel_weapons_complainbubble_color_unavailable "0 0.3 0.8"
@@ -142,6 +144,7 @@ seta hud_panel_score_bg_color_team ""
 seta hud_panel_score_bg_alpha ""
 seta hud_panel_score_bg_border ""
 seta hud_panel_score_bg_padding ""
+seta hud_panel_score_rankings 1
 
 seta hud_panel_racetimer 1
 seta hud_panel_racetimer_pos "0.360000 0.090000"
@@ -232,8 +235,8 @@ seta hud_panel_physics_progressbar "3"
 seta hud_panel_physics_text "2"
 
 seta hud_panel_centerprint 1
-seta hud_panel_centerprint_pos "0.175000 0.260000"
-seta hud_panel_centerprint_size "0.650000 0.210000"
+seta hud_panel_centerprint_pos "0.175000 0.220000"
+seta hud_panel_centerprint_size "0.650000 0.220000"
 seta hud_panel_centerprint_bg "0"
 seta hud_panel_centerprint_bg_color ""
 seta hud_panel_centerprint_bg_color_team ""
@@ -241,7 +244,7 @@ seta hud_panel_centerprint_bg_alpha ""
 seta hud_panel_centerprint_bg_border ""
 seta hud_panel_centerprint_bg_padding ""
 seta hud_panel_centerprint_align "0.5"
-seta hud_panel_centerprint_flip "1"
+seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1"
 seta hud_panel_centerprint_time "3"
 seta hud_panel_centerprint_fadetime "0.25"
index 4308c0b4feb4646b99d23bb8aeff667849e949fd..6ffa6fdc630fc41a9a14758c2acd3987cb0c4da5 100644 (file)
@@ -40,6 +40,8 @@ seta hud_panel_weapons_bg_border ""
 seta hud_panel_weapons_bg_padding ""
 seta hud_panel_weapons_complainbubble "1"
 seta hud_panel_weapons_complainbubble_padding "-10"
+seta hud_panel_weapons_complainbubble_time "1"
+seta hud_panel_weapons_complainbubble_fadetime "0.25"
 seta hud_panel_weapons_complainbubble_color_outofammo "0.8 0 0"
 seta hud_panel_weapons_complainbubble_color_donthave "0.8 0.5 0"
 seta hud_panel_weapons_complainbubble_color_unavailable "0 0.3 0.8"
@@ -142,6 +144,7 @@ seta hud_panel_score_bg_color_team ""
 seta hud_panel_score_bg_alpha ""
 seta hud_panel_score_bg_border ""
 seta hud_panel_score_bg_padding ""
+seta hud_panel_score_rankings 1
 
 seta hud_panel_racetimer 1
 seta hud_panel_racetimer_pos "0.360000 0.090000"
@@ -232,8 +235,8 @@ seta hud_panel_physics_progressbar "1"
 seta hud_panel_physics_text "1"
 
 seta hud_panel_centerprint 1
-seta hud_panel_centerprint_pos "0.175000 0.260000"
-seta hud_panel_centerprint_size "0.650000 0.210000"
+seta hud_panel_centerprint_pos "0.175000 0.220000"
+seta hud_panel_centerprint_size "0.650000 0.220000"
 seta hud_panel_centerprint_bg "0"
 seta hud_panel_centerprint_bg_color ""
 seta hud_panel_centerprint_bg_color_team ""
@@ -241,7 +244,7 @@ seta hud_panel_centerprint_bg_alpha ""
 seta hud_panel_centerprint_bg_border ""
 seta hud_panel_centerprint_bg_padding ""
 seta hud_panel_centerprint_align "0.5"
-seta hud_panel_centerprint_flip "1"
+seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1"
 seta hud_panel_centerprint_time "3"
 seta hud_panel_centerprint_fadetime "0.25"
index 2aca597f6ede5adac177fb42198977e504546f93..7512e249f761f13f31fe673f0bb8853175ee2de4 100644 (file)
@@ -40,6 +40,8 @@ seta hud_panel_weapons_bg_border ""
 seta hud_panel_weapons_bg_padding ""
 seta hud_panel_weapons_complainbubble "1"
 seta hud_panel_weapons_complainbubble_padding "-10"
+seta hud_panel_weapons_complainbubble_time "1"
+seta hud_panel_weapons_complainbubble_fadetime "0.25"
 seta hud_panel_weapons_complainbubble_color_outofammo "0.8 0 0"
 seta hud_panel_weapons_complainbubble_color_donthave "0.8 0.5 0"
 seta hud_panel_weapons_complainbubble_color_unavailable "0 0.3 0.8"
@@ -142,6 +144,7 @@ seta hud_panel_score_bg_color_team ""
 seta hud_panel_score_bg_alpha ""
 seta hud_panel_score_bg_border ""
 seta hud_panel_score_bg_padding ""
+seta hud_panel_score_rankings 1
 
 seta hud_panel_racetimer 1
 seta hud_panel_racetimer_pos "0.360000 0.090000"
@@ -232,8 +235,8 @@ seta hud_panel_physics_progressbar "3"
 seta hud_panel_physics_text "2"
 
 seta hud_panel_centerprint 1
-seta hud_panel_centerprint_pos "0.175000 0.260000"
-seta hud_panel_centerprint_size "0.650000 0.210000"
+seta hud_panel_centerprint_pos "0.175000 0.220000"
+seta hud_panel_centerprint_size "0.650000 0.220000"
 seta hud_panel_centerprint_bg "0"
 seta hud_panel_centerprint_bg_color ""
 seta hud_panel_centerprint_bg_color_team ""
@@ -241,7 +244,7 @@ seta hud_panel_centerprint_bg_alpha ""
 seta hud_panel_centerprint_bg_border ""
 seta hud_panel_centerprint_bg_padding ""
 seta hud_panel_centerprint_align "0.5"
-seta hud_panel_centerprint_flip "1"
+seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1"
 seta hud_panel_centerprint_time "3"
 seta hud_panel_centerprint_fadetime "0.25"
index 705af40a12ff230625c1ac3762524954050943aa..108072715f17c1d8adcf1724a1fc745529dd62e7 100644 (file)
@@ -40,6 +40,8 @@ seta hud_panel_weapons_bg_border ""
 seta hud_panel_weapons_bg_padding "-5"
 seta hud_panel_weapons_complainbubble "1"
 seta hud_panel_weapons_complainbubble_padding "-10"
+seta hud_panel_weapons_complainbubble_time "1"
+seta hud_panel_weapons_complainbubble_fadetime "0.25"
 seta hud_panel_weapons_complainbubble_color_outofammo "0.8 0 0"
 seta hud_panel_weapons_complainbubble_color_donthave "0.8 0.5 0"
 seta hud_panel_weapons_complainbubble_color_unavailable "0 0.3 0.8"
@@ -123,7 +125,7 @@ seta hud_panel_timer_bg_border ""
 seta hud_panel_timer_bg_padding "0"
 
 seta hud_panel_radar 2
-seta hud_panel_radar_pos "0.800000 0"
+seta hud_panel_radar_pos "0 0"
 seta hud_panel_radar_size "0.200000 0.260000"
 seta hud_panel_radar_bg "border_radar"
 seta hud_panel_radar_bg_color ""
@@ -142,6 +144,7 @@ seta hud_panel_score_bg_color_team ""
 seta hud_panel_score_bg_alpha ""
 seta hud_panel_score_bg_border ""
 seta hud_panel_score_bg_padding ""
+seta hud_panel_score_rankings 0
 
 seta hud_panel_racetimer 1
 seta hud_panel_racetimer_pos "0.360000 0.140000"
@@ -233,7 +236,7 @@ seta hud_panel_physics_text "2"
 
 seta hud_panel_centerprint 1
 seta hud_panel_centerprint_pos "0.175000 0.260000"
-seta hud_panel_centerprint_size "0.650000 0.210000"
+seta hud_panel_centerprint_size "0.650000 0.200000"
 seta hud_panel_centerprint_bg "0"
 seta hud_panel_centerprint_bg_color ""
 seta hud_panel_centerprint_bg_color_team ""
@@ -241,7 +244,7 @@ seta hud_panel_centerprint_bg_alpha ""
 seta hud_panel_centerprint_bg_border ""
 seta hud_panel_centerprint_bg_padding ""
 seta hud_panel_centerprint_align "0.5"
-seta hud_panel_centerprint_flip "1"
+seta hud_panel_centerprint_flip "0"
 seta hud_panel_centerprint_fontscale "1"
 seta hud_panel_centerprint_time "3"
 seta hud_panel_centerprint_fadetime "0.25"
index fe2e042f82623d8475bb5d397f699f1e8ebc864d..459af161afcabfe128fb0d5ad69afadbd1cde93b 100644 (file)
@@ -431,40 +431,58 @@ float GetAmmoTypeForWep(float i)
 
 void HUD_Weapons(void)
 {
-       float i, f, screen_ar;
-       float center_x, center_y;
-    if(hud != HUD_NORMAL) return;
+       // declarations
+       float weapons_stat = getstati(STAT_WEAPONS); 
+       float i, f, a, j, factor;
+       float screen_ar, center_x, center_y; 
+       float weapon_count, weapon_id, weapon_alpha; 
+       float row, column, rows, columns; 
+       float aspect = autocvar_hud_panel_weapons_aspect;
+       
+       float show_accuracy, panel_weapon_accuracy;
+       
+       float timeout = autocvar_hud_panel_weapons_timeout;
+       float timein_effect_length = (autocvar_hud_panel_weapons_timeout_effect ? 0.375 : 0);
+       float timeout_effect_length = (autocvar_hud_panel_weapons_timeout_effect ? 0.75 : 0);
+       
+       float ammo_type, ammo_full, ammo_alpha;
+       float barsize_x, barsize_y, baroffset_x, baroffset_y;
+       
+       float when = autocvar_hud_panel_weapons_complainbubble_time;
+       float fadetime = autocvar_hud_panel_weapons_complainbubble_fadetime;
+       
+       vector weapon_pos, weapon_size;
+       vector old_panel_size;
+       vector color, ammo_color;
+       
+       // check to see if we want to continue
+  if(hud != HUD_NORMAL) { return; }
+  
        if(!autocvar__hud_configure)
-       {
-               if(!autocvar_hud_panel_weapons) return;
-               if(spectatee_status == -1) return;
-       }
+               if((!autocvar_hud_panel_weapons) || (spectatee_status == -1))
+                       return;
+               else if(timeout && time >= weapontime + timeout + timeout_effect_length)
+               {
+                       weaponprevtime = time;
+                       return;
+               }
        else
                hud_configure_active_panel = HUD_PANEL_WEAPONS;
 
-       float timeout = autocvar_hud_panel_weapons_timeout;
-       float timeout_effect_length, timein_effect_length;
-       if (autocvar_hud_panel_weapons_timeout_effect == 0)
+       // update generic hud functions
+       HUD_Panel_UpdateCvars(weapons);
+       HUD_Panel_ApplyFadeAlpha();
+       
+       // calculate fading effect to weapon images for when the panel is idle
+       if(autocvar_hud_panel_weapons_fade)
        {
-               timeout_effect_length = 0;
-               timein_effect_length = 0;
+               weapon_alpha = 3.2 - 2 * (time - weapontime);
+               weapon_alpha = bound(0.7, weapon_alpha, 1) * panel_fg_alpha;
        }
        else
-       {
-               timeout_effect_length = 0.75;
-               timein_effect_length = 0.375;
-       }
-
-       if (timeout && time >= weapontime + timeout + timeout_effect_length && !autocvar__hud_configure)
-       {
-               weaponprevtime = time;
-               return;
-       }
+               weapon_alpha = panel_fg_alpha;
 
-       HUD_Panel_UpdateCvars(weapons);
-       HUD_Panel_ApplyFadeAlpha();
-
-       // TODO make this configurable
+       // figure out weapon order (how the weapons are sorted) // TODO make this configurable
        if(weaponorder_bypriority != autocvar_cl_weaponpriority || !weaponorder[0])
        {
                float weapon_cnt;
@@ -493,33 +511,34 @@ void HUD_Weapons(void)
 
                weaponorder_cmp_str = string_null;
        }
-
-       float when, fadetime;
-       when = autocvar_hud_panel_weapons_complainbubble_time;
-       fadetime = autocvar_hud_panel_weapons_complainbubble_fadetime;
-       float weapons_st = getstati(STAT_WEAPONS);
-       float weapon_count;
+       
+       // determine which weapons are going to be shown
        if (autocvar_hud_panel_weapons_onlyowned)
        {
                if(autocvar__hud_configure)
                {
-                       if (weapons_st == 0)
+                       if (weapons_stat == 0) // create some fake weapons anyway
                                for(i = 0; i <= WEP_LAST-WEP_FIRST; i += floor((WEP_LAST-WEP_FIRST)/5))
-                                       weapons_st |= power2of(i);
+                                       weapons_stat |= power2of(i);
+                                       
                        if(menu_enabled != 2)
                                HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
                }
-
-               vector old_panel_size;
+               
+               // do we own this weapon?
                for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
-               {
-                       if(weapons_st & weaponorder[i].weapons)
+                       if(weapons_stat & weaponorder[i].weapons)
                                ++weapon_count;
-               }
-               if(!autocvar__hud_configure && (autocvar_hud_panel_weapons_complainbubble && time - complain_weapon_time < when + fadetime))// && complain_weapon >= 0
-                       ++weapon_count;
-               if (weapon_count == 0)
-                       return;
+               
+               // add it anyway if weaponcomplain is shown
+               if((!autocvar__hud_configure) 
+                       && (autocvar_hud_panel_weapons_complainbubble 
+                               && time - complain_weapon_time < when + fadetime))
+                                       ++weapon_count;
+                       
+               // might as well commit suicide now, no reason to live ;)
+               if (weapon_count == 0) { return; }
+               
                // reduce size of the panel
                if (panel_size_y > panel_size_x)
                {
@@ -537,126 +556,107 @@ void HUD_Weapons(void)
        else
                weapon_count = WEP_COUNT;
 
-       if (timeout && time >= weapontime + timeout && !autocvar__hud_configure)
+       // animation for fading in/out the panel respectively when not in use
+       if(!autocvar__hud_configure)
        {
-               f = (time - (weapontime + timeout)) / timeout_effect_length;
-               if (autocvar_hud_panel_weapons_timeout_effect == 1 || autocvar_hud_panel_weapons_timeout_effect == 3)
+               if (timeout && time >= weapontime + timeout) // apply timeout effect if needed
                {
-                       panel_bg_alpha *= (1 - f);
-                       panel_fg_alpha *= (1 - f);
-               }
-               if (autocvar_hud_panel_weapons_timeout_effect == 2 || autocvar_hud_panel_weapons_timeout_effect == 3)
-               {
-                       f *= f; // for a cooler movement
-                       center_x = panel_pos_x + panel_size_x/2;
-                       center_y = panel_pos_y + panel_size_y/2;
-                       screen_ar = vid_conwidth/vid_conheight;
-                       if (center_x/center_y < screen_ar) //bottom left
+                       f = (time - (weapontime + timeout)) / timeout_effect_length;
+                       if (autocvar_hud_panel_weapons_timeout_effect == 1 || autocvar_hud_panel_weapons_timeout_effect == 3)
                        {
-                               if ((vid_conwidth - center_x)/center_y < screen_ar) //bottom
-                                       panel_pos_y += f * (vid_conheight - panel_pos_y);
-                               else //left
-                                       panel_pos_x -= f * (panel_pos_x + panel_size_x);
+                               panel_bg_alpha *= (1 - f);
+                               panel_fg_alpha *= (1 - f);
                        }
-                       else //top right
+                       if (autocvar_hud_panel_weapons_timeout_effect == 2 || autocvar_hud_panel_weapons_timeout_effect == 3)
                        {
-                               if ((vid_conwidth - center_x)/center_y < screen_ar) //right
-                                       panel_pos_x += f * (vid_conwidth - panel_pos_x);
-                               else //top
-                                       panel_pos_y -= f * (panel_pos_y + panel_size_y);
+                               f *= f; // for a cooler movement
+                               center_x = panel_pos_x + panel_size_x/2;
+                               center_y = panel_pos_y + panel_size_y/2;
+                               screen_ar = vid_conwidth/vid_conheight;
+                               if (center_x/center_y < screen_ar) //bottom left
+                               {
+                                       if ((vid_conwidth - center_x)/center_y < screen_ar) //bottom
+                                               panel_pos_y += f * (vid_conheight - panel_pos_y);
+                                       else //left
+                                               panel_pos_x -= f * (panel_pos_x + panel_size_x);
+                               }
+                               else //top right
+                               {
+                                       if ((vid_conwidth - center_x)/center_y < screen_ar) //right
+                                               panel_pos_x += f * (vid_conwidth - panel_pos_x);
+                                       else //top
+                                               panel_pos_y -= f * (panel_pos_y + panel_size_y);
+                               }
                        }
+                       weaponprevtime = time - (1 - f) * timein_effect_length;
                }
-               weaponprevtime = time - (1 - f) * timein_effect_length;
-       }
-       else if (timeout && time < weaponprevtime + timein_effect_length && !autocvar__hud_configure)
-       {
-               f = (time - weaponprevtime) / timein_effect_length;
-               if (autocvar_hud_panel_weapons_timeout_effect == 1 || autocvar_hud_panel_weapons_timeout_effect == 3)
-               {
-                       panel_bg_alpha *= (f);
-                       panel_fg_alpha *= (f);
-               }
-               if (autocvar_hud_panel_weapons_timeout_effect == 2 || autocvar_hud_panel_weapons_timeout_effect == 3)
+               else if (timeout && time < weaponprevtime + timein_effect_length) // apply timein effect if needed
                {
-                       f *= f; // for a cooler movement
-                       f = 1 - f;
-                       center_x = panel_pos_x + panel_size_x/2;
-                       center_y = panel_pos_y + panel_size_y/2;
-                       screen_ar = vid_conwidth/vid_conheight;
-                       if (center_x/center_y < screen_ar) //bottom left
+                       f = (time - weaponprevtime) / timein_effect_length;
+                       if (autocvar_hud_panel_weapons_timeout_effect == 1 || autocvar_hud_panel_weapons_timeout_effect == 3)
                        {
-                               if ((vid_conwidth - center_x)/center_y < screen_ar) //bottom
-                                       panel_pos_y += f * (vid_conheight - panel_pos_y);
-                               else //left
-                                       panel_pos_x -= f * (panel_pos_x + panel_size_x);
+                               panel_bg_alpha *= (f);
+                               panel_fg_alpha *= (f);
                        }
-                       else //top right
+                       if (autocvar_hud_panel_weapons_timeout_effect == 2 || autocvar_hud_panel_weapons_timeout_effect == 3)
                        {
-                               if ((vid_conwidth - center_x)/center_y < screen_ar) //right
-                                       panel_pos_x += f * (vid_conwidth - panel_pos_x);
-                               else //top
-                                       panel_pos_y -= f * (panel_pos_y + panel_size_y);
+                               f *= f; // for a cooler movement
+                               f = 1 - f;
+                               center_x = panel_pos_x + panel_size_x/2;
+                               center_y = panel_pos_y + panel_size_y/2;
+                               screen_ar = vid_conwidth/vid_conheight;
+                               if (center_x/center_y < screen_ar) //bottom left
+                               {
+                                       if ((vid_conwidth - center_x)/center_y < screen_ar) //bottom
+                                               panel_pos_y += f * (vid_conheight - panel_pos_y);
+                                       else //left
+                                               panel_pos_x -= f * (panel_pos_x + panel_size_x);
+                               }
+                               else //top right
+                               {
+                                       if ((vid_conwidth - center_x)/center_y < screen_ar) //right
+                                               panel_pos_x += f * (vid_conwidth - panel_pos_x);
+                                       else //top
+                                               panel_pos_y -= f * (panel_pos_y + panel_size_y);
+                               }
                        }
                }
        }
 
+       // draw the background, then change the virtual size of it to better fit other items inside 
        HUD_Panel_DrawBg(1);
        if(panel_bg_padding)
        {
                panel_pos += '1 1 0' * panel_bg_padding;
-               panel_size -= '2 2 0' * panel_bg_padding;
+               panel_size -= '1 1 0' * panel_bg_padding;
        }
 
-       float weapid, wpnalpha;
-
-       if(autocvar_hud_panel_weapons_fade)
-       {
-               wpnalpha = 3.2 - 2 * (time - weapontime);
-               wpnalpha = bound(0.7, wpnalpha, 1) * panel_fg_alpha;
-       }
-       else
-               wpnalpha = panel_fg_alpha;
-
-       float rows, columns;
-       float aspect = autocvar_hud_panel_weapons_aspect;
+       // after the sizing and animations are done, update the other values
        rows = panel_size_y/panel_size_x;
        rows = bound(1, floor((sqrt(4 * aspect * rows * weapon_count + rows * rows) + rows + 0.5) / 2), weapon_count);
-
        columns = ceil(weapon_count/rows);
-       float row, column;
-
-       float a, type, fullammo;
-
-       vector color;
-       vector wpnpos;
-       vector wpnsize;
-
-       vector ammo_color;
-       float ammo_alpha;
-       wpnsize = eX * panel_size_x*(1/columns) + eY * panel_size_y*(1/rows);
-       float barsize_x, barsize_y, baroffset_x, baroffset_y;
+       weapon_size = eX * panel_size_x*(1/columns) + eY * panel_size_y*(1/rows);
+       
+       // calculate position/size for visual bar displaying ammount of ammo status
        if (autocvar_hud_panel_weapons_ammo)
        {
                ammo_color = stov(autocvar_hud_panel_weapons_ammo_color);
                ammo_alpha = panel_fg_alpha * autocvar_hud_panel_weapons_ammo_alpha;
 
-
-               if(wpnsize_x/wpnsize_y > aspect)
+               if(weapon_size_x/weapon_size_y > aspect)
                {
-                       barsize_x = aspect * wpnsize_y;
-                       barsize_y = wpnsize_y;
-                       baroffset_x = (wpnsize_x - barsize_x) / 2;
+                       barsize_x = aspect * weapon_size_y;
+                       barsize_y = weapon_size_y;
+                       baroffset_x = (weapon_size_x - barsize_x) / 2;
                }
                else
                {
-                       barsize_y = 1/aspect * wpnsize_x;
-                       barsize_x = wpnsize_x;
-                       baroffset_y = (wpnsize_y - barsize_y) / 2;
+                       barsize_y = 1/aspect * weapon_size_x;
+                       barsize_x = weapon_size_x;
+                       baroffset_y = (weapon_size_y - barsize_y) / 2;
                }
        }
 
-       float show_accuracy;
-       float weapon_stats;
        if(autocvar_hud_panel_weapons_accuracy && acc_levels)
        {
                show_accuracy = true;
@@ -667,105 +667,117 @@ void HUD_Weapons(void)
 
        for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
        {
+               // retrieve information about the current weapon to be drawn
                self = weaponorder[i];
-               if (!self || self.impulse < 0)
-                       continue;
-               if (autocvar_hud_panel_weapons_onlyowned)
-               if (!((weapons_st & self.weapons) || (self.weapon == complain_weapon && time - complain_weapon_time < when + fadetime && autocvar_hud_panel_weapons_complainbubble)))
-                       continue;
-               wpnpos = panel_pos + eX * column * wpnsize_x + eY * row * wpnsize_y;
-
-               weapid = self.impulse;
+               weapon_id = self.impulse;
+               
+               // skip if this weapon doesn't exist
+               if (!self || self.impulse < 0) { continue; }
+               
+               // skip this weapon if we don't own it (and onlyowned is enabled)-- or if weapons_complainbubble is showing for this weapon
+               if (autocvar_hud_panel_weapons_onlyowned
+                       && !((weapons_stat & self.weapons) 
+                       || (self.weapon == complain_weapon 
+                               && time - complain_weapon_time < when + fadetime 
+                               && autocvar_hud_panel_weapons_complainbubble)))
+                                       continue;
+                                       
+               // figure out the drawing position of weapon
+               weapon_pos = (panel_pos 
+                       + eX * column * weapon_size_x 
+                       + eY * row * weapon_size_y);
 
                // draw background behind currently selected weapon
                if(self.weapon == switchweapon)
-                       drawpic_aspect_skin(wpnpos, "weapon_current_bg", wpnsize, '1 1 1', wpnalpha, DRAWFLAG_NORMAL);
+                       drawpic_aspect_skin(weapon_pos, "weapon_current_bg", weapon_size, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
 
                // draw the weapon accuracy
                if(show_accuracy)
                {
-                       weapon_stats = weapon_accuracy[self.weapon-WEP_FIRST];
-                       if(weapon_stats >= 0)
+                       panel_weapon_accuracy = weapon_accuracy[self.weapon-WEP_FIRST];
+                       if(panel_weapon_accuracy >= 0)
                        {
-                               // find the max level lower than weapon_stats
-                               float j;
+                               // find the max level lower than weapon_accuracy
                                j = acc_levels-1;
-                               while ( j && weapon_stats < acc_lev[j] )
+                               while ( j && panel_weapon_accuracy < acc_lev[j] )
                                        --j;
 
-                               // inject color j+1 in color j, how much depending on how much weapon_stats is higher than level j
-                               float factor;
-                               factor = (weapon_stats - acc_lev[j]) / (acc_lev[j+1] - acc_lev[j]);
+                               // inject color j+1 in color j, how much depending on how much weapon_accuracy is higher than level j
+                               factor = (panel_weapon_accuracy - acc_lev[j]) / (acc_lev[j+1] - acc_lev[j]);
                                color = acc_col[j];
                                color = color + factor * (acc_col[j+1] - color);
 
-                               drawpic_aspect_skin(wpnpos, "weapon_accuracy", wpnsize, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawpic_aspect_skin(weapon_pos, "weapon_accuracy", weapon_size, color, panel_fg_alpha, DRAWFLAG_NORMAL);
                        }
                }
 
-               // draw the weapon icon
-               if(weapons_st & self.weapons)
+               // drawing all the weapon items
+               if(weapons_stat & self.weapons)
                {
-                       drawpic_aspect_skin(wpnpos, strcat("weapon", self.netname), wpnsize, '1 1 1', wpnalpha, DRAWFLAG_NORMAL);
-
-                       if(autocvar_hud_panel_weapons_label == 1) // weapon number
-                               drawstring(wpnpos, ftos(weapid), '1 1 0' * 0.5 * wpnsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                       else if(autocvar_hud_panel_weapons_label == 2) // bind
-                               drawstring(wpnpos, getcommandkey(ftos(weapid), strcat("impulse ", ftos(weapid))), '1 1 0' * 0.5 * wpnsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                       // draw the weapon image
+                       drawpic_aspect_skin(weapon_pos, strcat("weapon", self.netname), weapon_size, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
 
+                       // draw weapon label string
+                       switch(autocvar_hud_panel_weapons_label)
+                       {
+                               case 1: // weapon number
+                                       drawstring(weapon_pos, ftos(weapon_id), '1 1 0' * 0.5 * weapon_size_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       break;
+                                       
+                               case 2: // bind
+                                       drawstring(weapon_pos, getcommandkey(ftos(weapon_id), strcat("impulse ", ftos(weapon_id))), '1 1 0' * 0.5 * weapon_size_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       break;
+                                       
+                               case 3: // weapon name
+                                       drawstring(weapon_pos, self.netname, '1 1 0' * 0.5 * weapon_size_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       break;
+                                       
+                               default: // nothing
+                                       break;
+                       }
+                       
                        // draw ammo status bar
                        if(autocvar_hud_panel_weapons_ammo && self.weapon != WEP_TUBA && self.weapon != WEP_LASER && self.weapon != WEP_PORTO)
                        {
                                a = 0;
-                               type = GetAmmoTypeForWep(self.weapon);
-                               if(type != -1)
-                                       a = getstati(GetAmmoStat(type)); // how much ammo do we have?
+                               ammo_type = GetAmmoTypeForWep(self.weapon);
+                               if(ammo_type != -1)
+                                       a = getstati(GetAmmoStat(ammo_type)); // how much ammo do we have?
 
                                if(a > 0)
                                {
-                                       switch(type) {
-                                               case 0: fullammo = autocvar_hud_panel_weapons_ammo_full_shells; break;
-                                               case 1: fullammo = autocvar_hud_panel_weapons_ammo_full_nails; break;
-                                               case 2: fullammo = autocvar_hud_panel_weapons_ammo_full_rockets; break;
-                                               case 3: fullammo = autocvar_hud_panel_weapons_ammo_full_cells; break;
-                                               case 4: fullammo = autocvar_hud_panel_weapons_ammo_full_fuel; break;
-                                               default: fullammo = 60;
+                                       switch(ammo_type) {
+                                               case 0: ammo_full = autocvar_hud_panel_weapons_ammo_full_shells; break;
+                                               case 1: ammo_full = autocvar_hud_panel_weapons_ammo_full_nails; break;
+                                               case 2: ammo_full = autocvar_hud_panel_weapons_ammo_full_rockets; break;
+                                               case 3: ammo_full = autocvar_hud_panel_weapons_ammo_full_cells; break;
+                                               case 4: ammo_full = autocvar_hud_panel_weapons_ammo_full_fuel; break;
+                                               default: ammo_full = 60;
                                        }
 
                                        drawsetcliparea(
-                                               wpnpos_x + baroffset_x,
-                                               wpnpos_y + baroffset_y,
-                                               barsize_x * bound(0, a/fullammo, 1),
+                                               weapon_pos_x + baroffset_x,
+                                               weapon_pos_y + baroffset_y,
+                                               barsize_x * bound(0, a/ammo_full, 1),
                                                barsize_y);
-                                       drawpic_aspect_skin(wpnpos, "weapon_ammo", wpnsize, ammo_color, ammo_alpha, DRAWFLAG_NORMAL);
+                                       drawpic_aspect_skin(weapon_pos, "weapon_ammo", weapon_size, ammo_color, ammo_alpha, DRAWFLAG_NORMAL);
                                        drawresetcliparea();
                                }
                        }
                }
-
-               // draw a "ghost weapon icon" if you don't have the weapon
-               else
+               else // draw a "ghost weapon icon" if you don't have the weapon
                {
-                       drawpic_aspect_skin(wpnpos, strcat("weapon", self.netname), wpnsize, '0 0 0', panel_fg_alpha * 0.5, DRAWFLAG_NORMAL);
+                       drawpic_aspect_skin(weapon_pos, strcat("weapon", self.netname), weapon_size, '0 0 0', panel_fg_alpha * 0.5, DRAWFLAG_NORMAL);
                }
-
+               
                // draw the complain message
                if(time - complain_weapon_time < when + fadetime && self.weapon == complain_weapon && autocvar_hud_panel_weapons_complainbubble)
                {
                        if(fadetime)
-                       {
-                               if(complain_weapon_time + when > time)
-                                       a = 1;
-                               else
-                                       a = bound(0, (complain_weapon_time + when + fadetime - time) / fadetime, 1);
-                       }
+                               a = ((complain_weapon_time + when > time) ? 1 : bound(0, (complain_weapon_time + when + fadetime - time) / fadetime, 1));
                        else
-                       {
-                               if(complain_weapon_time + when > time)
-                                       a = 1;
-                               else
-                                       a = 0;
-                       }
+                               a = ((complain_weapon_time + when > time) ? 1 : 0);
+
 
                        string s;
                        if(complain_weapon_type == 0) {
@@ -781,10 +793,11 @@ void HUD_Weapons(void)
                                color = stov(autocvar_hud_panel_weapons_complainbubble_color_unavailable);
                        }
                        float padding = autocvar_hud_panel_weapons_complainbubble_padding;
-                       drawpic_aspect_skin(wpnpos + '1 1 0' * padding, "weapon_complainbubble", wpnsize - '2 2 0' * padding, color, a * panel_fg_alpha, DRAWFLAG_NORMAL);
-                       drawstring_aspect(wpnpos + '1 1 0' * padding, s, wpnsize - '2 2 0' * padding, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
+                       drawpic_aspect_skin(weapon_pos + '1 1 0' * padding, "weapon_complainbubble", weapon_size - '2 2 0' * padding, color, a * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring_aspect(weapon_pos + '1 1 0' * padding, s, weapon_size - '2 2 0' * padding, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
                }
 
+               // continue with new position for the next weapon
                ++row;
                if(row >= rows)
                {
@@ -792,7 +805,6 @@ void HUD_Weapons(void)
                        ++column;
                }
        }
-
 }
 
 // Ammo (#1)
@@ -4659,18 +4671,25 @@ 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);
-                       sz = 0.8 + a * (1 - 0.8);
                }
                else if (centerprint_expire_time[j] > time)
                {
                        a = (centerprint_expire_time[j] - time) / centerprint_fadetime;
-                       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
@@ -4728,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';
index f26f65ea54b53d3c7a5d8cd564457416d81755d7..c091a4a60ab54d55b75965632d999dd8a0059eb1 100644 (file)
@@ -64,6 +64,8 @@ void HUD_Panel_ExportCfg(string cfgname)
                                case HUD_PANEL_WEAPONS:
                                        HUD_Write_PanelCvar_q("_complainbubble");
                                        HUD_Write_PanelCvar_q("_complainbubble_padding");
+                                       HUD_Write_PanelCvar_q("_complainbubble_time");
+                                       HUD_Write_PanelCvar_q("_complainbubble_fadetime");
                                        HUD_Write_PanelCvar_q("_complainbubble_color_outofammo");
                                        HUD_Write_PanelCvar_q("_complainbubble_color_donthave");
                                        HUD_Write_PanelCvar_q("_complainbubble_color_unavailable");
@@ -106,6 +108,9 @@ void HUD_Panel_ExportCfg(string cfgname)
                                case HUD_PANEL_RADAR:
                                        HUD_Write_PanelCvar_q("_foreground_alpha");
                                        break;
+                               case HUD_PANEL_SCORE:
+                                       HUD_Write_PanelCvar_q("_rankings");
+                                       break;
                                case HUD_PANEL_VOTE:
                                        HUD_Write_PanelCvar_q("_alreadyvoted_alpha");
                                        break;
index 0187f44e60cc26f3c4d05b2e1d20f10339d8d448..3f8d6caf0d6d9e486988e30dcbe1b7b3325398cc 100644 (file)
@@ -1106,10 +1106,10 @@ float autocvar_sv_eventlog_files_counter;
 string autocvar_sv_eventlog_files_nameprefix;
 string autocvar_sv_eventlog_files_namesuffix;
 float autocvar_sv_eventlog_files_timestamps;
-float autocvar_sv_fragmessage_information_handicap;
-float autocvar_sv_fragmessage_information_ping;
-float autocvar_sv_fragmessage_information_stats;
-float autocvar_sv_fragmessage_information_typefrag;
+float autocvar_sv_fraginfo_handicap;
+float autocvar_sv_fraginfo_ping;
+float autocvar_sv_fraginfo_stats;
+float autocvar_sv_fraginfo_typefrag;
 float autocvar_sv_friction;
 float autocvar_sv_friction_on_land;
 float autocvar_sv_gameplayfix_q2airaccelerate;
index 5a583fc15ad101f07180877866f28641c5247c07..6b0fe0d47825d69c3c67301deda69e3854bfbb02 100644 (file)
@@ -221,6 +221,42 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype)
                UpdateFrags(attacker, f);
 }
 
+string Obituary_ExtraFragInfo(entity player) // Extra fragmessage information
+{
+       string health_output;
+       string ping_output;
+       string handicap_output;
+       string output;
+
+       // health/armor of attacker (person who killed you)
+       if(autocvar_sv_fraginfo_stats && (player.health >= 1))
+               if((autocvar_sv_fraginfo_stats == 2) || !inWarmupStage)
+                       health_output = strcat("^7(Health ^1", ftos(rint(player.health)), "^7 / Armor ^2", ftos(rint(player.armorvalue)), "^7)");
+       
+       // ping display
+       if(autocvar_sv_fraginfo_ping)
+               ping_output = ((clienttype(player) == CLIENTTYPE_BOT) ? "^2Bot" : strcat("Ping ", ((player.ping >= 150) ? "^1" : "^2"), ftos(player.ping), "ms"));
+               
+       // handicap display 
+       if(autocvar_sv_fraginfo_handicap) 
+       {
+               if(autocvar_sv_fraginfo_handicap == 2)  
+                       handicap_output = strcat(output, strcat("Handicap ^2", ((player.cvar_cl_handicap <= 1) ? "Off" : ftos(player.cvar_cl_handicap))));
+               else if(player.cvar_cl_handicap) // with _handicap 1, only show this if there actually is a handicap enabled.   
+                       handicap_output = strcat("Handicap ^2", ftos(player.cvar_cl_handicap));
+       }
+       
+       // format the string
+       output = strcat(health_output, (health_output ? " ^7(" : ((ping_output || handicap_output) ? "^7(" : "")), 
+               ping_output, ((ping_output && handicap_output) ? "^7 / " : ""), 
+               handicap_output, ((ping_output || handicap_output) ? "^7)" : ""));
+       
+       // add new line to the beginning if there is a message
+       if(output) { output = strcat("\n", output); }
+               
+       return output;
+}
+
 string AppendItemcodes(string s, entity player)
 {
        float w;
@@ -367,12 +403,12 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                        PlayerStats_Event(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
                                }
 
-                               if((autocvar_sv_fragmessage_information_typefrag) && (targ.BUTTON_CHAT)) {
-                                       Send_CSQC_KillCenterprint(attacker, s, GetAdvancedDeathReports(targ), KILL_TYPEFRAG, MSG_KILL);
-                                       Send_CSQC_KillCenterprint(targ, a, GetAdvancedDeathReports(attacker), KILL_TYPEFRAGGED, MSG_KILL);
+                               if((autocvar_sv_fraginfo_typefrag) && (targ.BUTTON_CHAT)) {
+                                       Send_CSQC_KillCenterprint(attacker, s, Obituary_ExtraFragInfo(targ), KILL_TYPEFRAG, MSG_KILL);
+                                       Send_CSQC_KillCenterprint(targ, a, Obituary_ExtraFragInfo(attacker), KILL_TYPEFRAGGED, MSG_KILL);
                                } else {
-                                       Send_CSQC_KillCenterprint(attacker, s, GetAdvancedDeathReports(targ), KILL_FRAG, MSG_KILL);
-                                       Send_CSQC_KillCenterprint(targ, a, GetAdvancedDeathReports(attacker), KILL_FRAGGED, MSG_KILL);
+                                       Send_CSQC_KillCenterprint(attacker, s, Obituary_ExtraFragInfo(targ), KILL_FRAG, MSG_KILL);
+                                       Send_CSQC_KillCenterprint(targ, a, Obituary_ExtraFragInfo(attacker), KILL_FRAGGED, MSG_KILL);
                                }
 
                                attacker.taunt_soundtime = time + 1;
index b134886d4f6fcfc54281c1af591fb028650650c8..fc2c0af271a2ca99c6db982e8738b1037f730114 100644 (file)
@@ -392,7 +392,7 @@ void cvar_changes_init()
                BADPREFIX("net_");
                BADPREFIX("prvm_");
                BADPREFIX("skill_");
-               BADPREFIX("sv_fragmessage_");
+               BADPREFIX("sv_fraginfo_");
                BADPREFIX("sv_maxidle_");
                BADPREFIX("sv_vote_");
                BADPREFIX("timelimit_");
index 4a860f03efd783058191ccb3725b391a7e248be7..fc3ce65d20ff7889ed0769609d194626c3c152de 100644 (file)
@@ -79,53 +79,6 @@ string strcat1(string s) = #115; // FRIK_FILE
 float logfile_open;
 float logfile;
 
-string GetAdvancedDeathReports(entity enPlayer) // Extra fragmessage information
-{
-       float nPlayerHealth = rint(enPlayer.health);
-       float nPlayerArmor = rint(enPlayer.armorvalue);
-       float nPlayerHandicap = enPlayer.cvar_cl_handicap;
-       float nPlayerPing = rint(enPlayer.ping);
-       string strPlayerPingColor;
-       string strMessage;
-       
-       if(nPlayerPing >= 150)
-               strPlayerPingColor = "^1";
-       else
-               strPlayerPingColor = "^2";
-
-       if((autocvar_sv_fragmessage_information_stats) && (enPlayer.health >= 1))
-               strMessage = strcat(strMessage, "^7(Health ^1", ftos(nPlayerHealth), "^7 / Armor ^2", ftos(nPlayerArmor), "^7)");
-
-       if(autocvar_sv_fragmessage_information_ping) {
-               if(clienttype(enPlayer) == CLIENTTYPE_BOT) // Bots have no ping
-                       strMessage = strcat(strMessage, " ^7(^2Bot");
-               else
-                       strMessage = strcat(strMessage, " ^7(Ping ", strPlayerPingColor, ftos(nPlayerPing), "ms");
-               if(autocvar_sv_fragmessage_information_handicap)
-                       if(autocvar_sv_fragmessage_information_handicap == 2)
-                               if(nPlayerHandicap <= 1)
-                                       strMessage = strcat(strMessage, "^7 / Handicap ^2Off^7)");
-                               else
-                                       strMessage = strcat(strMessage, "^7 / Handicap ^2", ftos(nPlayerHandicap), "^7)");
-                       else if not(nPlayerHandicap <= 1)
-                               strMessage = strcat(strMessage, "^7 / Handicap ^2", ftos(nPlayerHandicap), "^7)");
-               else
-                       strMessage = strcat(strMessage, "^7)");
-       } else if(autocvar_sv_fragmessage_information_handicap) {
-               if(autocvar_sv_fragmessage_information_handicap == 2)
-                       if(nPlayerHandicap <= 1)
-                               strMessage = strcat(strMessage, "^7(Handicap ^2Off^7)");
-                       else
-                               strMessage = strcat(strMessage, "^7(Handicap ^2", ftos(nPlayerHandicap), "^7)");
-               else if(nPlayerHandicap > 1)
-                       strMessage = strcat(strMessage, "^7(Handicap ^2", ftos(nPlayerHandicap), "^7)");
-       }
-       
-       if(strMessage) // add new line to the beginning if there is a message
-               strMessage = strcat("\n", strMessage);
-               
-       return strMessage;
-}
 void bcenterprint(string s)
 {
     // TODO replace by MSG_ALL (would show it to spectators too, though)?
index c52043b9775b5b5e9702de536ca70fb699aa97e4..ec333cc724d1291abcd11285b391037181c784e5 100644 (file)
@@ -578,27 +578,27 @@ float w_electro(float req)
        else if (req == WR_SUICIDEMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s could not remember where they put plasma");
+                       w_deathtypestring = _("%s could not remember where they put their electro plasma");
                else
-                       w_deathtypestring = _("%s played with plasma");
+                       w_deathtypestring = _("%s played with electro plasma");
        }
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
                {
                        if(w_deathtype & HITTYPE_SPLASH) // unchecked: BOUNCE
-                               w_deathtypestring = _("%s just noticed %s's blue ball");
+                               w_deathtypestring = _("%s just noticed %s's electro plasma");
                        else // unchecked: BOUNCE
-                               w_deathtypestring = _("%s got in touch with %s's blue ball");
+                               w_deathtypestring = _("%s got in touch with %s's electro plasma");
                }
                else
                {
                        if(w_deathtype & HITTYPE_BOUNCE) // combo
-                               w_deathtypestring = _("%s felt the electrifying air of %s's combo");
+                               w_deathtypestring = _("%s felt the electrifying air of %s's electro combo");
                        else if(w_deathtype & HITTYPE_SPLASH)
-                               w_deathtypestring = _("%s got too close to %s's blue beam");
+                               w_deathtypestring = _("%s got too close to %s's blue electro bolt");
                        else
-                               w_deathtypestring = _("%s was blasted by %s's blue beam");
+                               w_deathtypestring = _("%s was blasted by %s's blue electro bolt");
                }
        }
        return TRUE;
index bb073a988cd2ae1c6daaf3fd28543d9490c28b40..352ce883bd255fb49c9ebf0ff95bdb9bf40c06f1 100644 (file)
@@ -385,9 +385,9 @@ float w_glauncher(float req)
        else if (req == WR_SUICIDEMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s tried out his own grenade");
+                       w_deathtypestring = _("%s didn't see their own grenade");
                else
-                       w_deathtypestring = _("%s detonated");
+                       w_deathtypestring = _("%s blew themself up with their grenadelauncher");
        }
        else if (req == WR_KILLMESSAGE)
        {
index 12abae6eac7463294df678d82cf4e496263665e1..e6467e4549a60d8c7779845f467c7c3339da8a03 100644 (file)
@@ -459,13 +459,13 @@ float w_hagar(float req)
                precache_sound("weapons/hagexp3.wav");
        }
        else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s played with tiny rockets");
+               w_deathtypestring = _("%s played with tiny hagar rockets");
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_BOUNCE) // must be secondary; unchecked: SPLASH
-                       w_deathtypestring = _("%s hoped %s's missiles wouldn't bounce");
+                       w_deathtypestring = _("%s was pummeled with a burst of hagar rockets by %s");
                else // unchecked: SPLASH, SECONDARY
-                       w_deathtypestring = _("%s was pummeled by %s");
+                       w_deathtypestring = _("%s was pummeled with hagar rockets by %s");
        }
        return TRUE;
 }
index c8ea61ed6b3a2128bfd43e1baab2ab8b8f06421d..2eb2918ed6c41a138683ff19df07ee427e8ebb8e 100644 (file)
@@ -239,7 +239,7 @@ float w_hlac(float req)
        else if (req == WR_SUICIDEMESSAGE)
                w_deathtypestring = _("%s should have used a smaller gun");
        else if (req == WR_KILLMESSAGE)
-               w_deathtypestring = _("%s was cut down by %s");
+               w_deathtypestring = _("%s was cut down with a HLAC by %s");
        return TRUE;
 }
 #endif
index 6feacc7d5ef01c2478800e277e25677348cef085..695ac381fe55afcaeb750f2890e313addb6ef915 100644 (file)
@@ -285,7 +285,7 @@ float w_hook(float req)
        else if (req == WR_SUICIDEMESSAGE)
                w_deathtypestring = _("%s did the impossible");
        else if (req == WR_KILLMESSAGE)
-               w_deathtypestring = _("%s has run into %s's gravity bomb");
+               w_deathtypestring = _("%s was caught in %s's hook gravity bomb");
        return TRUE;
 }
 #endif
index 03c2651289418644b01006f2f62ef30c42a06a78..afe37b56f7b6680bcd143f88d0a460288b11481c 100644 (file)
@@ -529,7 +529,10 @@ float w_minelayer(float req)
                precache_sound("weapons/mine_exp.wav");
        }
        else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s exploded");
+               if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)
+                       w_deathtypestring = _("%s blew themself up with their minelayer");
+               else
+                       w_deathtypestring = _("%s forgot about their mine");
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)
index 6901e2b2d38b822c2972941fb81abff5321c0e09..1dfc281732e88925f33887d24969700bb98d30d8 100644 (file)
@@ -292,7 +292,7 @@ float w_minstanex(float req)
        else if (req == WR_SUICIDEMESSAGE)
                w_deathtypestring = _("%s is now thinking with portals");
        else if (req == WR_KILLMESSAGE)
-               w_deathtypestring = _("%s has been vaporized by %s");
+               w_deathtypestring = _("%s has been vaporized by %s's minstanex");
        return TRUE;
 }
 #endif
index 994864dce0fcd227198bcb90ca07771580ed2de1..3f47b48fd073b149cfdb6b386f226442badd668a 100644 (file)
@@ -252,7 +252,7 @@ float w_nex(float req)
        else if (req == WR_SUICIDEMESSAGE)
                w_deathtypestring = _("%s is now thinking with portals");
        else if (req == WR_KILLMESSAGE)
-               w_deathtypestring = _("%s has been vaporized by %s");
+               w_deathtypestring = _("%s has been vaporized by %s's nex");
        return TRUE;
 }
 #endif
index 43f8a6cfb334b2a462eb65c66618616f6bcb8766..89cb37257d07966aad54751e8dce15d90af11666 100644 (file)
@@ -229,19 +229,16 @@ float w_rifle(float req)
        }
        else if (req == WR_SUICIDEMESSAGE)
        {
-               if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s shot themself automatically");
-               else
-                       w_deathtypestring = _("%s sniped themself somehow");
+               w_deathtypestring = _("%s is now thinking with portals");
        }
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
                {
                        if(w_deathtype & HITTYPE_BOUNCE)
-                               w_deathtypestring = _("%s failed to hide from %s's bullet hail");
+                               w_deathtypestring = _("%s failed to hide from %s's rifle bullet hail");
                        else
-                               w_deathtypestring = _("%s died in %s's bullet hail");
+                               w_deathtypestring = _("%s died in %s's rifle bullet hail");
                }
                else
                {
@@ -253,9 +250,9 @@ float w_rifle(float req)
                        else
                        {
                                if(w_deathtype & HITTYPE_HEADSHOT)
-                                       w_deathtypestring = _("%s got hit in the head by %s");
+                                       w_deathtypestring = _("%s got shot in the head with a rifle by %s");
                                else
-                                       w_deathtypestring = _("%s was sniped by %s");
+                                       w_deathtypestring = _("%s was sniped with a rifle by %s");
                        }
                }
        }
index 11b39527ede1326f9f3e2cf42d553f02a50c728c..723389e7121e5d7536f5f7bf07aec65847548092 100644 (file)
@@ -504,7 +504,7 @@ float w_rlauncher(float req)
                precache_sound("weapons/rocket_impact.wav");
        }
        else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s exploded");
+               w_deathtypestring = _("%s blew themself up with their rocketlauncher");
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_BOUNCE) // (remote detonation)
index 83a374ea7d213cb22c397b41ac59d9a4bf2fc6de..c4c08bb51230983d2b80abe456a567eff56f53c0 100644 (file)
@@ -658,13 +658,13 @@ float w_seeker(float req)
                precache_sound("weapons/tag_impact.wav");
        }
        else if (req == WR_SUICIDEMESSAGE)
-               w_deathtypestring = _("%s played with tiny rockets");
+               w_deathtypestring = _("%s played with tiny seeker rockets");
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s was tagged by %s");
+                       w_deathtypestring = _("%s was tagged with a seeker by %s");
                else
-                       w_deathtypestring = _("%s was pummeled by %s");
+                       w_deathtypestring = _("%s was pummeled with seeker rockets by %s");
        }
        return TRUE;
 }
index 2be9e44a6f9c6f091751b95782145a8bc329972f..6e8fa00f9677a4d0e7fe774a55ef4c92bbf23b0f 100644 (file)
@@ -268,9 +268,9 @@ float w_shotgun(float req)
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%2$s ^7slapped %1$s ^7around a bit with a large ^2shotgun");
+                       w_deathtypestring = _("%2$s slapped %1$s around a bit with a large shotgun");
                else
-                       w_deathtypestring = _("%s was gunned by %s");
+                       w_deathtypestring = _("%s was gunned down with a shotgun by %s");
        }
        return TRUE;
 }
index f5bacd22036ea554c2835b434725b0496110b3ad..8f6aa521f369a020208b3d9d6fdc4907865cd64d 100644 (file)
@@ -319,9 +319,9 @@ float w_uzi(float req)
        else if (req == WR_KILLMESSAGE)
        {
                if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = _("%s was sniped by %s");
+                       w_deathtypestring = _("%s was sniped by %s's machine gun");
                else
-                       w_deathtypestring = _("%s was riddled full of holes by %s");
+                       w_deathtypestring = _("%s was riddled full of holes by %s's machine gun");
        }
        return TRUE;
 }