]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/itemstime
authorterencehill <piuntn@gmail.com>
Tue, 20 Jan 2015 16:51:44 +0000 (17:51 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 20 Jan 2015 16:51:44 +0000 (17:51 +0100)
Conflicts:
_hud_descriptions.cfg
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
qcsrc/client/hud.qc
qcsrc/client/hud.qh
qcsrc/client/waypointsprites.qc
qcsrc/common/constants.qh
qcsrc/common/util.qh
qcsrc/menu/classes.c
qcsrc/menu/xonotic/mainwindow.c
qcsrc/server/arena.qc
qcsrc/server/cl_client.qc
qcsrc/server/defs.qh
qcsrc/server/g_world.qc
qcsrc/server/t_items.qc

41 files changed:
_hud_common.cfg
_hud_descriptions.cfg
defaultXonotic.cfg
gfx/hud/default/fuelregen.tga [new file with mode: 0644]
gfx/hud/default/item_large_armor.tga [new file with mode: 0644]
gfx/hud/default/item_mega_health.tga [new file with mode: 0644]
gfx/hud/default/item_shield.tga [new file with mode: 0644]
gfx/hud/default/item_strength.tga [new file with mode: 0644]
gfx/hud/default/jetpack.tga [new file with mode: 0644]
gfx/hud/luminos/fuelregen.tga [new file with mode: 0644]
gfx/hud/luminos/item_large_armor.tga [new file with mode: 0644]
gfx/hud/luminos/item_mega_health.tga [new file with mode: 0644]
gfx/hud/luminos/item_shield.tga [new file with mode: 0644]
gfx/hud/luminos/item_strength.tga [new file with mode: 0644]
gfx/hud/luminos/jetpack.tga [new file with mode: 0644]
gfx/hud/old/item_large_armor.tga [new file with mode: 0644]
gfx/hud/old/item_mega_health.tga [new file with mode: 0644]
gfx/hud/old/item_shield.tga [new file with mode: 0644]
gfx/hud/old/item_strength.tga [new file with mode: 0644]
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_minimal_xhair.cfg
hud_luminos_old.cfg
hud_nexuiz.cfg
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc
qcsrc/client/hud.qh
qcsrc/client/hud_config.qc
qcsrc/client/waypointsprites.qc
qcsrc/common/constants.qh
qcsrc/common/stats.qh
qcsrc/common/util.qh
qcsrc/menu/classes.c
qcsrc/menu/xonotic/dialog_hudpanel_itemstime.c [new file with mode: 0644]
qcsrc/menu/xonotic/mainwindow.c
qcsrc/server/cl_client.qc
qcsrc/server/command/vote.qc
qcsrc/server/defs.qh
qcsrc/server/g_world.qc
qcsrc/server/t_items.qc
qcsrc/server/waypointsprites.qc

index 5aa1bbfeea3203469aedb2a4b248d08951d12617..1bdea1c34bf5192bf01b8351f6493b8ddc968689 100644 (file)
@@ -38,6 +38,8 @@ seta hud_panel_engineinfo_framecounter_exponentialmovingaverage 1 "use an averag
 seta hud_panel_engineinfo_framecounter_exponentialmovingaverage_new_weight 0.1 "weight of latest data point"
 seta hud_panel_engineinfo_framecounter_exponentialmovingaverage_instantupdate_change_threshold 0.5 "threshold for fps change when to update instantly, to make big fps changes update faster"
 
+seta hud_panel_itemstime_progressbar_maxtime "30" "when left time is at least this amount, the status bar is full"
+
 // hud panel aliases
 alias hud_panel_radar_rotate "toggle hud_panel_radar_rotation 0 1 2 3 4"
 alias +hud_panel_radar_maximized "cl_cmd hud radar 1"
index 270bd2bd9294693bcbf787666f7b3b2d341e2141..5493eceda289effc2eb9e99f3721125822541378 100644 (file)
@@ -307,3 +307,21 @@ seta hud_panel_buffs_bg_color_team "" "override panel color with team color in t
 seta hud_panel_buffs_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
 seta hud_panel_buffs_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_buffs_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+
+seta hud_panel_itemstime "" "enable/disable this panel, it shows left time until important items (mega health, large armor, powerups, superweapons, etc...) respawn in the map: 1 when spectating, 2 even playing in warmup stage"
+seta hud_panel_itemstime_pos "" "position of this base of the panel"
+seta hud_panel_itemstime_size "" "size of this panel"
+seta hud_panel_itemstime_bg "" "if set to something else than \"\" = override default background"
+seta hud_panel_itemstime_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_panel_itemstime_bg_color_team "" "override panel color with team color in team based games"
+seta hud_panel_itemstime_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_panel_itemstime_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_panel_itemstime_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+seta hud_panel_itemstime_iconalign "" "0 = align icons to the left, 1 = align icons to the right"
+seta hud_panel_itemstime_progressbar "" "use progressbar behind icons"
+seta hud_panel_itemstime_progressbar_name "" "name of progressbar to use behind icons"
+seta hud_panel_itemstime_progressbar_reduced "" "progressbar is displayed only in the text field"
+seta hud_panel_itemstime_showspawned "" "show icons of already spawned items"
+seta hud_panel_itemstime_text "" "show text"
+seta hud_panel_itemstime_ratio "" "ratio between space reserved for text and icon width of each item entry (min value is 2)"
+seta hud_panel_itemstime_size_dinamic "" "reduce panel size by removing spacing beetwen items"
index df7044ce562a41c915e9d59d7dc9d7ba5996b683..142d5f83d3762221fddafd6c982f45b8ae1e8963 100644 (file)
@@ -752,6 +752,7 @@ seta g_waypointsprite_crosshairfadedistance 150 "distance in virtual pixels from
 seta g_waypointsprite_distancefadealpha 1 "alpha multiplier near distance"
 seta g_waypointsprite_distancefadescale 0.7 "scale multiplier near the distance"
 seta g_waypointsprite_distancefadedistancemultiplier 0.5 "distance in map sizes from distance where to stop fading"
+seta g_waypointsprite_itemstime 2 "show waypoints to indicate that some important items (mega health, large armor) are about to respawn: 1 when spectating, 2 even playing in warmup stage"
 set g_waypointsprite_spam 0 "Debugging feature. Set to 10 and load courtfun in race mode to test."
 alias "g_waypointsprite_personal"      "impulse 30"
 alias "g_waypointsprite_personal_p"    "impulse 31"
diff --git a/gfx/hud/default/fuelregen.tga b/gfx/hud/default/fuelregen.tga
new file mode 100644 (file)
index 0000000..3f3a891
Binary files /dev/null and b/gfx/hud/default/fuelregen.tga differ
diff --git a/gfx/hud/default/item_large_armor.tga b/gfx/hud/default/item_large_armor.tga
new file mode 100644 (file)
index 0000000..6d84530
Binary files /dev/null and b/gfx/hud/default/item_large_armor.tga differ
diff --git a/gfx/hud/default/item_mega_health.tga b/gfx/hud/default/item_mega_health.tga
new file mode 100644 (file)
index 0000000..75515eb
Binary files /dev/null and b/gfx/hud/default/item_mega_health.tga differ
diff --git a/gfx/hud/default/item_shield.tga b/gfx/hud/default/item_shield.tga
new file mode 100644 (file)
index 0000000..da87b64
Binary files /dev/null and b/gfx/hud/default/item_shield.tga differ
diff --git a/gfx/hud/default/item_strength.tga b/gfx/hud/default/item_strength.tga
new file mode 100644 (file)
index 0000000..ed0e8a8
Binary files /dev/null and b/gfx/hud/default/item_strength.tga differ
diff --git a/gfx/hud/default/jetpack.tga b/gfx/hud/default/jetpack.tga
new file mode 100644 (file)
index 0000000..ba76c45
Binary files /dev/null and b/gfx/hud/default/jetpack.tga differ
diff --git a/gfx/hud/luminos/fuelregen.tga b/gfx/hud/luminos/fuelregen.tga
new file mode 100644 (file)
index 0000000..3f3a891
Binary files /dev/null and b/gfx/hud/luminos/fuelregen.tga differ
diff --git a/gfx/hud/luminos/item_large_armor.tga b/gfx/hud/luminos/item_large_armor.tga
new file mode 100644 (file)
index 0000000..6d84530
Binary files /dev/null and b/gfx/hud/luminos/item_large_armor.tga differ
diff --git a/gfx/hud/luminos/item_mega_health.tga b/gfx/hud/luminos/item_mega_health.tga
new file mode 100644 (file)
index 0000000..75515eb
Binary files /dev/null and b/gfx/hud/luminos/item_mega_health.tga differ
diff --git a/gfx/hud/luminos/item_shield.tga b/gfx/hud/luminos/item_shield.tga
new file mode 100644 (file)
index 0000000..da87b64
Binary files /dev/null and b/gfx/hud/luminos/item_shield.tga differ
diff --git a/gfx/hud/luminos/item_strength.tga b/gfx/hud/luminos/item_strength.tga
new file mode 100644 (file)
index 0000000..ed0e8a8
Binary files /dev/null and b/gfx/hud/luminos/item_strength.tga differ
diff --git a/gfx/hud/luminos/jetpack.tga b/gfx/hud/luminos/jetpack.tga
new file mode 100644 (file)
index 0000000..ba76c45
Binary files /dev/null and b/gfx/hud/luminos/jetpack.tga differ
diff --git a/gfx/hud/old/item_large_armor.tga b/gfx/hud/old/item_large_armor.tga
new file mode 100644 (file)
index 0000000..5f43ab1
Binary files /dev/null and b/gfx/hud/old/item_large_armor.tga differ
diff --git a/gfx/hud/old/item_mega_health.tga b/gfx/hud/old/item_mega_health.tga
new file mode 100644 (file)
index 0000000..71c3d6d
Binary files /dev/null and b/gfx/hud/old/item_mega_health.tga differ
diff --git a/gfx/hud/old/item_shield.tga b/gfx/hud/old/item_shield.tga
new file mode 100644 (file)
index 0000000..58cb73b
Binary files /dev/null and b/gfx/hud/old/item_shield.tga differ
diff --git a/gfx/hud/old/item_strength.tga b/gfx/hud/old/item_strength.tga
new file mode 100644 (file)
index 0000000..0f7689d
Binary files /dev/null and b/gfx/hud/old/item_strength.tga differ
index f3bc914e6a48be696bd9e3b8879eb90d9ab0254f..212717f97a80c1ec1fbc04c36fca8b4b75b731a0 100644 (file)
@@ -24,7 +24,7 @@ seta hud_progressbar_speed_color "1 0.75 0"
 seta hud_progressbar_acceleration_color "0.5 0.75 1"
 seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 
-seta _hud_panelorder "15 12 9 10 5 6 14 0 7 4 11 2 1 3 8 13 16 "
+seta _hud_panelorder "15 12 9 10 5 6 14 0 7 4 11 2 1 3 8 13 16 17 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
@@ -306,4 +306,22 @@ seta hud_panel_buffs_bg_alpha ""
 seta hud_panel_buffs_bg_border ""
 seta hud_panel_buffs_bg_padding ""
 
+seta hud_panel_itemstime 2
+seta hud_panel_itemstime_pos "0.030000 0.260000"
+seta hud_panel_itemstime_size "0.070000 0.230000"
+seta hud_panel_itemstime_bg "border_itemstime"
+seta hud_panel_itemstime_bg_color ""
+seta hud_panel_itemstime_bg_color_team ""
+seta hud_panel_itemstime_bg_alpha ""
+seta hud_panel_itemstime_bg_border ""
+seta hud_panel_itemstime_bg_padding ""
+seta hud_panel_itemstime_iconalign "0"
+seta hud_panel_itemstime_progressbar "0"
+seta hud_panel_itemstime_progressbar_name "progressbar"
+seta hud_panel_itemstime_progressbar_reduced "0"
+seta hud_panel_itemstime_showspawned "0"
+seta hud_panel_itemstime_text "1"
+seta hud_panel_itemstime_ratio "2"
+seta hud_panel_itemstime_size_dinamic "1"
+
 menu_sync
index 050689b38caf95d525f07e83f378649fc49dafff..b1a934605b4ece245694b9213f9a4cd13512d662 100644 (file)
@@ -24,7 +24,7 @@ seta hud_progressbar_speed_color "1 0.75 0"
 seta hud_progressbar_acceleration_color "0.5 0.75 1"
 seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 
-seta _hud_panelorder "10 3 0 14 6 9 13 4 1 2 11 12 7 5 8 15 16 "
+seta _hud_panelorder "10 3 0 14 6 9 13 4 1 2 11 12 7 5 8 15 16 17 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
@@ -306,4 +306,22 @@ seta hud_panel_buffs_bg_alpha ""
 seta hud_panel_buffs_bg_border ""
 seta hud_panel_buffs_bg_padding ""
 
+seta hud_panel_itemstime 2
+seta hud_panel_itemstime_pos "0.000000 0.310000"
+seta hud_panel_itemstime_size "0.070000 0.180000"
+seta hud_panel_itemstime_bg ""
+seta hud_panel_itemstime_bg_color ""
+seta hud_panel_itemstime_bg_color_team ""
+seta hud_panel_itemstime_bg_alpha ""
+seta hud_panel_itemstime_bg_border ""
+seta hud_panel_itemstime_bg_padding ""
+seta hud_panel_itemstime_iconalign "0"
+seta hud_panel_itemstime_progressbar "0"
+seta hud_panel_itemstime_progressbar_name "progressbar"
+seta hud_panel_itemstime_progressbar_reduced "0"
+seta hud_panel_itemstime_showspawned "0"
+seta hud_panel_itemstime_text "1"
+seta hud_panel_itemstime_ratio "2"
+seta hud_panel_itemstime_size_dinamic "1"
+
 menu_sync
index 8fb6cbe93da88fd67f099c634126551449435fdf..b88d4683c3d49fd76f1da639b8b5f931d0acc16b 100644 (file)
@@ -24,7 +24,7 @@ seta hud_progressbar_speed_color "1 0.75 0"
 seta hud_progressbar_acceleration_color "0.5 0.75 1"
 seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 
-seta _hud_panelorder "15 3 1 2 11 10 0 14 6 9 13 4 12 7 5 8 16 "
+seta _hud_panelorder "15 3 1 2 11 10 0 14 6 9 13 4 12 7 5 8 16 17 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
@@ -306,4 +306,22 @@ seta hud_panel_buffs_bg_alpha ""
 seta hud_panel_buffs_bg_border ""
 seta hud_panel_buffs_bg_padding ""
 
+seta hud_panel_itemstime 2
+seta hud_panel_itemstime_pos "0.000000 0.310000"
+seta hud_panel_itemstime_size "0.070000 0.180000"
+seta hud_panel_itemstime_bg ""
+seta hud_panel_itemstime_bg_color ""
+seta hud_panel_itemstime_bg_color_team ""
+seta hud_panel_itemstime_bg_alpha ""
+seta hud_panel_itemstime_bg_border ""
+seta hud_panel_itemstime_bg_padding ""
+seta hud_panel_itemstime_iconalign "0"
+seta hud_panel_itemstime_progressbar "0"
+seta hud_panel_itemstime_progressbar_name "progressbar"
+seta hud_panel_itemstime_progressbar_reduced "0"
+seta hud_panel_itemstime_showspawned "0"
+seta hud_panel_itemstime_text "1"
+seta hud_panel_itemstime_ratio "2"
+seta hud_panel_itemstime_size_dinamic "1"
+
 menu_sync
index 9d71e2e2872cc4f4d6e0624a2d2b5e74064fa5cf..896af911fe9bcd709a2a3ff535c6c8f2d9cad37e 100644 (file)
@@ -24,7 +24,7 @@ seta hud_progressbar_speed_color "1 0.75 0"
 seta hud_progressbar_acceleration_color "0.5 0.75 1"
 seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 
-seta _hud_panelorder "15 10 9 6 8 14 5 0 4 13 2 7 1 3 11 12 16 "
+seta _hud_panelorder "15 10 9 6 8 14 5 0 4 13 2 7 1 3 11 12 16 17 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
@@ -306,4 +306,22 @@ seta hud_panel_buffs_bg_alpha ""
 seta hud_panel_buffs_bg_border ""
 seta hud_panel_buffs_bg_padding ""
 
+seta hud_panel_itemstime 2
+seta hud_panel_itemstime_pos "0.020000 0.490000"
+seta hud_panel_itemstime_size "0.090000 0.140000"
+seta hud_panel_itemstime_bg "0"
+seta hud_panel_itemstime_bg_color ""
+seta hud_panel_itemstime_bg_color_team ""
+seta hud_panel_itemstime_bg_alpha ""
+seta hud_panel_itemstime_bg_border ""
+seta hud_panel_itemstime_bg_padding ""
+seta hud_panel_itemstime_iconalign "0"
+seta hud_panel_itemstime_progressbar "1"
+seta hud_panel_itemstime_progressbar_name "progressbar"
+seta hud_panel_itemstime_progressbar_reduced "1"
+seta hud_panel_itemstime_showspawned "0"
+seta hud_panel_itemstime_text "1"
+seta hud_panel_itemstime_ratio "3.5"
+seta hud_panel_itemstime_size_dinamic "1"
+
 menu_sync
index 9e4678293d627419612564b5d12d91a4365d56fc..af05512d0b9589dd7d16619ffe9ebb918829318a 100644 (file)
@@ -24,7 +24,7 @@ seta hud_progressbar_speed_color "1 0.75 0"
 seta hud_progressbar_acceleration_color "0.5 0.75 1"
 seta hud_progressbar_acceleration_neg_color "0.125 0.25 0.5"
 
-seta _hud_panelorder "15 0 11 8 5 6 14 9 13 7 2 3 1 10 12 4 16 "
+seta _hud_panelorder "15 0 11 8 5 6 14 9 13 7 2 3 1 10 12 4 16 17 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.01"
@@ -306,4 +306,22 @@ seta hud_panel_buffs_bg_alpha ""
 seta hud_panel_buffs_bg_border ""
 seta hud_panel_buffs_bg_padding ""
 
+seta hud_panel_itemstime 2
+seta hud_panel_itemstime_pos "0.000000 0.290000"
+seta hud_panel_itemstime_size "0.150000 0.060000"
+seta hud_panel_itemstime_bg "0"
+seta hud_panel_itemstime_bg_color ""
+seta hud_panel_itemstime_bg_color_team ""
+seta hud_panel_itemstime_bg_alpha ""
+seta hud_panel_itemstime_bg_border ""
+seta hud_panel_itemstime_bg_padding ""
+seta hud_panel_itemstime_iconalign "0"
+seta hud_panel_itemstime_progressbar "0"
+seta hud_panel_itemstime_progressbar_name "progressbar"
+seta hud_panel_itemstime_progressbar_reduced "0"
+seta hud_panel_itemstime_showspawned "0"
+seta hud_panel_itemstime_text "1"
+seta hud_panel_itemstime_ratio "2"
+seta hud_panel_itemstime_size_dinamic "1"
+
 menu_sync
index f06c5bfb3bd0f66e6dbc25ad67f201587b50a7c0..bf5e72be42292ecbc80713bb07b5ab93fab2d713 100644 (file)
@@ -170,6 +170,7 @@ float autocvar_g_waypointsprite_edgeoffset_left;
 float autocvar_g_waypointsprite_edgeoffset_right;
 float autocvar_g_waypointsprite_edgeoffset_top;
 float autocvar_g_waypointsprite_fontsize;
+float autocvar_g_waypointsprite_itemstime;
 float autocvar_g_waypointsprite_minalpha;
 float autocvar_g_waypointsprite_minscale;
 float autocvar_g_waypointsprite_normdistance;
@@ -266,6 +267,16 @@ float autocvar_hud_panel_healtharmor_progressbar_gfx_smooth;
 float autocvar_hud_panel_healtharmor_text;
 float autocvar_hud_panel_infomessages;
 float autocvar_hud_panel_infomessages_flip;
+float autocvar_hud_panel_itemstime;
+float autocvar_hud_panel_itemstime_size_dinamic;
+float autocvar_hud_panel_itemstime_ratio;
+float autocvar_hud_panel_itemstime_iconalign;
+float autocvar_hud_panel_itemstime_progressbar;
+float autocvar_hud_panel_itemstime_progressbar_maxtime;
+string autocvar_hud_panel_itemstime_progressbar_name;
+float autocvar_hud_panel_itemstime_progressbar_reduced;
+float autocvar_hud_panel_itemstime_showspawned;
+float autocvar_hud_panel_itemstime_text;
 float autocvar_hud_panel_modicons;
 float autocvar_hud_panel_modicons_ca_layout;
 float autocvar_hud_panel_modicons_dom_layout;
index 8a9aab304c4b7fecf0f09ecc3857660aa97a33b1..9df07461c9bac2f400ef8bfbe8f756f36782739b 100644 (file)
@@ -4470,6 +4470,214 @@ void HUD_Buffs(void)
        draw_endBoldFont();
 }
 
+// ItemsTime (#XX)
+//
+const float ITEMSTIME_MAXITEMS = 10;
+float ItemsTime_time[ITEMSTIME_MAXITEMS];
+string GetItemsTimePicture(float i)
+{
+       switch(i)
+       {
+               case 0: return "item_large_armor";
+               case 1: return "item_mega_health";
+               case 2: return "item_strength";
+               case 3: return "item_shield";
+               case 4: return "item_mega_health";
+               case 5: return "item_strength";
+               case 6: return "item_shield";
+               case 7: return "fuelregen";
+               case 8: return "jetpack";
+               case 9: return "superweapons";
+               default: return "";
+       }
+}
+
+void DrawItemsTimeItem(vector myPos, vector mySize, float ar, float itemcode)
+{
+       float t = 0;
+       vector color = '0 0 0';
+       float picalpha;
+       if(ItemsTime_time[itemcode] <= time)
+       {
+               float BLINK_FACTOR = 0.15;
+               float BLINK_BASE = 0.85;
+               float BLINK_FREQ = 5;
+               picalpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
+       }
+       else
+       {
+               picalpha = 1;
+               t = floor(ItemsTime_time[itemcode] - time + 0.999);
+               if(t < 5)
+                       color = '0.7 0 0';
+               else if(t < 10)
+                       color = '0.7 0.7 0';
+               else
+                       color = '1 1 1';
+       }
+
+       vector picpos, numpos;
+       if(autocvar_hud_panel_itemstime_iconalign)
+       {
+               numpos = myPos;
+               picpos = myPos + eX * (ar - 1) * mySize_y;
+       }
+       else
+       {
+               numpos = myPos + eX * mySize_y;
+               picpos = myPos;
+       }
+
+       if(t > 0 && autocvar_hud_panel_itemstime_progressbar)
+       {
+               vector p_pos, p_size;
+               if(autocvar_hud_panel_itemstime_progressbar_reduced)
+               {
+                       p_pos = numpos;
+                       p_size = eX * ((ar - 1)/ar) * mySize_x + eY * mySize_y;
+               }
+               else
+               {
+                       p_pos = myPos;
+                       p_size = mySize;
+               }
+               HUD_Panel_DrawProgressBar(p_pos, p_size, autocvar_hud_panel_itemstime_progressbar_name, t/autocvar_hud_panel_itemstime_progressbar_maxtime, 0, autocvar_hud_panel_itemstime_iconalign, color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+       }
+
+       if(t > 0 && autocvar_hud_panel_itemstime_text)
+               drawstring_aspect(numpos, ftos(t), eX * ((ar - 1)/ar) * mySize_x + eY * mySize_y, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawpic_aspect_skin(picpos, GetItemsTimePicture(itemcode), '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha * picalpha, DRAWFLAG_NORMAL);
+}
+
+void HUD_ItemsTime(void)
+{
+       if(!autocvar__hud_configure)
+       {
+               if not((autocvar_hud_panel_itemstime == 1 && spectatee_status != 0)
+               || (autocvar_hud_panel_itemstime == 2 && (spectatee_status != 0 || warmup_stage)))
+                       return;
+
+               ItemsTime_time[0] = getstatf(STAT_ARMOR_LARGE_TIME);
+               ItemsTime_time[1] = getstatf(STAT_HEALTH_MEGA_TIME);
+               ItemsTime_time[2] = getstatf(STAT_INVISIBLE_TIME);
+               ItemsTime_time[3] = getstatf(STAT_SPEED_TIME);
+               ItemsTime_time[4] = getstatf(STAT_EXTRALIFE_TIME);
+               ItemsTime_time[5] = getstatf(STAT_STRENGTH_TIME);
+               ItemsTime_time[6] = getstatf(STAT_SHIELD_TIME);
+               ItemsTime_time[7] = getstatf(STAT_FUELREGEN_TIME);
+               ItemsTime_time[8] = getstatf(STAT_JETPACK_TIME);
+               ItemsTime_time[9] = getstatf(STAT_SUPERWEAPONS_TIME);
+       }
+       else
+       {
+               // do not show here mutator-dependent items
+               ItemsTime_time[0] = time + 0;
+               ItemsTime_time[1] = time + 8;
+               ItemsTime_time[2] = -1; // mutator-dependent
+               ItemsTime_time[3] = -1; // mutator-dependent
+               ItemsTime_time[4] = -1; // mutator-dependent
+               ItemsTime_time[5] = time + 0;
+               ItemsTime_time[6] = time + 4;
+               ItemsTime_time[7] = time + 49;
+               ItemsTime_time[8] = -1;
+               ItemsTime_time[9] = time + 28;
+       }
+
+       float i;
+       float count = 0;
+       if (autocvar_hud_panel_itemstime_showspawned)
+               for (i = 0; i < ITEMSTIME_MAXITEMS; ++i)
+                       count += (ItemsTime_time[i] != -1);
+       else
+               for (i = 0; i < ITEMSTIME_MAXITEMS; ++i)
+                       count += (ItemsTime_time[i] > time);
+       if (count == 0)
+               return;
+
+       HUD_Panel_UpdateCvars();
+
+       vector pos, mySize;
+       pos = panel_pos;
+       mySize = panel_size;
+
+       if(panel_bg_padding)
+       {
+               pos += '1 1 0' * panel_bg_padding;
+               mySize -= '2 2 0' * panel_bg_padding;
+       }
+
+       float rows, columns;
+       float ar = max(2, autocvar_hud_panel_itemstime_ratio) + 1;
+       rows = mySize_y/mySize_x;
+       rows = bound(1, floor((sqrt(4 * ar * rows * count + rows * rows) + rows + 0.5) / 2), count);
+
+       columns = ceil(count/rows);
+
+       vector itemstime_size;
+       itemstime_size = eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows);
+
+       vector offset = '0 0 0';
+       float newSize;
+       if(autocvar_hud_panel_itemstime_size_dinamic)
+       {
+               if(autocvar__hud_configure)
+               if(menu_enabled != 2)
+                       HUD_Panel_DrawBg(1); // also draw the bg of the entire panel
+
+               // reduce panel to avoid spacing items
+               if(itemstime_size_x / itemstime_size_y < ar)
+               {
+                       newSize = rows * itemstime_size_x / ar;
+                       pos_y += (mySize_y - newSize) / 2;
+                       mySize_y = newSize;
+                       itemstime_size_y = mySize_y / rows;
+               }
+               else
+               {
+                       newSize = columns * itemstime_size_y * ar;
+                       pos_x += (mySize_x - newSize) / 2;
+                       mySize_x = newSize;
+                       itemstime_size_x = mySize_x / columns;
+               }
+               panel_pos = pos - '1 1 0' * panel_bg_padding;
+               panel_size = mySize + '2 2 0' * panel_bg_padding;
+       }
+       else
+       {
+               if(itemstime_size_x/itemstime_size_y > ar)
+               {
+                       newSize = ar * itemstime_size_y;
+                       offset_x = itemstime_size_x - newSize;
+                       pos_x += offset_x/2;
+                       itemstime_size_x = newSize;
+               }
+               else
+               {
+                       newSize = 1/ar * itemstime_size_x;
+                       offset_y = itemstime_size_y - newSize;
+                       pos_y += offset_y/2;
+                       itemstime_size_y = newSize;
+               }
+       }
+
+       HUD_Panel_DrawBg(1);
+
+       float row = 0, column = 0;
+       for (i = 0; i < ITEMSTIME_MAXITEMS; ++i) {
+               if (ItemsTime_time[i] == -1)
+                       continue;
+               if (!autocvar_hud_panel_itemstime_showspawned)
+                       if (ItemsTime_time[i] <= time)
+                               continue;
+               DrawItemsTimeItem(pos + eX * column * (itemstime_size_x + offset_x) + eY * row * (itemstime_size_y + offset_y), itemstime_size, ar, i);
+               ++row;
+               if(row >= rows)
+               {
+                       row = 0;
+                       column = column + 1;
+               }
+       }
+}
 
 /*
 ==================
index d56caf1331e88fa48e9624f20b2cf7982c581f70..66e4e61eb7f64bd6ccd3bea1dffa6a96793f49d1 100644 (file)
@@ -115,7 +115,8 @@ float current_player;
        HUD_PANEL(INFOMESSAGES , HUD_InfoMessages , infomessages) \
        HUD_PANEL(PHYSICS      , HUD_Physics      , physics) \
        HUD_PANEL(CENTERPRINT  , HUD_CenterPrint  , centerprint) \
-       HUD_PANEL(BUFFS        , HUD_Buffs        , buffs) 
+       HUD_PANEL(BUFFS        , HUD_Buffs        , buffs) \
+       HUD_PANEL(ITEMSTIME    , HUD_ItemsTime    , itemstime)
 
 #define HUD_PANEL(NAME,draw_func,name) \
        float HUD_PANEL_##NAME; \
index 047e012ad65d8670b5502679f1bff01f72cce9c7..5d149fe0a939873b9782af72ce64065137b728f9 100644 (file)
@@ -189,6 +189,16 @@ void HUD_Panel_ExportCfg(string cfgname)
                                        HUD_Write_PanelCvar_q("_fade_subsequent_minfontsize");
                                        HUD_Write_PanelCvar_q("_fade_minfontsize");
                                        break;
+                               case HUD_PANEL_ITEMSTIME:
+                                       HUD_Write_PanelCvar_q("_iconalign");
+                                       HUD_Write_PanelCvar_q("_progressbar");
+                                       HUD_Write_PanelCvar_q("_progressbar_name");
+                                       HUD_Write_PanelCvar_q("_progressbar_reduced");
+                                       HUD_Write_PanelCvar_q("_showspawned");
+                                       HUD_Write_PanelCvar_q("_text");
+                                       HUD_Write_PanelCvar_q("_ratio");
+                                       HUD_Write_PanelCvar_q("_size_dinamic");
+                                       break;
                        }
                        HUD_Write("\n");
                }
index 2df3dd411bc6d9f4da76ef4124a81fa51658c8fc..3c23911a030e9df1dcab970af6ed1d578aec0898 100644 (file)
@@ -204,6 +204,8 @@ float spritelookupblinkvalue(string s)
                case "ons-cp-atck-blue": return 2;
                case "ons-cp-dfnd-red":  return 0.5;
                case "ons-cp-dfnd-blue": return 0.5;
+               case "item_health_mega": return 2;
+               case "item_armor_large": return 2;
                case "item-invis":       return 2;
                case "item-extralife":   return 2;
                case "item-speed":       return 2;
@@ -211,6 +213,9 @@ float spritelookupblinkvalue(string s)
                case "item-shield":      return 2;
                case "item-fuelregen":   return 2;
                case "item-jetpack":     return 2;
+               case "wpn-fireball":     return 2; // superweapon
+               case "wpn-minstanex":    return 2; // superweapon
+               case "wpn-porto":        return 2; // superweapon
                case "tagged-target":    return 2;
                default:                 return 1;
        }
@@ -276,6 +281,8 @@ string spritelookuptext(string s)
                case "dom-blue": return _("Control point");
                case "dom-yellow": return _("Control point");
                case "dom-pink": return _("Control point");
+               case "item_health_mega": return _("Mega health");
+               case "item_armor_large": return _("Large armor");
                case "item-invis": return _("Invisibility");
                case "item-extralife": return _("Extra life");
                case "item-speed": return _("Speed");
@@ -378,6 +385,12 @@ void Draw_WaypointSprite()
        // choose the sprite
        switch(self.rule)
        {
+               case SPRITERULE_SPECTATOR:
+                       if not((autocvar_g_waypointsprite_itemstime == 1 && t == NUM_SPECTATOR + 1)
+                       || (autocvar_g_waypointsprite_itemstime == 2 && (t == NUM_SPECTATOR + 1 || warmup_stage)))
+                               return;
+                       spriteimage = self.netname;
+                       break;
                case SPRITERULE_DEFAULT:
                        if(self.team)
                        {
index 8586cffa9d539ff5f56067ab570df0e132f43ce6..9b9bded9b98f557f5f3d99bcfd9499d5593980ec 100644 (file)
@@ -105,6 +105,7 @@ const float ENT_CLIENT_HEALING_ORB = 80;
 
 const float SPRITERULE_DEFAULT = 0;
 const float SPRITERULE_TEAMPLAY = 1;
+const float SPRITERULE_SPECTATOR = 2;
 
 const float RADARICON_NONE = 0;
 const float RADARICON_FLAG = 1;
@@ -294,6 +295,7 @@ const float WATERLEVEL_NONE = 0;
 const float WATERLEVEL_WETFEET = 1;
 const float WATERLEVEL_SWIMMING = 2;
 const float WATERLEVEL_SUBMERGED = 3;
+
 #define SERVERFLAG_ALLOW_FULLBRIGHT 1
 #define SERVERFLAG_TEAMPLAY 2
 #define SERVERFLAG_PLAYERSTATS 4
index f0570299794f72d698269b62ac7133a0951258a5..bd34f6f88c0d6cb8a3a032f9b361bb5dc39b485a 100644 (file)
@@ -92,16 +92,16 @@ const float STAT_OK_AMMO_CHARGEPOOl     = 86;
 // 87 empty?
 // 88 empty?
 // 89 empty?
-// 90 empty?
-// 91 empty?
-// 92 empty?
-// 93 empty?
-// 94 empty?
-// 95 empty?
-// 96 empty?
-// 97 empty?
-// 98 empty?
-// 99 empty?
+const float STAT_ARMOR_LARGE_TIME       = 90;
+const float STAT_HEALTH_MEGA_TIME       = 91;
+const float STAT_INVISIBLE_TIME         = 92;
+const float STAT_SPEED_TIME             = 93;
+const float STAT_EXTRALIFE_TIME         = 94;
+const float STAT_STRENGTH_TIME          = 95;
+const float STAT_SHIELD_TIME            = 96;
+const float STAT_FUELREGEN_TIME         = 97;
+const float STAT_JETPACK_TIME           = 98;
+const float STAT_SUPERWEAPONS_TIME      = 99;
 
 
 /* The following stats change depending on the gamemode, so can share the same ID */
index 65b4e67a427b5eca7ba99208d874cec288d466be..87cdd99dfd22a45ac4264dab0e58e0c408275165 100644 (file)
@@ -448,4 +448,4 @@ vector bezier_quadratic_getderivative(vector a, vector p, vector b, float t);
 #define APPEND_TO_STRING(list,sep,add) ((list) = (((list) != "") ? strcat(list, sep, add) : (add)))
 
 // Returns the correct difference between two always increasing numbers
-#define COMPARE_INCREASING(to,from) (to < from ? from + to + 2 : to - from)
\ No newline at end of file
+#define COMPARE_INCREASING(to,from) (to < from ? from + to + 2 : to - from)
index 9f01ee3fbf08dc8c8a633916923eea028f0d14d1..f4cc9c7c948146aee6a92aba293e2bcf9a49712f 100644 (file)
 #include "xonotic/dialog_hudpanel_physics.c"
 #include "xonotic/dialog_hudpanel_centerprint.c"
 #include "xonotic/dialog_hudpanel_buffs.c"
+#include "xonotic/dialog_hudpanel_itemstime.c"
 #include "xonotic/slider_picmip.c"
 #include "xonotic/slider_particles.c"
 #include "xonotic/slider_sbfadetime.c"
diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_itemstime.c b/qcsrc/menu/xonotic/dialog_hudpanel_itemstime.c
new file mode 100644 (file)
index 0000000..349be0a
--- /dev/null
@@ -0,0 +1,44 @@
+#ifdef INTERFACE
+CLASS(XonoticHUDItemsTimeDialog) EXTENDS(XonoticRootDialog)
+       METHOD(XonoticHUDItemsTimeDialog, fill, void(entity))
+       ATTRIB(XonoticHUDItemsTimeDialog, title, string, _("Items Time Panel"))
+       ATTRIB(XonoticHUDItemsTimeDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+       ATTRIB(XonoticHUDItemsTimeDialog, intendedWidth, float, 0.4)
+       ATTRIB(XonoticHUDItemsTimeDialog, rows, float, 15)
+       ATTRIB(XonoticHUDItemsTimeDialog, columns, float, 4)
+       ATTRIB(XonoticHUDItemsTimeDialog, name, string, "HUDitemstime")
+ENDCLASS(XonoticHUDItemsTimeDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void XonoticHUDItemsTimeDialog_fill(entity me)
+{
+       entity e;
+       string panelname = "itemstime";
+
+       me.TR(me);
+               me.TD(me, 1, 4, e = makeXonoticTextSlider("hud_panel_itemstime"));
+                       e.addValue(e, ZCTX(_("PNL^Disabled")), "0");
+                       e.addValue(e, ZCTX(_("PNL^Enabled spectating")), "1");
+                       e.addValue(e, ZCTX(_("PNL^Enabled even playing in warmup")), "2");
+                       e.configureXonoticTextSliderValues(e);
+
+       DIALOG_HUDPANEL_COMMON_NOTOGGLE();
+
+       me.TR(me);
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Align icon:")));
+                       me.TD(me, 1, 2.6/2, e = makeXonoticRadioButton(2, "hud_panel_itemstime_iconalign", "0", _("Left")));
+                       me.TD(me, 1, 2.6/2, e = makeXonoticRadioButton(2, "hud_panel_itemstime_iconalign", "1", _("Right")));
+       me.TR(me);
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_itemstime_progressbar", _("Enable status bar")));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_itemstime_progressbar_reduced", _("Reduced")));
+                       setDependent(e, "hud_panel_itemstime_progressbar", 1, 1);
+       me.TR(me);
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Text/icon ratio:")));
+               me.TD(me, 1, 2.6, e = makeXonoticSlider(2, 8, 0.5, "hud_panel_itemstime_ratio"));
+       me.TR(me);
+               me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_itemstime_showspawned", _("Show spawned items")));
+       me.TR(me);
+               me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_itemstime_size_dinamic", _("Dinamic size")));
+}
+#endif
index 6fa40bfac69cf687997ec45952d7b10eb7825d12..5174fe09d43b92ff80d7422d088ba0afd47a6040 100644 (file)
@@ -134,6 +134,10 @@ void MainWindow_configureMainWindow(entity me)
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
+       i = spawnXonoticHUDItemsTimeDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
 
        // dialogs used by settings
        me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
index 03ab777b941c151ce93fe5cccc92e87cd1d9248e..83ba6d94a28b50b009f0a1189e7d674bf5b91df4 100644 (file)
@@ -149,6 +149,7 @@ void PutObserverInServer (void)
 
        if(IS_REAL_CLIENT(self))
        {
+               Item_ItemsTime_Get(self);
                msg_entity = self;
                WriteByte(MSG_ONE, SVC_SETVIEW);
                WriteEntity(MSG_ONE, self);
@@ -461,6 +462,9 @@ void PutClientInServer (void)
                else
                        self.superweapons_finished = 0;
 
+               if(!warmup_stage)
+                       Item_ItemsTime_ResetForPlayer(self);
+
                if(g_weaponarena_random) // WEAPONTODO: more stuff that should be in a mutator. also: rename those cvars
                {
                        if(g_weaponarena_random_with_blaster)
index 214083eaee9f32c080ad221512e3dfe39a28ba58..4eb2ae484a94d0de981f8ca35c43f8dabf6ecd0a 100644 (file)
@@ -433,6 +433,8 @@ void ReadyRestart_force()
        // disable the warmup global for the server
        warmup_stage = 0; // once the game is restarted the game is in match stage
 
+       Item_ItemsTime_Reset();
+
        // reset the .ready status of all players (also spectators)
        FOR_EACH_REALCLIENT(tmp_player) { tmp_player.ready = 0; }
        readycount = 0;
index 757ee65e2799449c1afd71e68aaf2339596faada..8519c657a8d16ba5e1f9eb4337b2d5e51993f79a 100644 (file)
@@ -133,6 +133,7 @@ void setanim(entity e, vector anim, float looping, float override, float restart
 
 .float species;
 
+.float scheduledrespawntime;
 .float respawntime;
 .float respawntimejitter;
 //.float       chasecam;
@@ -565,6 +566,17 @@ string deathmessage;
 .void (float act_state) setactive;
 .entity realowner;
 
+.float item_armor_large_time;
+.float item_health_mega_time;
+.float item_invisible_time;
+.float item_speed_time;
+.float item_extralife_time;
+.float item_strength_time;
+.float item_shield_time;
+.float item_fuelregen_time;
+.float item_jetpack_time;
+.float item_superweapons_time;
+
 float serverflags;
 
 .float team_forced; // can be a team number to force a team, or 0 for default action, or -1 for forced spectator
index 0fd5d2de3c2eee8f0e2a8076f22ee753b6965992..0e990171ecffd003ca6fca7454fd57ba585a8dfe 100644 (file)
@@ -528,6 +528,7 @@ void spawnfunc___init_dedicated_server(void)
 void Map_MarkAsRecent(string m);
 float world_already_spawned;
 void Nagger_Init();
+void Item_ItemsTime_Init();
 void ClientInit_Spawn();
 void WeaponStats_Init();
 void WeaponStats_Shutdown();
@@ -767,6 +768,19 @@ void spawnfunc_worldspawn (void)
        
        addstat(STAT_ARC_HEAT, AS_FLOAT, arc_heat_percent);
 
+       // items time
+       addstat(STAT_ARMOR_LARGE_TIME, AS_FLOAT, item_armor_large_time);
+       addstat(STAT_HEALTH_MEGA_TIME, AS_FLOAT, item_health_mega_time);
+       addstat(STAT_INVISIBLE_TIME, AS_FLOAT, item_invisible_time);
+       addstat(STAT_SPEED_TIME, AS_FLOAT, item_speed_time);
+       addstat(STAT_EXTRALIFE_TIME, AS_FLOAT, item_extralife_time);
+       addstat(STAT_STRENGTH_TIME, AS_FLOAT, item_strength_time);
+       addstat(STAT_SHIELD_TIME, AS_FLOAT, item_shield_time);
+       addstat(STAT_FUELREGEN_TIME, AS_FLOAT, item_fuelregen_time);
+       addstat(STAT_JETPACK_TIME, AS_FLOAT, item_jetpack_time);
+       addstat(STAT_SUPERWEAPONS_TIME, AS_FLOAT, item_superweapons_time);
+       Item_ItemsTime_Init();
+
        // freeze attacks
        addstat(STAT_FROZEN, AS_INT, frozen);
        addstat(STAT_REVIVE_PROGRESS, AS_FLOAT, revive_progress);
index 4455d3fb46a3128ecf541c8d4558286341eb8a4e..c1094e44329164716728f5b1521147c17b1999cf 100644 (file)
@@ -381,6 +381,155 @@ void Item_Think()
        }
 }
 
+float it_armor_large_time;
+float it_health_mega_time;
+float it_invisible_time;
+float it_speed_time;
+float it_extralife_time;
+float it_strength_time;
+float it_shield_time;
+float it_fuelregen_time;
+float it_jetpack_time;
+float it_superweapons_time;
+
+void Item_ItemsTime_Init()
+{
+       it_armor_large_time = -1;
+       it_health_mega_time = -1;
+       it_invisible_time = -1;
+       it_speed_time = -1;
+       it_extralife_time = -1;
+       it_strength_time = -1;
+       it_shield_time = -1;
+       it_fuelregen_time = -1;
+       it_jetpack_time = -1;
+       it_superweapons_time = -1;
+}
+void Item_ItemsTime_Reset()
+{
+       it_armor_large_time = (it_armor_large_time == -1) ? -1 : 0;
+       it_health_mega_time = (it_health_mega_time == -1) ? -1 : 0;
+       it_invisible_time   = (it_invisible_time   == -1) ? -1 : 0;
+       it_speed_time       = (it_speed_time       == -1) ? -1 : 0;
+       it_extralife_time   = (it_extralife_time   == -1) ? -1 : 0;
+       it_strength_time    = (it_strength_time    == -1) ? -1 : 0;
+       it_shield_time      = (it_shield_time      == -1) ? -1 : 0;
+       it_fuelregen_time   = (it_fuelregen_time   == -1) ? -1 : 0;
+       it_jetpack_time     = (it_jetpack_time     == -1) ? -1 : 0;
+       it_superweapons_time= (it_superweapons_time== -1) ? -1 : 0;
+}
+void Item_ItemsTime_ResetForPlayer(entity e)
+{
+       e.item_armor_large_time = (it_armor_large_time == -1) ? -1 : 0;
+       e.item_health_mega_time = (it_health_mega_time == -1) ? -1 : 0;
+       e.item_invisible_time   = (it_invisible_time   == -1) ? -1 : 0;
+       e.item_speed_time       = (it_speed_time       == -1) ? -1 : 0;
+       e.item_extralife_time   = (it_extralife_time   == -1) ? -1 : 0;
+       e.item_strength_time    = (it_strength_time    == -1) ? -1 : 0;
+       e.item_shield_time      = (it_shield_time      == -1) ? -1 : 0;
+       e.item_fuelregen_time   = (it_fuelregen_time   == -1) ? -1 : 0;
+       e.item_jetpack_time     = (it_jetpack_time     == -1) ? -1 : 0;
+       e.item_superweapons_time= (it_superweapons_time== -1) ? -1 : 0;
+}
+void Item_ItemsTime_Get(entity e)
+{
+       e.item_armor_large_time = it_armor_large_time;
+       e.item_health_mega_time = it_health_mega_time;
+       e.item_invisible_time = it_invisible_time;
+       e.item_speed_time = it_speed_time;
+       e.item_extralife_time = it_extralife_time;
+       e.item_strength_time = it_strength_time;
+       e.item_shield_time = it_shield_time;
+       e.item_fuelregen_time = it_fuelregen_time;
+       e.item_jetpack_time = it_jetpack_time;
+       e.item_superweapons_time = it_superweapons_time;
+}
+float Item_ItemsTime_UpdateTime_Check(float item_time, float t)
+{
+       if(t == 0 && item_time == -1)
+               return TRUE;
+       if(time < t && (item_time <= time || t < item_time))
+               return TRUE;
+       return FALSE;
+}
+void Item_ItemsTime_UpdateTime(entity e, float t)
+{
+       if(g_instagib)
+       {
+               switch(e.items)
+               {
+                       case IT_STRENGTH://"item-invis"
+                               if(Item_ItemsTime_UpdateTime_Check(it_invisible_time, t))
+                                       it_invisible_time = t;
+                               break;
+                       case IT_NAILS://"item-extralife"
+                               if(Item_ItemsTime_UpdateTime_Check(it_extralife_time, t))
+                                       it_extralife_time = t;
+                               break;
+                       case IT_INVINCIBLE://"item-speed"
+                               if(Item_ItemsTime_UpdateTime_Check(it_speed_time, t))
+                                       it_speed_time = t;
+                               break;
+               }
+       }
+       else
+       {
+               switch(e.items)
+               {
+                       case IT_HEALTH:
+                               //if (e.classname == "item_health_mega")
+                                       if(Item_ItemsTime_UpdateTime_Check(it_health_mega_time, t))
+                                               it_health_mega_time = t;
+                               break;
+                       case IT_ARMOR:
+                               if (e.classname == "item_armor_large")
+                                       if(Item_ItemsTime_UpdateTime_Check(it_armor_large_time, t))
+                                               it_armor_large_time = t;
+                               break;
+                       case IT_STRENGTH://"item-strength"
+                               if(Item_ItemsTime_UpdateTime_Check(it_strength_time, t))
+                                       it_strength_time = t;
+                               break;
+                       case IT_INVINCIBLE://"item-shield"
+                               if(Item_ItemsTime_UpdateTime_Check(it_shield_time, t))
+                                       it_shield_time = t;
+                               break;
+                       default:
+                               if(e.weapons & WEPSET_SUPERWEAPONS)
+                                       if(Item_ItemsTime_UpdateTime_Check(it_superweapons_time, t))
+                                                       it_superweapons_time = t;
+               }
+       }
+       switch(e.items)
+       {
+               case IT_FUEL_REGEN://"item-fuelregen"
+                       if(Item_ItemsTime_UpdateTime_Check(it_fuelregen_time, t))
+                               it_fuelregen_time = t;
+                       break;
+               case IT_JETPACK://"item-jetpack"
+                       if(Item_ItemsTime_UpdateTime_Check(it_jetpack_time, t))
+                               it_jetpack_time = t;
+                       break;
+       }
+}
+void Item_ItemsTime_GetForAll()
+{
+       entity e;
+       if(warmup_stage)
+       {
+               FOR_EACH_REALCLIENT(e)
+                       Item_ItemsTime_Get(e);
+       }
+       else
+       {
+               FOR_EACH_REALCLIENT(e)
+               {
+                       if (e.classname != "player")
+                               Item_ItemsTime_Get(e);
+               }
+       }
+}
+
 void Item_Respawn (void)
 {
        Item_Show(self, 1);
@@ -393,9 +542,15 @@ void Item_Respawn (void)
                sound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTEN_NORM); // play respawn sound
        setorigin (self, self.origin);
 
+       if(self.flags & FL_POWERUP || self.classname == "item_armor_large" || self.items == IT_HEALTH || (self.weapons & WEPSET_SUPERWEAPONS))
+       {
+               Item_ItemsTime_UpdateTime(self, 0);
+               Item_ItemsTime_GetForAll();
+       }
+
        self.think = Item_Think;
        self.nextthink = time;
-       
+
        //pointparticles(particleeffectnum("item_respawn"), self.origin + self.mins_z * '0 0 1' + '0 0 48', '0 0 0', 1);
        pointparticles(particleeffectnum("item_respawn"), self.origin + 0.5 * (self.mins + self.maxs), '0 0 0', 1);
 }
@@ -423,6 +578,14 @@ void Item_RespawnCountdown (void)
                                case IT_JETPACK:    name = "item-jetpack"; rgb = '0.5 0.5 0.5'; break;
                                case IT_STRENGTH:   name = "item-strength"; rgb = '0 0 1'; break;
                                case IT_INVINCIBLE: name = "item-shield"; rgb = '1 0 1'; break;
+                               case IT_HEALTH:
+                                       //if (self.classname == "item_health_mega")
+                                               {name = "item_health_mega"; rgb = '1 0 0';}
+                                       break;
+                               case IT_ARMOR:
+                                       if (self.classname == "item_armor_large")
+                                               {name = "item_armor_large"; rgb = '0 1 0';}
+                                       break;
                        }
                        item_name = name;
                        item_color = rgb;
@@ -442,7 +605,11 @@ void Item_RespawnCountdown (void)
                        {
                                WaypointSprite_Spawn(name, 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, TRUE, RADARICON_POWERUP, rgb);
                                if(self.waypointsprite_attached)
+                               {
+                                       if (self.items == IT_HEALTH || self.items == IT_ARMOR)
+                                               WaypointSprite_UpdateRule(self.waypointsprite_attached, 0, SPRITERULE_SPECTATOR);
                                        WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, time + ITEM_RESPAWN_TICKS);
+                               }
                        }
                        else
                        {
@@ -474,16 +641,57 @@ void Item_RespawnThink()
 
 void Item_ScheduleRespawnIn(entity e, float t)
 {
-       if((e.flags & FL_POWERUP) || (e.weapons & WEPSET_SUPERWEAPONS))
+       if((e.flags & FL_POWERUP) || (e.weapons & WEPSET_SUPERWEAPONS) || e.classname == "item_armor_large" || e.items == IT_HEALTH)
        {
+               entity head;
                e.think = Item_RespawnCountdown;
                e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);
+               e.scheduledrespawntime = e.nextthink + ITEM_RESPAWN_TICKS;
                e.count = 0;
+               if(e.weapons & WEPSET_SUPERWEAPONS)
+               {
+                       for(t = e.scheduledrespawntime, head = world; (head = nextent(head)); )
+                       {
+                               if(e == head)
+                                       continue;
+                               if(clienttype(head) == CLIENTTYPE_NOTACLIENT)
+                               if(head.weapons & WEPSET_SUPERWEAPONS)
+                               if(head.classname != "weapon_info")
+                               {
+                                       if(head.scheduledrespawntime <= time)
+                                       {
+                                               t = 0;
+                                               break;
+                                       }
+                                       if(head.scheduledrespawntime < t)
+                                               t = head.scheduledrespawntime;
+                               }
+                       }
+               }
+               else
+               {
+                       for(t = e.scheduledrespawntime, head = world; (head = find(head, classname, e.classname)); )
+                       {
+                               // in instagib .classname is "instagib" for every item
+                               if(e == head || (g_instagib && e.items != head.items))
+                                       continue;
+                               if(head.scheduledrespawntime <= time)
+                               {
+                                       t = 0;
+                                       break;
+                               }
+                               if(head.scheduledrespawntime < t)
+                                       t = head.scheduledrespawntime;
+                       }
+               }
+               Item_ItemsTime_UpdateTime(e, t);
+               Item_ItemsTime_GetForAll();
        }
        else
        {
                e.think = Item_RespawnThink;
                e.nextthink = time;
+               e.scheduledrespawntime = time + t;
                e.wait = time + t;
        }
 }
@@ -1056,6 +1264,8 @@ void StartItem (string itemmodel, string pickupsound, float defaultrespawntime,
 
                if((itemflags & (FL_POWERUP | FL_WEAPON)) || (itemid & (IT_HEALTH | IT_ARMOR | IT_KEY1 | IT_KEY2)))
                        self.target = "###item###"; // for finding the nearest item using find()
+
+               Item_ItemsTime_UpdateTime(self, 0);
        }
 
        self.bot_pickup = TRUE;
index 736cc564cc4c81bffaae6096cddc11b46c8ac867..507c0551b2db4127b10bbe8f7ed21d5b735300b2 100644 (file)
@@ -193,7 +193,12 @@ float WaypointSprite_visible_for_player(entity e)
                        return FALSE;
 
        // team waypoints
-       if(self.team && self.rule == SPRITERULE_DEFAULT)
+       if(self.rule == SPRITERULE_SPECTATOR)
+       {
+               if(!warmup_stage && e.classname == "player")
+                       return FALSE;
+       }
+       else if(self.team && self.rule == SPRITERULE_DEFAULT)
        {
                if(self.team != e.team)
                        return FALSE;