You need to sign in or sign up before continuing.
Merge in xonotic/xonotic-data.pk3dir.git: terencehill/itemstime
git-manager created issue #1330 (closed) on 2012-10-03T13:50:00Z:
Purpose of the branch:
Features: * Panel to display left time until important items respawn in the map. Tracked items are mega health, large armor, powerups (strenght, invincible, jetpack, fuel regenerator) and superweapons. When ALL occurrences of the same type of item are already taken, time is always referred to the first item that will respawn. Brand new icons for mega health, large armor, strength and shield (images taken from the actual items) Menu dialog to configure the panel * New waypoints for mega health and large armor, displayed just like the existing powerups waypoints, obviously only visible to spectators * Panel and waypoints can be enabled when spectating (g_waypointsprite_itemstime 1, hud_panel_itemstime 1) or also when playing in warmup stage (g_waypointsprite_itemstime 2, hud_panel_itemstime 2, default values), good for people willing to improve their timing skills
Repository: xonotic/xonotic-data.pk3dir.git Commit: 138e8a13 Branch: terencehill/itemstime
Merge commands:
cd data/xonotic-data.pk3dir git checkout master git reset --hard origin/master git pull && git diff '138e8a13857ec32c09da2335049b82d576736b47'..'origin/terencehill/itemstime' # please check that the diff you just saw did not contain anything complex that # needs a new merge request, and review these changes git merge --no-ff 'origin/terencehill/itemstime' # please make sure this merge worked, and if not, fix merge conflicts and git # commit BEFORE the next command # # also, THIS is the point to do final pre-merge testing # # use git reset --hard origin/master to bail out git push && git push --delete origin 'terencehill/itemstime'
Diffstat:
_hud_common.cfg | 2 + _hud_descriptions.cfg | 19 ++ defaultXonotic.cfg | 1 + gfx/hud/default/fuelregen.tga | Bin 0 -> 51043 bytes gfx/hud/default/item_large_armor.tga | Bin 0 -> 175058 bytes gfx/hud/default/item_mega_health.tga | Bin 0 -> 206730 bytes gfx/hud/default/item_shield.tga | Bin 0 -> 164146 bytes gfx/hud/default/item_strength.tga | Bin 0 -> 96884 bytes gfx/hud/default/jetpack.tga | Bin 0 -> 65580 bytes gfx/hud/luminos/fuelregen.tga | Bin 0 -> 51043 bytes gfx/hud/luminos/item_large_armor.tga | Bin 0 -> 175058 bytes gfx/hud/luminos/item_mega_health.tga | Bin 0 -> 206730 bytes gfx/hud/luminos/item_shield.tga | Bin 0 -> 164146 bytes gfx/hud/luminos/item_strength.tga | Bin 0 -> 96884 bytes gfx/hud/luminos/jetpack.tga | Bin 0 -> 65580 bytes gfx/hud/old/item_large_armor.tga | Bin 0 -> 121872 bytes gfx/hud/old/item_mega_health.tga | Bin 0 -> 163855 bytes gfx/hud/old/item_shield.tga | Bin 0 -> 88537 bytes gfx/hud/old/item_strength.tga | Bin 0 -> 16294 bytes hud_luminos.cfg | 20 ++- hud_luminos_minimal.cfg | 20 ++- hud_luminos_minimal_xhair.cfg | 20 ++- hud_luminos_old.cfg | 20 ++- hud_nexuiz.cfg | 20 ++- qcsrc/client/autocvars.qh | 11 ++ qcsrc/client/hud.qc | 213 +++++++++++++++++++++++ qcsrc/client/hud.qh | 3 + qcsrc/client/hud_config.qc | 10 + qcsrc/client/waypointsprites.qc | 17 ++- qcsrc/common/constants.qh | 16 ++- qcsrc/common/util.qh | 1 + qcsrc/menu/classes.c | 1 + qcsrc/menu/xonotic/dialog_hudpanel_itemstime.c | 44 +++++ qcsrc/menu/xonotic/mainwindow.c | 4 + qcsrc/server/arena.qc | 3 + qcsrc/server/cl_client.qc | 4 + qcsrc/server/command/vote.qc | 2 + qcsrc/server/defs.qh | 12 ++ qcsrc/server/g_world.qc | 13 ++ qcsrc/server/t_items.qc | 214 +++++++++++++++++++++++- qcsrc/server/waypointsprites.qc | 7 +- 41 files changed, 687 insertions(+), 10 deletions(-)
Revision log:
commit 138e8a13857ec32c09da2335049b82d576736b47 Merge: 2e8d8e3 4e2d18f Author: terencehill Commit: terencehill Merge branch 'master' into terencehill/itemstime commit 2e8d8e34f5654af82145fc687faaf9c1ce54fe34 Merge: 7a7032d b8244e7 Author: terencehill Commit: terencehill Merge branch 'master' into terencehill/itemstime commit 7a7032dc05e4a33d6b1c41f11d80dd93bb2ef4f3 Author: terencehill Commit: terencehill Doh! Another value in _hud_descriptions.cfg! commit ccf6359709e6439dcb1045cec8fdb45d4e0ff109 Author: terencehill Commit: terencehill Add comments commit 7004e099d80f51732c6604c598efd42286a5c636 Author: terencehill Commit: terencehill New icons for strength and shield (images taken from the actual items) commit b54421b7ede3b06ff3ec580675f4334c6e894742 Author: terencehill Commit: terencehill New icons for mega health and large armor (images taken from the actual items) commit d04bab4354506854ecc0c425b7540e32bbc35825 Author: terencehill Commit: terencehill New cvar hud_panel_itemstime_size_dinamic, if enabled reduces panel size by removing spacing beetwen items commit 67cb2c4d076f5d28545018804ed3eba296b8a696 Author: terencehill Commit: terencehill Fix typo, no value should be specified in _hud_descriptions.cfg commit 97939ff66718a4ecb7c54e110da979c492b8d2c6 Author: terencehill Commit: terencehill Make so that hud_panel_itemstime / g_waypointsprite_itemstime set to 2 will show itemstime panel / MH-MA waypoints even playing in warmup stage (set to 1 only spectating). Default value is 2 for both. commit 090088589f940a6a03005cc8cee28bf1887f7304 Author: terencehill Commit: terencehill Show the remaining time only if ALL the items of the same kind are taken commit 77d0bcc171007756919223b2bee77cabb97ed7dc Author: terencehill Commit: terencehill ItemsTime now works even playing in warmup stage, good for people willing to improve their timing skills commit 47e28b63d682198e39f29aff9bb8a14b9259630b Author: terencehill Commit: terencehill Items time now supports superweapons too commit 3c175f70e76816a664cededff170a4c3ed061bf2 Author: terencehill Commit: terencehill _progressbar_reduced in hud_config.qc too commit 9c3843c2f7437e3ff0e520751558b575e8de4c06 Author: terencehill Commit: terencehill Rename hud_panel_itemstime_progressbar_xoffset to hud_panel_itemstime_progressbar_reduced in _hud_descriptions.cfg too commit 41e9b002169cd742d5eadd4c540f55164af7f120 Merge: fbcbf08 e55b0af Author: terencehill Commit: terencehill Merge branch 'master' into terencehill/itemstime Conflicts: qcsrc/client/hud.qc qcsrc/menu/xonotic/mainwindow.c qcsrc/server/t_items.qc commit fbcbf08f083a9ab14b947849342f495f05ac9b56 Merge: 6e0ac89 f2e0cd8 Author: terencehill Commit: terencehill Merge branch 'master' into terencehill/itemstime commit 6e0ac89b3f58dbf7d1b0edc7e62968b5841ee59c Merge: 7063233 1b8067f Author: terencehill Commit: terencehill Merge branch 'master' into terencehill/itemstime commit 7063233875c5c0612887ca7b231d4129e4a2aa7c Author: terencehill Commit: terencehill Shorter cvar name commit d1524439b1521ce2fcea1359c2ed7501fa5550dd Merge: d8edcdf 8edee15 Author: terencehill Commit: terencehill Merge branch 'master' into terencehill/itemstime commit d8edcdf62863a802205a77a338f32cea36061dea Author: terencehill Commit: terencehill Stupid typo commit b64b774b49a7b92070677f4450d7c7b313506fcd Author: terencehill Commit: terencehill Make SPRITERULE_SPECTATOR independent from other rules in the client too commit 8b10cf0636ff7ab0c8d86033b400887468e6b6e4 Author: terencehill Commit: terencehill More coherent function naming scheme commit 7075622fdd7ab85e013fc62c2214fea00be330d3 Author: terencehill Commit: terencehill Tweak menu dialog and add progressbar and ratio options to it commit c35cf24fe20019fdfea27cb647e3d97a9cbfbc48 Author: terencehill Commit: terencehill Align progressbar depending on the icon position commit 5e22ee8295c16872a680483a0bac1b5ffc355704 Author: terencehill Commit: terencehill Fix a cvar description, it was ambiguous commit 04db5714407a65399363cc44d82e721f90afa0b6 Author: terencehill Commit: terencehill Entry aspect ratio is now customizable in the itemstime panel for a nicer layout when progressbars are enabled, see example in hud_luminos_old.cfg commit 5de7b43dff82c520a331692fbfead74a5beb880c Merge: 8c821be ee070be Author: terencehill Commit: terencehill Merge branch 'master' into terencehill/itemstime commit 8c821be331c35a6f84cc9f898fb87d68bbc31a6d Author: terencehill Commit: terencehill hud_panel_itemstime_progressbar_reduced to avoid drawing the progressbar under the icon (simpler and better than the old _xoffset cvar that always offsets the bar regardless of the icon position). commit 5875355e9375aee2f1264a797708eee769cd2289 Author: terencehill Commit: terencehill Correct cvar name commit 9c60f9320ed9ff2c468c96e6837de9c164b15954 Author: terencehill Commit: terencehill Small cleanup commit 9a7adc0d2c36a4634ad50626b8616daf417477ce Author: terencehill Commit: terencehill Minor change to waypoint names commit 6ad02b6f221f5ffa79ba2eb7d6e9a69630ca2375 Author: terencehill Commit: terencehill Improve calculation of respawn time when there are multiple items of the same type, sometimes wasn't correctly updated. commit 2c41ecbac948a72b8fcb1e463832735b9c2d8b8d Author: terencehill Commit: terencehill Fix invisibility icon shown for speed item in minstagib commit fa3dd153fa1d5c201b67c0b1ba6845314f7855e6 Author: terencehill Commit: terencehill Cvar hud_panel_itemstime_showspawned to show icons of already spawned items commit 4239366e87244ca0b02a16d76f4967ef797e03d5 Merge: 6e85d62 685d33f Author: terencehill Commit: terencehill Merge branch 'master' into terencehill/itemstime commit 6e85d6217aa71cf52300b87dc98e0e5d666c69fe Author: terencehill Commit: terencehill Small optimization commit 4dd9592b724979764b03db552023f42ba42e2456 Author: terencehill Commit: terencehill Icons for fuelregen and jetpack commit b23c4689a86a2616aa0a5c89cb00b60ff56e59ad Author: terencehill Commit: terencehill Allow the client to disable showing waypoints of health and armor when spectating commit 4d692e3f5b253acf331e2f494067243b93a363d0 Author: terencehill Commit: terencehill No need to check .classname for mega health, it suffices to check just .items (unlike large armor) commit f9a9fe4ece644d988282187571066105e23d0914 Author: terencehill Commit: terencehill Show countdown waypoints for mega health and large armor when player is spectating commit 837b8b2696f2fa512811548add5bac572875a090 Author: terencehill Commit: terencehill Remove an unused autocvar commit 5eecb3e60d29e4ebd042aff34e6a4da9aeaade08 Author: terencehill Commit: terencehill Menu dialog for the itemstime panel commit 120586fcb629ddcc196adfaedcbba1d8a847b84f Author: terencehill Commit: terencehill Cvars for the other hud skins commit 098af7c6959f21d7153b6331f42df925af96cb3d Author: terencehill Commit: terencehill Brand new panel to display left time for important items to respawn in the map
User agreed to the GPLv2+.
Diff:
diff --git a/_hud_common.cfg b/_hud_common.cfg
index f246ab7..7420b1a 100644
--- a/_hud_common.cfg
+++ b/_hud_common.cfg
@@ -26,6 +26,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_panel_radar_maximized 1"
diff --git a/_hud_descriptions.cfg b/_hud_descriptions.cfg
index cb95f96..8fe2e35 100644
--- a/_hud_descriptions.cfg
+++ b/_hud_descriptions.cfg
@@ -289,3 +289,22 @@ seta hud_panel_centerprint_fade_subsequent_passtwo "" "division factor for the s
seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "" "minimum factor that the second pass can fade to"
seta hud_panel_centerprint_fade_subsequent_minfontsize "" "minimum factor for the font size from the subsequent fading effects"
seta hud_panel_centerprint_fade_minfontsize "" "minimum factor for the font size from the fading in/out effects"
+
+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"
+
diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg
index 69ab2b1..3c26939 100644
--- a/defaultXonotic.cfg
+++ b/defaultXonotic.cfg
@@ -845,6 +845,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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
index 0000000..0f7689d
Binary files /dev/null and b/gfx/hud/old/item_strength.tga differ
diff --git a/hud_luminos.cfg b/hud_luminos.cfg
index 6472a25..ebf0636 100644
--- a/hud_luminos.cfg
+++ b/hud_luminos.cfg
@@ -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"
@@ -288,4 +288,22 @@ seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
seta hud_panel_centerprint_fade_minfontsize "0"
+seta hud_panel_itemstime 2
+seta hud_panel_itemstime_pos "0.000000 0.420000"
+seta hud_panel_itemstime_size "0.150000 0.270000"
+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
diff --git a/hud_luminos_minimal.cfg b/hud_luminos_minimal.cfg
index bb7e066..c9d8efa 100644
--- a/hud_luminos_minimal.cfg
+++ b/hud_luminos_minimal.cfg
@@ -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"
@@ -288,4 +288,22 @@ seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
seta hud_panel_centerprint_fade_minfontsize "0"
+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
diff --git a/hud_luminos_minimal_xhair.cfg b/hud_luminos_minimal_xhair.cfg
index e0921ad..e785511 100644
--- a/hud_luminos_minimal_xhair.cfg
+++ b/hud_luminos_minimal_xhair.cfg
@@ -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"
@@ -288,4 +288,22 @@ seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
seta hud_panel_centerprint_fade_minfontsize "0"
+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
diff --git a/hud_luminos_old.cfg b/hud_luminos_old.cfg
index 119f7b1..c766eee 100644
--- a/hud_luminos_old.cfg
+++ b/hud_luminos_old.cfg
@@ -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"
@@ -288,4 +288,22 @@ seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
seta hud_panel_centerprint_fade_minfontsize "0"
+seta hud_panel_itemstime 2
+seta hud_panel_itemstime_pos "0.020000 0.490000"
+seta hud_panel_itemstime_size "0.150000 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
diff --git a/hud_nexuiz.cfg b/hud_nexuiz.cfg
index 3cf0feb..98e6f0b 100644
--- a/hud_nexuiz.cfg
+++ b/hud_nexuiz.cfg
@@ -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"
@@ -288,4 +288,22 @@ seta hud_panel_centerprint_fade_subsequent_passtwo_minalpha "0.5"
seta hud_panel_centerprint_fade_subsequent_minfontsize "0.75"
seta hud_panel_centerprint_fade_minfontsize "0"
+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
diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh
index 0d4513f..6214e82 100644
--- a/qcsrc/client/autocvars.qh
+++ b/qcsrc/client/autocvars.qh
@@ -148,6 +148,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;
@@ -244,6 +245,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_dom_layout;
float autocvar_hud_panel_notify;
diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc
index 2e3607f..7702263 100644
--- a/qcsrc/client/hud.qc
+++ b/qcsrc/client/hud.qc
@@ -4965,6 +4965,217 @@ void HUD_CenterPrint (void)
}
}
+
+// ItemsTime (#17)
+//
+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;
+ vector color;
+ 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
+ {
+ hud_configure_active_panel = HUD_PANEL_ITEMSTIME;
+
+ // do not show here mutator-dependent items
+ ItemsTime_time[0] = time + 25;
+ 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 + 19;
+ ItemsTime_time[8] = time + 46;
+ ItemsTime_time[9] = time + 28;
+ }
+
+ float i;
+ float count;
+ if (autocvar_hud_panel_itemstime_showspawned)
+ for (i = 0; i < ITEMSTIME_MAXITEMS; ++i)
+ count += (ItemsTime_time[i] > time || (ItemsTime_time[i] != -1 && ItemsTime_time[i] <= time));
+ else
+ for (i = 0; i < ITEMSTIME_MAXITEMS; ++i)
+ count += (ItemsTime_time[i] > time);
+ if (count == 0)
+ return;
+
+ HUD_Panel_UpdateCvars(itemstime);
+ HUD_Panel_ApplyFadeAlpha();
+ 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, row, column;
+ 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);
+
+ local noref vector offset; // fteqcc sucks
+ 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);
+
+ 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;
+ }
+ }
+}
+
/*
==================
Main HUD system
@@ -5016,6 +5227,8 @@ switch (id) {\
HUD_Physics(); break;\
case (HUD_PANEL_CENTERPRINT):\
HUD_CenterPrint(); break;\
+ case (HUD_PANEL_ITEMSTIME):\
+ HUD_ItemsTime(); break;\
} ENDS_WITH_CURLY_BRACE
void HUD_Main (void)
diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh
index 16ccd0c..37b38aa 100644
--- a/qcsrc/client/hud.qh
+++ b/qcsrc/client/hud.qh
@@ -3,6 +3,7 @@ string hud_panelorder_prev;
float hud_draw_maximized;
float hud_panel_radar_maximized;
+float hud_panel_itemstime;
vector mousepos;
vector panel_click_distance; // mouse cursor distance from the top left corner of the panel (saved only upon a click)
@@ -287,6 +288,7 @@ switch(id) { \
case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdateCvars(infomessages) break; \
case HUD_PANEL_PHYSICS: HUD_Panel_UpdateCvars(physics); break;\
case HUD_PANEL_CENTERPRINT: HUD_Panel_UpdateCvars(centerprint); break;\
+ case HUD_PANEL_ITEMSTIME: HUD_Panel_UpdateCvars(itemstime); break;\
}
#define HUD_Panel_UpdateCvarsForId(id) \
@@ -325,6 +327,7 @@ switch(id) { \
case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdatePosSize(infomessages) break;\
case HUD_PANEL_PHYSICS: HUD_Panel_UpdatePosSize(physics); break;\
case HUD_PANEL_CENTERPRINT: HUD_Panel_UpdatePosSize(centerprint); break;\
+ case HUD_PANEL_ITEMSTIME: HUD_Panel_UpdatePosSize(itemstime); break;\
}
#define HUD_Panel_UpdatePosSizeForId(id) \
diff --git a/qcsrc/client/hud_config.qc b/qcsrc/client/hud_config.qc
index 0f990c6..dae2883 100644
--- a/qcsrc/client/hud_config.qc
+++ b/qcsrc/client/hud_config.qc
@@ -181,6 +181,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");
}
diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc
index d3d57ab..07fe7c2 100644
--- a/qcsrc/client/waypointsprites.qc
+++ b/qcsrc/client/waypointsprites.qc
@@ -212,6 +212,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;
@@ -219,6 +221,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;
}
@@ -309,13 +314,15 @@ 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");
case "item-strength": return _("Strength");
case "item-shield": return _("Shield");
- case "item-fuelregen": return _("Fuel regen");
- case "item-jetpack": return _("Jet Pack");
+ case "item-fuelregen": return _("Fuel regenerator");
+ case "item-jetpack": return _("Jet pack");
case "freezetag_frozen": return _("Frozen!");
case "tagged-target": return _("Tagged");
case "vehicle": return _("Vehicle");
@@ -411,6 +418,12 @@ void Draw_WaypointSprite()
// choose the sprite
switch(self.rule)
{
+ case SPRITERULE_SPECTATOR:
+ if not(autocvar_g_waypointsprite_itemstime == 1 && t == COLOR_SPECTATOR + 1
+ || autocvar_g_waypointsprite_itemstime == 2 && (t == COLOR_SPECTATOR + 1 || warmup_stage))
+ return;
+ spriteimage = self.netname;
+ break;
case SPRITERULE_DEFAULT:
if(self.team)
{
diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh
index c270b61..8332163 100644
--- a/qcsrc/common/constants.qh
+++ b/qcsrc/common/constants.qh
@@ -106,6 +106,7 @@ const float ENT_CLIENT_VEHICLE = 60;
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;
@@ -179,6 +180,17 @@ const float STAT_VEHICLESTAT_RELOAD2 = 66;
const float STAT_SECRETS_TOTAL = 70;
const float STAT_SECRETS_FOUND = 71;
+const float STAT_ARMOR_LARGE_TIME = 80;
+const float STAT_HEALTH_MEGA_TIME = 81;
+const float STAT_INVISIBLE_TIME = 82;
+const float STAT_SPEED_TIME = 83;
+const float STAT_EXTRALIFE_TIME = 84;
+const float STAT_STRENGTH_TIME = 85;
+const float STAT_SHIELD_TIME = 86;
+const float STAT_FUELREGEN_TIME = 87;
+const float STAT_JETPACK_TIME = 88;
+const float STAT_SUPERWEAPONS_TIME = 89;
+
// mod stats (1xx)
const float STAT_REDALIVE = 100;
const float STAT_BLUEALIVE = 101;
@@ -544,7 +556,8 @@ float HUD_PANEL_ENGINEINFO = 13;
float HUD_PANEL_INFOMESSAGES = 14;
float HUD_PANEL_PHYSICS = 15;
float HUD_PANEL_CENTERPRINT = 16;
-float HUD_PANEL_NUM = 17; // always last panel id + 1, please increment when adding a new panel
+float HUD_PANEL_ITEMSTIME = 17;
+float HUD_PANEL_NUM = 18; // always last panel id + 1, please increment when adding a new panel
string HUD_PANELNAME_WEAPONS = "weapons";
string HUD_PANELNAME_AMMO = "ammo";
@@ -563,6 +576,7 @@ string HUD_PANELNAME_ENGINEINFO = "engineinfo";
string HUD_PANELNAME_INFOMESSAGES = "infomessages";
string HUD_PANELNAME_PHYSICS = "physics";
string HUD_PANELNAME_CENTERPRINT = "centerprint";
+string HUD_PANELNAME_ITEMSTIME = "itemstime";
#define SERVERFLAG_ALLOW_FULLBRIGHT 1
#define SERVERFLAG_TEAMPLAY 2
diff --git a/qcsrc/common/util.qh b/qcsrc/common/util.qh
index faa605f..81d5dae 100644
--- a/qcsrc/common/util.qh
+++ b/qcsrc/common/util.qh
@@ -257,6 +257,7 @@ switch(id) {\
case HUD_PANEL_INFOMESSAGES: panel_name = HUD_PANELNAME_INFOMESSAGES; break; \
case HUD_PANEL_PHYSICS: panel_name = HUD_PANELNAME_PHYSICS; break; \
case HUD_PANEL_CENTERPRINT: panel_name = HUD_PANELNAME_CENTERPRINT; break; \
+ case HUD_PANEL_ITEMSTIME: panel_name = HUD_PANELNAME_ITEMSTIME; break; \
} ENDS_WITH_CURLY_BRACE
// Get name of specified panel id
diff --git a/qcsrc/menu/classes.c b/qcsrc/menu/classes.c
index f838257..8d125d4 100644
--- a/qcsrc/menu/classes.c
+++ b/qcsrc/menu/classes.c
@@ -110,4 +110,5 @@
#include "xonotic/dialog_hudpanel_weapons.c"
#include "xonotic/dialog_hudpanel_physics.c"
#include "xonotic/dialog_hudpanel_centerprint.c"
+#include "xonotic/dialog_hudpanel_itemstime.c"
#include "xonotic/slider_picmip.c"
diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_itemstime.c b/qcsrc/menu/xonotic/dialog_hudpanel_itemstime.c
new file mode 100644
index 0000000..349be0a
--- /dev/null
+++ b/qcsrc/menu/xonotic/dialog_hudpanel_itemstime.c
@@ -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
diff --git a/qcsrc/menu/xonotic/mainwindow.c b/qcsrc/menu/xonotic/mainwindow.c
index f9d86c2..54ed66a 100644
--- a/qcsrc/menu/xonotic/mainwindow.c
+++ b/qcsrc/menu/xonotic/mainwindow.c
@@ -125,6 +125,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();
diff --git a/qcsrc/server/arena.qc b/qcsrc/server/arena.qc
index ef81fd9..70a89ee 100644
--- a/qcsrc/server/arena.qc
+++ b/qcsrc/server/arena.qc
@@ -13,6 +13,7 @@ float warmup;
void PutObserverInServer();
void PutClientInServer();
+void Item_ItemsTime_Reset();
float next_round;
float redalive, bluealive, yellowalive, pinkalive;
@@ -46,6 +47,8 @@ void reset_map(float dorespawn)
race_ReadyRestart();
+ Item_ItemsTime_Reset();
+
for(self = world; (self = nextent(self)); )
if(clienttype(self) == CLIENTTYPE_NOTACLIENT)
{
diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc
index 9d6bcf7..e4f6cf1 100644
--- a/qcsrc/server/cl_client.qc
+++ b/qcsrc/server/cl_client.qc
@@ -396,6 +396,7 @@ void PutObserverInServer (void)
if(clienttype(self) == CLIENTTYPE_REAL)
{
+ Item_ItemsTime_Get(self);
msg_entity = self;
WriteByte(MSG_ONE, SVC_SETVIEW);
WriteEntity(MSG_ONE, self);
@@ -753,6 +754,9 @@ void PutClientInServer (void)
else
self.superweapons_finished = 0;
+ if(!inWarmupStage)
+ Item_ItemsTime_ResetForPlayer(self);
+
if(g_weaponarena_random)
{
if(g_weaponarena_random_with_laser)
diff --git a/qcsrc/server/command/vote.qc b/qcsrc/server/command/vote.qc
index e456475..d4d3d61 100644
--- a/qcsrc/server/command/vote.qc
+++ b/qcsrc/server/command/vote.qc
@@ -353,6 +353,8 @@ void ReadyRestart_force()
// disable the warmup global for the server
inWarmupStage = 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_CLIENTSLOT(tmp_player) { tmp_player.ready = 0; }
readycount = 0;
diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh
index 9068fa7..7e4a07b 100644
--- a/qcsrc/server/defs.qh
+++ b/qcsrc/server/defs.qh
@@ -170,6 +170,7 @@ void setanim(entity e, vector anim, float looping, float override, float restart
.float species;
+.float scheduledrespawntime;
.float respawntime;
.float respawntimejitter;
//.float chasecam;
@@ -627,6 +628,17 @@ string deathmessage;
.float (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 nex_charge;
.float nex_charge_rottime;
.float nex_chargepool_ammo;
diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc
index 4cd5cc8..fb211aa 100644
--- a/qcsrc/server/g_world.qc
+++ b/qcsrc/server/g_world.qc
@@ -561,6 +561,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();
@@ -808,6 +809,18 @@ void spawnfunc_worldspawn (void)
addstat(STAT_HAGAR_LOAD, AS_INT, hagar_load);
+ 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();
+
if(g_ca || g_freezetag)
{
addstat(STAT_REDALIVE, AS_INT, redalive_stat);
diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc
index 48b4fdd..bc8638d 100644
--- a/qcsrc/server/t_items.qc
+++ b/qcsrc/server/t_items.qc
@@ -433,8 +433,159 @@ void Item_Show (entity e, float mode)
e.SendFlags |= ISF_STATUS;
}
+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_minstagib)
+ {
+ 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(WEPSET_CONTAINS_ANY_EA(e, WEPBIT_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(inWarmupStage)
+ {
+ 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)
{
+ float t;
+ entity head;
Item_Show(self, 1);
if(!g_minstagib && self.items == IT_STRENGTH)
sound (self, CH_TRIGGER, "misc/strength_respawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound
@@ -444,6 +595,12 @@ void Item_Respawn (void)
sound (self, CH_TRIGGER, "misc/itemrespawn.wav", VOL_BASE, ATTN_NORM); // play respawn sound
setorigin (self, self.origin);
+ if(self.flags & FL_POWERUP || self.classname == "item_armor_large" || self.items == IT_HEALTH || WEPSET_CONTAINS_ANY_EA(self, WEPBIT_SUPERWEAPONS))
+ {
+ Item_ItemsTime_UpdateTime(self, 0);
+ Item_ItemsTime_GetForAll();
+ }
+
//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);
}
@@ -480,6 +637,14 @@ void Item_RespawnCountdown (void)
{
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;
}
}
switch(self.items)
@@ -505,9 +670,13 @@ 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);
}
}
+ }
sound (self, CH_TRIGGER, "misc/itemrespawncountdown.wav", VOL_BASE, ATTN_NORM); // play respawn sound
if(self.waypointsprite_attached)
{
@@ -519,16 +688,57 @@ void Item_RespawnCountdown (void)
void Item_ScheduleRespawnIn(entity e, float t)
{
- if((e.flags & FL_POWERUP) || WEPSET_CONTAINS_ANY_EA(e, WEPBIT_SUPERWEAPONS))
+ if((e.flags & FL_POWERUP) || WEPSET_CONTAINS_ANY_EA(e, WEPBIT_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(WEPSET_CONTAINS_ANY_EA(e, WEPBIT_SUPERWEAPONS))
+ {
+ for(t = e.scheduledrespawntime, head = world; (head = nextent(head)); )
+ {
+ if(e == head)
+ continue;
+ if(clienttype(head) == CLIENTTYPE_NOTACLIENT)
+ if(WEPSET_CONTAINS_ANY_EA(head, WEPBIT_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 minstagib .classname is "minstagib" for every item
+ if(e == head || (g_minstagib && 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_Respawn;
e.nextthink = time + t;
+ e.scheduledrespawntime = e.nextthink;
}
}
@@ -1153,6 +1363,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;
diff --git a/qcsrc/server/waypointsprites.qc b/qcsrc/server/waypointsprites.qc
index 0e6f216..840858d 100644
--- a/qcsrc/server/waypointsprites.qc
+++ b/qcsrc/server/waypointsprites.qc
@@ -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(!inWarmupStage && e.classname == "player")
+ return FALSE;
+ }
+ else if(self.team && self.rule == SPRITERULE_DEFAULT)
{
if(self.team != e.team)
return FALSE;