]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/master' into samual/flyingspectators
authorSamual <samual@xonotic.org>
Sat, 14 May 2011 20:25:07 +0000 (16:25 -0400)
committerSamual <samual@xonotic.org>
Sat, 14 May 2011 20:25:07 +0000 (16:25 -0400)
Conflicts:
qcsrc/server/defs.qh

177 files changed:
_hud_descriptions.cfg
annoy_balance.cfg [deleted file]
balance25.cfg
balanceLeeStricklin.cfg
balanceSamual.cfg
balanceXonotic.cfg
balancetZork.cfg
defaultXonotic.cfg
gfx/hud/default/progressbar.tga [new file with mode: 0644]
gfx/hud/default/progressbar_vertical.tga [new file with mode: 0644]
gfx/hud/default/statusbar.tga [deleted file]
gfx/hud/default/statusbar_vertical.tga [deleted file]
gfx/hud/luminos/dom_icon_blue-highlighted.tga [new file with mode: 0644]
gfx/hud/luminos/dom_icon_blue.tga [new file with mode: 0644]
gfx/hud/luminos/dom_icon_pink-highlighted.tga [new file with mode: 0644]
gfx/hud/luminos/dom_icon_pink.tga [new file with mode: 0644]
gfx/hud/luminos/dom_icon_red-highlighted.tga [new file with mode: 0644]
gfx/hud/luminos/dom_icon_red.tga [new file with mode: 0644]
gfx/hud/luminos/dom_icon_yellow-highlighted.tga [new file with mode: 0644]
gfx/hud/luminos/dom_icon_yellow.tga [new file with mode: 0644]
gfx/hud/luminos/progressbar.tga [new file with mode: 0644]
gfx/hud/luminos/progressbar_vertical.tga [new file with mode: 0644]
gfx/hud/luminos/shield.tga [new file with mode: 0644]
gfx/hud/luminos/statusbar.tga [deleted file]
gfx/hud/luminos/statusbar_vertical.tga [deleted file]
gfx/hud/luminos/strength.tga [new file with mode: 0644]
gfx/hud/old/dom_icon_blue-highlighted.tga [new file with mode: 0644]
gfx/hud/old/dom_icon_blue.tga [new file with mode: 0644]
gfx/hud/old/dom_icon_pink-highlighted.tga [new file with mode: 0644]
gfx/hud/old/dom_icon_pink.tga [new file with mode: 0644]
gfx/hud/old/dom_icon_red-highlighted.tga [new file with mode: 0644]
gfx/hud/old/dom_icon_red.tga [new file with mode: 0644]
gfx/hud/old/dom_icon_yellow-highlighted.tga [new file with mode: 0644]
gfx/hud/old/dom_icon_yellow.tga [new file with mode: 0644]
gfx/hud/old/progressbar.tga [new file with mode: 0644]
gfx/hud/old/progressbar_vertical.tga [new file with mode: 0644]
gfx/hud/old/statusbar.tga [deleted file]
gfx/hud/old/statusbar_vertical.tga [deleted file]
gfx/loading.tga
gfx/loading10.tga [new file with mode: 0644]
gfx/loading11.tga [new file with mode: 0644]
gfx/loading12.tga [new file with mode: 0644]
gfx/loading2.tga [new file with mode: 0644]
gfx/loading3.tga [new file with mode: 0644]
gfx/loading4.tga [new file with mode: 0644]
gfx/loading5.tga [new file with mode: 0644]
gfx/loading6.tga [new file with mode: 0644]
gfx/loading7.tga [new file with mode: 0644]
gfx/loading8.tga [new file with mode: 0644]
gfx/loading9.tga [new file with mode: 0644]
gfx/ons-frame-team.tga [deleted file]
gfx/ons-frame.tga [deleted file]
hud_luminos.cfg
hud_luminos_minimal.cfg
hud_luminos_old.cfg
hud_luminos_xhair_minimal.cfg
hud_nexuiz.cfg
qcsrc/client/Defs.qc
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc
qcsrc/client/hud.qh
qcsrc/client/hud_config.qc [new file with mode: 0644]
qcsrc/client/main.qh
qcsrc/client/miscfunctions.qc
qcsrc/client/movetypes.qc
qcsrc/client/progs.src
qcsrc/client/scoreboard.qc
qcsrc/client/shownames.qc [new file with mode: 0644]
qcsrc/client/shownames.qh [new file with mode: 0644]
qcsrc/client/teamplay.qc
qcsrc/client/teamplay.qh [new file with mode: 0644]
qcsrc/client/teamradar.qc
qcsrc/common/constants.qh
qcsrc/common/gamecommand.qc
qcsrc/common/mapinfo.qc
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/menu/classes.c
qcsrc/menu/item/dialog.c
qcsrc/menu/xonotic/dialog_hudpanel_ammo.c
qcsrc/menu/xonotic/dialog_hudpanel_chat.c
qcsrc/menu/xonotic/dialog_hudpanel_engineinfo.c
qcsrc/menu/xonotic/dialog_hudpanel_healtharmor.c
qcsrc/menu/xonotic/dialog_hudpanel_infomessages.c
qcsrc/menu/xonotic/dialog_hudpanel_notification.c
qcsrc/menu/xonotic/dialog_hudpanel_physics.c [new file with mode: 0644]
qcsrc/menu/xonotic/dialog_hudpanel_powerups.c
qcsrc/menu/xonotic/dialog_hudpanel_radar.c
qcsrc/menu/xonotic/dialog_hudpanel_score.c
qcsrc/menu/xonotic/dialog_hudpanel_timer.c
qcsrc/menu/xonotic/dialog_hudpanel_vote.c
qcsrc/menu/xonotic/dialog_hudpanel_weapons.c
qcsrc/menu/xonotic/dialog_hudsetup_exit.c
qcsrc/menu/xonotic/dialog_settings_misc.c
qcsrc/menu/xonotic/mainwindow.c
qcsrc/menu/xonotic/util.qc
qcsrc/menu/xonotic/util.qh
qcsrc/server/arena.qc
qcsrc/server/autocvars.qh
qcsrc/server/cl_client.qc
qcsrc/server/cl_player.qc
qcsrc/server/cl_weapons.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/defs.qh
qcsrc/server/domination.qc
qcsrc/server/frags.txt [deleted file]
qcsrc/server/g_swamp.qc [deleted file]
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/progs.src
qcsrc/server/sv_stats.qc [deleted file]
qcsrc/server/t_teleporters.qc
qcsrc/server/todo.txt
qcsrc/server/w_hagar.qc
qcsrc/server/w_nex.qc
sound/weapons/hagar_beep.ogg [new file with mode: 0644]
sound/weapons/hagar_load.ogg [new file with mode: 0644]
textures/campingrifle.tga
textures/campingrifle_glow.tga
textures/campingrifle_pants.tga [deleted file]
textures/campingrifle_shirt.tga [deleted file]
textures/crylink.tga
textures/crylink_gloss.tga
textures/crylink_glow.jpg
textures/crylink_pants.tga [deleted file]
textures/crylink_reflect.tga
textures/electro.tga
textures/electro_glow.tga
textures/electro_pants.tga [deleted file]
textures/electro_plasma.tga
textures/electro_plasma_glow.tga
textures/glauncher_glow.tga [new file with mode: 0644]
textures/glauncher_pants.tga [deleted file]
textures/glscope.tga
textures/glscope_glow.tga
textures/hagar2.tga
textures/hagar2_glow.tga
textures/hagar2_pants.tga [deleted file]
textures/hlac_accessory.tga
textures/hlac_accessory_glow.tga [new file with mode: 0644]
textures/hlac_accessory_pants.tga [deleted file]
textures/hlac_body.tga
textures/hlac_body_glow.tga
textures/hlac_body_pants.tga [deleted file]
textures/hlac_body_shirt.tga
textures/hlac_metal.tga
textures/hlac_metal_glow.tga
textures/hlac_plasma.tga
textures/hookgun_pants.tga [deleted file]
textures/hookgun_shirt.tga [new file with mode: 0644]
textures/laser.tga
textures/laser_glow.tga
textures/laser_pants.tga [deleted file]
textures/minelayer.tga
textures/minelayer_glow.tga
textures/nex.tga
textures/nex_glow.tga
textures/nex_pants.tga [deleted file]
textures/portalgun.tga
textures/portalgun_glow.tga
textures/rl_glow.tga [new file with mode: 0644]
textures/rl_pants.tga [deleted file]
textures/seeker.tga
textures/seeker_glow.tga
textures/seeker_pants.tga [deleted file]
textures/seeker_shirt.tga [new file with mode: 0644]
textures/shotgun2_glow.tga
textures/shotgun2_shirt.tga
textures/shotgun_sight.tga
textures/shotgun_sight_glow.tga [new file with mode: 0644]
textures/uzi_glow.tga
textures/uzi_pants.tga [deleted file]
tooltips.db
xonotic-credits.txt

index 38580b606f59b7d6cc1816e2cc9251f82e79d795..e4c669663324bca895414a5e8e954451199aaa02 100644 (file)
@@ -21,6 +21,9 @@ seta hud_progressbar_health_color "" "R G B vector of the progress bar backgroun
 seta hud_progressbar_armor_color "" "R G B vector of the progress bar background color"
 seta hud_progressbar_fuel_color "" "R G B vector of the progress bar background color"
 seta hud_progressbar_nexball_color "" "R G B vector of the progress bar background color"
+seta hud_progressbar_speed_color "" "R G B vector of the progress bar background color"
+seta hud_progressbar_acceleration_color "" "R G B vector of the progress bar background color"
+seta hud_progressbar_acceleration_neg_color "" "R G B vector of the progress bar background color"
 
 seta _hud_panelorder "" "contains order in which panels are to be drawn"
 
@@ -70,8 +73,8 @@ seta hud_panel_powerups "" "enable/disable this panel"
 seta hud_panel_powerups_pos "" "position of this panel"
 seta hud_panel_powerups_size "" "size of this panel"
 seta hud_panel_powerups_flip "" "flip strength/shield positions"
-seta hud_panel_powerups_baralign "" "0 = align bars to the left, 1 = align bars to the right, 2 = align right bar to the right, 3 = align left bar to the right"
-seta hud_panel_powerups_iconalign "" "0 = align icons to the left, 1 = align icons to the right, 2 = align right icon to the right, 3 = align left icon to the right"
+seta hud_panel_powerups_baralign "" "0 = align bars to the left, 1 = align bars to the right, 2 = align only left bar to the right, 3 = align only right bar to the right"
+seta hud_panel_powerups_iconalign "" "0 = align icons to the left, 1 = align icons to the right, 2 = align only left icon to the right, 3 = align only right icon to the right"
 seta hud_panel_powerups_bg "" "if set to something else than \"\" = override default background"
 seta hud_panel_powerups_bg_color "" "if set to something else than \"\" = override default panel background color"
 seta hud_panel_powerups_bg_color_team "" "override panel color with team color in team based games"
@@ -87,8 +90,8 @@ seta hud_panel_healtharmor "" "enable/disable this panel, 2 = combined health/ar
 seta hud_panel_healtharmor_pos "" "position of this panel"
 seta hud_panel_healtharmor_size "" "size of this panel"
 seta hud_panel_healtharmor_flip "" "flip health/armor positions"
-seta hud_panel_healtharmor_baralign "" "0 = align bars to the left, 1 = align bars to the right, 2 = align right bar to the right, 3 = align left bar to the right"
-seta hud_panel_healtharmor_iconalign "" "0 = align icons to the left, 1 = align icons to the right, 2 = align right icon to the right, 3 = align left icon to the right"
+seta hud_panel_healtharmor_baralign "" "0 = align bars to the left, 1 = align bars to the right, 2 = align only left bar to the right, 3 = align only right bar to the right"
+seta hud_panel_healtharmor_iconalign "" "0 = align icons to the left, 1 = align icons to the right, 2 = align only left icon to the right, 3 = align only right icon to the right"
 seta hud_panel_healtharmor_bg "" "if set to something else than \"\" = override default background"
 seta hud_panel_healtharmor_bg_color "" "if set to something else than \"\" = override default panel background color"
 seta hud_panel_healtharmor_bg_color_team "" "override panel color with team color in team based games"
@@ -196,7 +199,7 @@ seta hud_panel_chat_bg_alpha "" "if set to something else than \"\" = override d
 seta hud_panel_chat_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_chat_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 
-seta hud_panel_engineinfo "" "enable/disable this panel
+seta hud_panel_engineinfo "" "enable/disable this panel"
 seta hud_panel_engineinfo_pos "" "position of this base of the panel"
 seta hud_panel_engineinfo_size "" "size of this panel"
 seta hud_panel_engineinfo_bg "" "if set to something else than \"\" = override default background"
@@ -206,7 +209,7 @@ seta hud_panel_engineinfo_bg_alpha "" "if set to something else than \"\" = over
 seta hud_panel_engineinfo_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_engineinfo_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 
-seta hud_panel_infomessages "" "enable/disable this panel
+seta hud_panel_infomessages "" "enable/disable this panel"
 seta hud_panel_infomessages_pos "" "position of this base of the panel"
 seta hud_panel_infomessages_size "" "size of this panel"
 seta hud_panel_infomessages_bg "" "if set to something else than \"\" = override default background"
@@ -216,3 +219,18 @@ seta hud_panel_infomessages_bg_alpha "" "if set to something else than \"\" = ov
 seta hud_panel_infomessages_bg_border "" "if set to something else than \"\" = override default size of border around the background"
 seta hud_panel_infomessages_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
 seta hud_panel_infomessages_flip "" "1 = align the items to the right"
+
+seta hud_panel_physics "" "enable/disable this panel, 1 = show if not observing, 2 = show always"
+seta hud_panel_physics_pos "" "position of this base of the panel"
+seta hud_panel_physics_size "" "size of this panel"
+seta hud_panel_physics_bg "" "if set to something else than \"\" = override default background"
+seta hud_panel_physics_bg_color "" "if set to something else than \"\" = override default panel background color"
+seta hud_panel_physics_bg_color_team "" "override panel color with team color in team based games"
+seta hud_panel_physics_bg_alpha "" "if set to something else than \"\" = override default panel background alpha"
+seta hud_panel_physics_bg_border "" "if set to something else than \"\" = override default size of border around the background"
+seta hud_panel_physics_bg_padding "" "if set to something else than \"\" = override default padding of contents from border"
+seta hud_panel_physics_baralign "" "0 = align bars to the left, 1 = align bars to the right, 2 = align only left bar to the right, 3 = align only right bar to the right, 4 = align bars to the center"
+seta hud_panel_physics_flip "" "flip speed/acceleration positions"
+seta hud_panel_physics_progressbar "" "enable progressbar in panel (2 = only for speed; 3 = only for acceleration)"
+seta hud_panel_physics_acceleration_progressbar_mode "" "0 = progressbar increases from the center to the right if the acceleration is positive, to the left if it's negative; 1 = progressbar increases from the border in the same direction for both positive and negative accelerations"
+seta hud_panel_physics_text "" "show text in panel (2 = only for speed; 3 = only for acceleration)"
diff --git a/annoy_balance.cfg b/annoy_balance.cfg
deleted file mode 100644 (file)
index 184eb4e..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-// TEMPORARY CONFIG FOR BALANCE TESTING PURPOSES
-
-// ANNOY people with the BALANCE
-alias annoy                "sv_cmd adminmsg 0 \"${* q}\" 70"
-       // show message for 70 sec, clear previous one
-alias annoy_s              "annoy $*; echo \ 1SERVER^7: $*"
-       // annoy_s goes to rcon2irc (this echo fakes a chat message's output)
-alias printbalance         "annoy NOTE: Current balance is ^1$curbalance"
-       // refresh the balance status bar (call this every 60 sec)
-alias printbalance_s       "annoy_s NOTE: Next match will run ^1$curbalance"
-       // announce the balance for next match
-alias switchbalance_samual "exec balanceXonotic.cfg; set curbalance fruit; printbalance_s"
-alias switchbalance_fruit  "exec balanceSamual.cfg; set curbalance samual; printbalance_s"
-alias switchbalance        "switchbalance_$curbalance"
-       // toggle between the balances
-alias sv_hook_gameend      "switchbalance"
-       // do this at the end of each match
-set curbalance fruit
-alias annoybalance         "printbalance; defer 60 annoybalance"
-annoybalance
-       // our timer
\ No newline at end of file
index bf8d40cf6e2826d943cf4c2a9b91c3838c62fed5..ea66cd177f6f04e0e947e3e5e5415f0bfd1a0291 100644 (file)
@@ -539,6 +539,12 @@ set g_balance_hagar_primary_lifetime 30
 set g_balance_hagar_primary_refire 0.15
 set g_balance_hagar_primary_ammo 1
 set g_balance_hagar_secondary 1
+set g_balance_hagar_secondary_load 0
+set g_balance_hagar_secondary_load_speed 0.6
+set g_balance_hagar_secondary_load_max 4
+set g_balance_hagar_secondary_load_hold 0
+set g_balance_hagar_secondary_load_releasedeath 1
+set g_balance_hagar_secondary_load_abort 1
 set g_balance_hagar_secondary_damage 37
 set g_balance_hagar_secondary_edgedamage 15
 set g_balance_hagar_secondary_force 100
index 820456e8a313c8a8fadb1969885b20114257f30e..bd72a707171645065832e2d1ed644c5a80353ef2 100644 (file)
@@ -539,6 +539,12 @@ set g_balance_hagar_primary_lifetime 30
 set g_balance_hagar_primary_refire 0.15
 set g_balance_hagar_primary_ammo 2
 set g_balance_hagar_secondary 1
+set g_balance_hagar_secondary_load 0
+set g_balance_hagar_secondary_load_speed 0.6
+set g_balance_hagar_secondary_load_max 4
+set g_balance_hagar_secondary_load_hold 0
+set g_balance_hagar_secondary_load_releasedeath 1
+set g_balance_hagar_secondary_load_abort 1
 set g_balance_hagar_secondary_damage 43
 set g_balance_hagar_secondary_edgedamage 15
 set g_balance_hagar_secondary_force 100
index b5945c864f0c3a82616f1b2d4ae0d2a1872647fd..441b604020d6636fb1d90ea0ffcf1c25889d8765 100644 (file)
@@ -539,6 +539,12 @@ set g_balance_hagar_primary_lifetime 5
 set g_balance_hagar_primary_refire 0.15
 set g_balance_hagar_primary_ammo 1
 set g_balance_hagar_secondary 1
+set g_balance_hagar_secondary_load 0
+set g_balance_hagar_secondary_load_speed 0.6
+set g_balance_hagar_secondary_load_max 4
+set g_balance_hagar_secondary_load_hold 0
+set g_balance_hagar_secondary_load_releasedeath 1
+set g_balance_hagar_secondary_load_abort 1
 set g_balance_hagar_secondary_damage 35
 set g_balance_hagar_secondary_edgedamage 17.5
 set g_balance_hagar_secondary_force 100
index 4f78941da24444189d84af80bf605b22b588cea5..5bffd7df9a9067f4fd498e468628d334fdf55b2f 100644 (file)
@@ -539,15 +539,21 @@ set g_balance_hagar_primary_lifetime 5
 set g_balance_hagar_primary_refire 0.12
 set g_balance_hagar_primary_ammo 1
 set g_balance_hagar_secondary 1
-set g_balance_hagar_secondary_damage 14
-set g_balance_hagar_secondary_edgedamage 6
-set g_balance_hagar_secondary_force 70
+set g_balance_hagar_secondary_load 0
+set g_balance_hagar_secondary_load_speed 0.6
+set g_balance_hagar_secondary_load_max 4
+set g_balance_hagar_secondary_load_hold 0
+set g_balance_hagar_secondary_load_releasedeath 1
+set g_balance_hagar_secondary_load_abort 1
+set g_balance_hagar_secondary_damage 14 // default for _load: 32
+set g_balance_hagar_secondary_edgedamage 6 // default for _load: 10
+set g_balance_hagar_secondary_force 70 // default for _load: 160
 set g_balance_hagar_secondary_radius 125
-set g_balance_hagar_secondary_spread 0.15
+set g_balance_hagar_secondary_spread 0.15 // default for _load: 0.08
 set g_balance_hagar_secondary_speed 1800
 set g_balance_hagar_secondary_lifetime_min 5
 set g_balance_hagar_secondary_lifetime_rand 0
-set g_balance_hagar_secondary_refire 0.12
+set g_balance_hagar_secondary_refire 0.12 // default for _load: 0.8
 set g_balance_hagar_secondary_ammo 1
 set g_balance_hagar_reload_ammo 0 //default: 25
 set g_balance_hagar_reload_time 2
index 69aa7d1b534d16ea3882c442e9bd841e121310ac..8a09f03e514a7a3299c23a7e71e26f928b7e6b61 100644 (file)
@@ -538,6 +538,12 @@ set g_balance_hagar_primary_lifetime 30
 set g_balance_hagar_primary_refire 0.2
 set g_balance_hagar_primary_ammo 1
 set g_balance_hagar_secondary 1
+set g_balance_hagar_secondary_load 0
+set g_balance_hagar_secondary_load_speed 0.6
+set g_balance_hagar_secondary_load_max 4
+set g_balance_hagar_secondary_load_hold 0
+set g_balance_hagar_secondary_load_releasedeath 1
+set g_balance_hagar_secondary_load_abort 1
 set g_balance_hagar_secondary_damage 30
 set g_balance_hagar_secondary_edgedamage 15
 set g_balance_hagar_secondary_force 50
index ee475e7e85eabc8d37c266d79f1495b1c9a11185..fbaf8c37b35437344670ed94002175cce580077a 100644 (file)
@@ -205,6 +205,9 @@ seta crosshair_ring_nex_currentcharge_movingavg_rate 0.05
 seta crosshair_ring_minelayer 1
 seta crosshair_ring_minelayer_alpha 0.15
 
+seta crosshair_ring_hagar 1
+seta crosshair_ring_hagar_alpha 0.15
+
 seta crosshair_ring_reload 1 "main cvar to enable or disable ammo crosshair rings"
 seta crosshair_ring_reload_size 2.5    "reload ring size"
 seta crosshair_ring_reload_alpha 0.2   "reload ring alpha"
@@ -216,7 +219,7 @@ fov 90
 seta cl_velocityzoom 0 "velocity based zooming of fov, negative values zoom out"
 seta cl_velocityzoomtime 0.3   "time value for averaging speed values"
 seta cl_zoomfactor 5   "how much +zoom will zoom (1-16)"
-seta cl_zoomspeed 3.5  "how fast it will zoom (0.5-16), negative values mean instant zoom"
+seta cl_zoomspeed 8    "how fast it will zoom (0.5-16), negative values mean instant zoom"
 seta cl_zoomsensitivity 0      "how zoom changes sensitivity (0 = weakest, 1 = strongest)"
 freelook 1
 sensitivity 6
@@ -407,6 +410,8 @@ net_connecttimeout 30
 sv_jumpstep 1 // step up stairs while jumping, makes it easier to reach ledges
 set ekg 0      "Throw huge amounts of gibs"
 
+seta sv_shownames_cull_distance 2500 "distance after which to not send origin/health/armor of another player"
+
 cl_movement 1
 cl_movement_track_canjump 0
 cl_stairsmoothspeed 200
@@ -1194,9 +1199,6 @@ set sv_curl_serverpackages_auto 1 "automatically add packs with *.serverpackage
 
 set sv_motd ""
 
-seta cl_shownames 1    "show player names pointed to (0: never, 1: teamplay only, 2: always)"
-set sv_allow_shownames 1
-
 set g_waypoints_for_items 1    "make waypoints out of items, values: 0 = never, 1 = unless the mapper prevents it by worldspawn.spawnflags & 1, 2 = always"
 
 seta g_maplist_votable 6 "number of maps that are shown in the map voting at the end of a match"
@@ -1430,10 +1432,16 @@ seta hud_panel_ammo_maxammo "40" "when you have this much ammo, the ammo status
 
 seta hud_panel_healtharmor_maxhealth "200" "when you have this much health, the health status bar is full"
 seta hud_panel_healtharmor_maxarmor "200" "when you have this much armor, the armor status bar is full"
+seta hud_panel_healtharmor_progressbar_gfx 1 "enable graphic effects on the progressbars"
+seta hud_panel_healtharmor_progressbar_gfx_damage 5 "show damage effect when damaged at least by this amount; 0 disables the effect"
+seta hud_panel_healtharmor_progressbar_gfx_lowhealth 40 "health progressbar blinks when health is lower than this amount"
+seta hud_panel_healtharmor_progressbar_gfx_smooth 2 "smooth changes of the progressbar when health/armor change at least by this amount; 0 disables the effect"
 
 seta hud_panel_notify_time 10 "time that a new entry stays until it fades out"
 seta hud_panel_notify_fadetime 3 "fade out time"
 
+seta hud_panel_modicons_dom_layout 1 "3 possible layouts: 0) only icons; 1) icons and percentage of average pps (points per second); 2) icons and average pps"
+
 seta hud_panel_timer_increment 0 "show elapsed time instead of remaining time"
 
 seta hud_panel_radar_scale 4096 "distance you can see on the team radar"
@@ -1441,13 +1449,24 @@ seta hud_panel_radar_rotation 0 "rotation mode: you set what points up. 0 = play
 seta hud_panel_radar_zoommode 0        "zoom mode: 0 = zoomed by default, 1 = zoomed when +zoom, 2 = always zoomed, 3 = always zoomed out"
 alias hud_panel_radar_rotate "toggle hud_panel_radar_rotation 0 1 2 3 4"
 
+seta hud_panel_score_rankings 0 "show rankings: 1 always show my own score; 2 pure rankings"
+
 seta hud_panel_engineinfo_framecounter_time 0.1 "time between framerate display updates"
 seta hud_panel_engineinfo_framecounter_decimals 0 "amount of decimals to show"
 seta hud_panel_engineinfo_framecounter_exponentialmovingaverage 1 "use an averaging method for calculating fps instead of counting frametime like engine does"
 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_showbinds 1   "the way to show the keys to press in HUD messages: 0 displays commands, 1 bound keys, 2 both"
+seta hud_panel_physics_speed_unit 3 "speed unit (1 = qu/s, 2 = m/s, 3 = km/h, 4 = mph, 5 = knots)"
+seta hud_panel_physics_speed_unit_show 1 "also show speed unit"
+seta hud_panel_physics_speed_max 1800 "speed progressbar gets filled up completely by this value (in qu/s)"
+seta hud_panel_physics_speed_vertical 0 "include the speed on the Z-axis"
+seta hud_panel_physics_topspeed 1 "also show top speed"
+seta hud_panel_physics_topspeed_time 4 "how many seconds the top speed takes to fade out"
+seta hud_panel_physics_acceleration_max 1.5 "acceleration progressbar gets completely filled up by this value (in g)"
+seta hud_panel_physics_acceleration_vertical 0 "include the acceleration on the Z-axis"
+
+seta hud_showbinds 1   "what to show in the HUD to indicate certain keys to press: 0 display commands, 1 bound keys, 2 both"
 seta hud_showbinds_limit 2     "maximum number of bound keys to show for a command. 0 for unlimited"
 
 seta hud_colorflash_alpha 0.5 "starting alpha of the color flash"
@@ -1476,6 +1495,20 @@ seta hud_contents_slime_color "0 0.4 0.1"
 seta hud_contents_water_alpha 0.5 "alpha of the water color blend when inside it"
 seta hud_contents_water_color "0.4 0.3 0.3"
 
+seta hud_shownames 1 "draw names and health/armor of nearby players"
+seta hud_shownames_enemies 2 "1 = draw names of enemies you point at, 2 = draw names of all enemies in view"
+seta hud_shownames_status 2 "1 = draw health/armor status of teammates, 2 = same as 1, but draw health/armor icons with a question mark on enemies in teamgames"
+seta hud_shownames_height 15 "height of icons"
+seta hud_shownames_aspect 8 "aspect ratio of total drawing area per name"
+seta hud_shownames_fontsize 13 "font size"
+seta hud_shownames_decolorize 1 "1 = decolorize name in team games, 2 = decolorize always"
+seta hud_shownames_alpha 0.7 "alpha"
+seta hud_shownames_resize 1 "enable resizing of the names, then the size cvars will correspond to the maximum size"
+seta hud_shownames_mindistance 1000 "start fading alpha/size at this distance"
+seta hud_shownames_maxdistance 2500 "alpha/size is 0 at this distance"
+seta hud_shownames_antioverlap 1 "if two tags get too close to each other, fade out the one further away from you"
+seta hud_shownames_antioverlap_distance 125 "2d distance to other tag after which to fade out"
+
 // scoreboard
 seta scoreboard_columns default
 seta scoreboard_border_thickness 1 "scoreboard border thickness"
@@ -1495,8 +1528,8 @@ seta scoreboard_fadeoutspeed 5 "speed at which scoreboard fades out, higher is f
 seta scoreboard_highlight 1 "enable highlighting for rows and columns in the scoreboard"
 seta scoreboard_highlight_alpha 0.10 "highlight alpha value (depends on hud_scoreboard_highlight 1)"
 seta scoreboard_highlight_alpha_self 0.25 "self highlight alpha value"
-seta scoreboard_offset_left 0.04 "how many pixels the scoreboard is offset from the left screen edge"
-seta scoreboard_offset_right 0.148 "how many pixels the scoreboard is offset from the right screen edge"
+seta scoreboard_offset_left 0.15 "how many pixels the scoreboard is offset from the left screen edge"
+seta scoreboard_offset_right 0.15 "how many pixels the scoreboard is offset from the right screen edge"
 seta scoreboard_bg_scale 0.25 "scale for the tiled scoreboard background"
 
 seta accuracy_color_levels "0 20 100" "accuracy values at which a specified color (accuracy_color<X>) will be used. If your accuracy is between 2 of these values then a mix of the Xth and X+1th colors will be used. You can specify up to 10 values, in increasing order"
@@ -1781,25 +1814,6 @@ seta cl_gentle_gibs 0            "client side gentle mode (only replaces gibs); when set t
 seta cl_gentle_messages 0      "client side gentle mode (only replaces frag messages/centerprints)"
 seta cl_gentle_damage 0                "client side gentle mode (only replaces damage flash); when set to 1, a white flash replaces the blood image, when set to 2, a randomily colored flash is used instead"
 
-seta cl_racetimer_position 0.25 "Y-axis positioning of the race timer (from 0 to 1)"
-seta cl_showpressedkeys        0       "Show which movement keys someone is pressing: 1 for spectating, 2 for always"
-seta cl_showpressedkeys_position "0.5 0.8"     "1 0 would be upper right corner, 0.5 0.5 the center"
-
-seta cl_showspeed 0 "show the XY speed of the player"
-seta cl_showspeed_unit 0 "unit selection (0 = qu/s (no postfix), 1 = qu/s, 2 = m/s, 3 = km/h, 4 = mph, 5 = knots)"
-seta cl_showspeed_z 0 "include the speed on the Z-axis"
-seta cl_showspeed_size 30 "size of the numbers"
-seta cl_showspeed_position 0.7 "Y-axis positioning of the numbers"
-
-seta cl_showacceleration 0 "show the XY acceleration of the player"
-seta cl_showacceleration_z 0 "include the speed on the Z-axis"
-seta cl_showacceleration_size 40 "height of the bar"
-seta cl_showacceleration_scale 1 "X-axis scale of the bar"
-seta cl_showacceleration_alpha 0.5 "alpha of the bar"
-seta cl_showacceleration_color_custom 0 "0 = dynamic color depending on acceleration, 1 = use custom color"
-seta cl_showacceleration_color "1 0 0" "color of the bar, needs cl_showacceleration_color_custom to be 1"
-seta cl_showacceleration_position 0.6 "Y-axis positioning of the bar"
-
 set g_jetpack 0 "Jetpack mutator (uses the hook's button, can't coexist with the offhand hook, but only with the onhand one)"
 
 set g_running_guns 0 "... or wonder, till it drives you mad, what would have followed if you had."
@@ -2020,10 +2034,6 @@ scr_conscroll3_y 0
 scr_conscroll_x -0.1
 scr_conscroll_y -0.3
 
-scr_loadingscreen_background 0
-scr_loadingscreen_barcolor "0 0.5 1"
-scr_loadingscreen_barheight 12
-scr_loadingscreen_count 1
 scr_conforcewhiledisconnected 0
 scr_infobar_height 12
 
@@ -2112,9 +2122,13 @@ set g_playerstats_debug 0 "when 1, player stats are dumped to the console too"
 set snd_soundradius 1200
 
 // loading screen
-scr_loadingscreen_scale 1
+scr_loadingscreen_background 0
+scr_loadingscreen_barcolor "0 0.5 1"
+scr_loadingscreen_barheight 12
+scr_loadingscreen_count 12
+scr_loadingscreen_scale 999
 scr_loadingscreen_scale_base 1
-scr_loadingscreen_scale_limit 1
+scr_loadingscreen_scale_limit 2
 
 // sRGB configuration (EXPERIMENTAL, needs maps to be relit)
 alias sRGBcorrect_on  "r_texture_sRGB_skin_diffuse 1;r_texture_sRGB_skin_gloss 1;r_texture_sRGB_skin_glow 1;r_texture_sRGB_reflect 1;r_texture_sRGB_skybox 1;v_gamma 2.2;r_restart"
diff --git a/gfx/hud/default/progressbar.tga b/gfx/hud/default/progressbar.tga
new file mode 100644 (file)
index 0000000..987c8f5
Binary files /dev/null and b/gfx/hud/default/progressbar.tga differ
diff --git a/gfx/hud/default/progressbar_vertical.tga b/gfx/hud/default/progressbar_vertical.tga
new file mode 100644 (file)
index 0000000..3c2d1a8
Binary files /dev/null and b/gfx/hud/default/progressbar_vertical.tga differ
diff --git a/gfx/hud/default/statusbar.tga b/gfx/hud/default/statusbar.tga
deleted file mode 100644 (file)
index 987c8f5..0000000
Binary files a/gfx/hud/default/statusbar.tga and /dev/null differ
diff --git a/gfx/hud/default/statusbar_vertical.tga b/gfx/hud/default/statusbar_vertical.tga
deleted file mode 100644 (file)
index 3c2d1a8..0000000
Binary files a/gfx/hud/default/statusbar_vertical.tga and /dev/null differ
diff --git a/gfx/hud/luminos/dom_icon_blue-highlighted.tga b/gfx/hud/luminos/dom_icon_blue-highlighted.tga
new file mode 100644 (file)
index 0000000..db2e356
Binary files /dev/null and b/gfx/hud/luminos/dom_icon_blue-highlighted.tga differ
diff --git a/gfx/hud/luminos/dom_icon_blue.tga b/gfx/hud/luminos/dom_icon_blue.tga
new file mode 100644 (file)
index 0000000..c78f373
Binary files /dev/null and b/gfx/hud/luminos/dom_icon_blue.tga differ
diff --git a/gfx/hud/luminos/dom_icon_pink-highlighted.tga b/gfx/hud/luminos/dom_icon_pink-highlighted.tga
new file mode 100644 (file)
index 0000000..3564019
Binary files /dev/null and b/gfx/hud/luminos/dom_icon_pink-highlighted.tga differ
diff --git a/gfx/hud/luminos/dom_icon_pink.tga b/gfx/hud/luminos/dom_icon_pink.tga
new file mode 100644 (file)
index 0000000..be51849
Binary files /dev/null and b/gfx/hud/luminos/dom_icon_pink.tga differ
diff --git a/gfx/hud/luminos/dom_icon_red-highlighted.tga b/gfx/hud/luminos/dom_icon_red-highlighted.tga
new file mode 100644 (file)
index 0000000..ea4415e
Binary files /dev/null and b/gfx/hud/luminos/dom_icon_red-highlighted.tga differ
diff --git a/gfx/hud/luminos/dom_icon_red.tga b/gfx/hud/luminos/dom_icon_red.tga
new file mode 100644 (file)
index 0000000..58a1fe2
Binary files /dev/null and b/gfx/hud/luminos/dom_icon_red.tga differ
diff --git a/gfx/hud/luminos/dom_icon_yellow-highlighted.tga b/gfx/hud/luminos/dom_icon_yellow-highlighted.tga
new file mode 100644 (file)
index 0000000..90be4ac
Binary files /dev/null and b/gfx/hud/luminos/dom_icon_yellow-highlighted.tga differ
diff --git a/gfx/hud/luminos/dom_icon_yellow.tga b/gfx/hud/luminos/dom_icon_yellow.tga
new file mode 100644 (file)
index 0000000..4d11505
Binary files /dev/null and b/gfx/hud/luminos/dom_icon_yellow.tga differ
diff --git a/gfx/hud/luminos/progressbar.tga b/gfx/hud/luminos/progressbar.tga
new file mode 100644 (file)
index 0000000..987c8f5
Binary files /dev/null and b/gfx/hud/luminos/progressbar.tga differ
diff --git a/gfx/hud/luminos/progressbar_vertical.tga b/gfx/hud/luminos/progressbar_vertical.tga
new file mode 100644 (file)
index 0000000..3c2d1a8
Binary files /dev/null and b/gfx/hud/luminos/progressbar_vertical.tga differ
diff --git a/gfx/hud/luminos/shield.tga b/gfx/hud/luminos/shield.tga
new file mode 100644 (file)
index 0000000..f13f0b4
Binary files /dev/null and b/gfx/hud/luminos/shield.tga differ
diff --git a/gfx/hud/luminos/statusbar.tga b/gfx/hud/luminos/statusbar.tga
deleted file mode 100644 (file)
index 987c8f5..0000000
Binary files a/gfx/hud/luminos/statusbar.tga and /dev/null differ
diff --git a/gfx/hud/luminos/statusbar_vertical.tga b/gfx/hud/luminos/statusbar_vertical.tga
deleted file mode 100644 (file)
index 3c2d1a8..0000000
Binary files a/gfx/hud/luminos/statusbar_vertical.tga and /dev/null differ
diff --git a/gfx/hud/luminos/strength.tga b/gfx/hud/luminos/strength.tga
new file mode 100644 (file)
index 0000000..b19019d
Binary files /dev/null and b/gfx/hud/luminos/strength.tga differ
diff --git a/gfx/hud/old/dom_icon_blue-highlighted.tga b/gfx/hud/old/dom_icon_blue-highlighted.tga
new file mode 100644 (file)
index 0000000..a1ee2f0
Binary files /dev/null and b/gfx/hud/old/dom_icon_blue-highlighted.tga differ
diff --git a/gfx/hud/old/dom_icon_blue.tga b/gfx/hud/old/dom_icon_blue.tga
new file mode 100644 (file)
index 0000000..9524e70
Binary files /dev/null and b/gfx/hud/old/dom_icon_blue.tga differ
diff --git a/gfx/hud/old/dom_icon_pink-highlighted.tga b/gfx/hud/old/dom_icon_pink-highlighted.tga
new file mode 100644 (file)
index 0000000..748e2ad
Binary files /dev/null and b/gfx/hud/old/dom_icon_pink-highlighted.tga differ
diff --git a/gfx/hud/old/dom_icon_pink.tga b/gfx/hud/old/dom_icon_pink.tga
new file mode 100644 (file)
index 0000000..504c849
Binary files /dev/null and b/gfx/hud/old/dom_icon_pink.tga differ
diff --git a/gfx/hud/old/dom_icon_red-highlighted.tga b/gfx/hud/old/dom_icon_red-highlighted.tga
new file mode 100644 (file)
index 0000000..cba4b3b
Binary files /dev/null and b/gfx/hud/old/dom_icon_red-highlighted.tga differ
diff --git a/gfx/hud/old/dom_icon_red.tga b/gfx/hud/old/dom_icon_red.tga
new file mode 100644 (file)
index 0000000..566614d
Binary files /dev/null and b/gfx/hud/old/dom_icon_red.tga differ
diff --git a/gfx/hud/old/dom_icon_yellow-highlighted.tga b/gfx/hud/old/dom_icon_yellow-highlighted.tga
new file mode 100644 (file)
index 0000000..02e7fb8
Binary files /dev/null and b/gfx/hud/old/dom_icon_yellow-highlighted.tga differ
diff --git a/gfx/hud/old/dom_icon_yellow.tga b/gfx/hud/old/dom_icon_yellow.tga
new file mode 100644 (file)
index 0000000..ef8fa8d
Binary files /dev/null and b/gfx/hud/old/dom_icon_yellow.tga differ
diff --git a/gfx/hud/old/progressbar.tga b/gfx/hud/old/progressbar.tga
new file mode 100644 (file)
index 0000000..0bbad17
Binary files /dev/null and b/gfx/hud/old/progressbar.tga differ
diff --git a/gfx/hud/old/progressbar_vertical.tga b/gfx/hud/old/progressbar_vertical.tga
new file mode 100644 (file)
index 0000000..d63a37f
Binary files /dev/null and b/gfx/hud/old/progressbar_vertical.tga differ
diff --git a/gfx/hud/old/statusbar.tga b/gfx/hud/old/statusbar.tga
deleted file mode 100644 (file)
index 0bbad17..0000000
Binary files a/gfx/hud/old/statusbar.tga and /dev/null differ
diff --git a/gfx/hud/old/statusbar_vertical.tga b/gfx/hud/old/statusbar_vertical.tga
deleted file mode 100644 (file)
index d63a37f..0000000
Binary files a/gfx/hud/old/statusbar_vertical.tga and /dev/null differ
index 44ebb5294a7921b0f8e52f86753a6dcc7d0b0dbc..76a7edf1fad45a5333f64ec13d3430c071efa4d2 100644 (file)
Binary files a/gfx/loading.tga and b/gfx/loading.tga differ
diff --git a/gfx/loading10.tga b/gfx/loading10.tga
new file mode 100644 (file)
index 0000000..5f453be
Binary files /dev/null and b/gfx/loading10.tga differ
diff --git a/gfx/loading11.tga b/gfx/loading11.tga
new file mode 100644 (file)
index 0000000..5fb261e
Binary files /dev/null and b/gfx/loading11.tga differ
diff --git a/gfx/loading12.tga b/gfx/loading12.tga
new file mode 100644 (file)
index 0000000..6345a9a
Binary files /dev/null and b/gfx/loading12.tga differ
diff --git a/gfx/loading2.tga b/gfx/loading2.tga
new file mode 100644 (file)
index 0000000..3aa4a29
Binary files /dev/null and b/gfx/loading2.tga differ
diff --git a/gfx/loading3.tga b/gfx/loading3.tga
new file mode 100644 (file)
index 0000000..6396085
Binary files /dev/null and b/gfx/loading3.tga differ
diff --git a/gfx/loading4.tga b/gfx/loading4.tga
new file mode 100644 (file)
index 0000000..eaf44d0
Binary files /dev/null and b/gfx/loading4.tga differ
diff --git a/gfx/loading5.tga b/gfx/loading5.tga
new file mode 100644 (file)
index 0000000..c06d323
Binary files /dev/null and b/gfx/loading5.tga differ
diff --git a/gfx/loading6.tga b/gfx/loading6.tga
new file mode 100644 (file)
index 0000000..7c8007c
Binary files /dev/null and b/gfx/loading6.tga differ
diff --git a/gfx/loading7.tga b/gfx/loading7.tga
new file mode 100644 (file)
index 0000000..56aa4af
Binary files /dev/null and b/gfx/loading7.tga differ
diff --git a/gfx/loading8.tga b/gfx/loading8.tga
new file mode 100644 (file)
index 0000000..a41d344
Binary files /dev/null and b/gfx/loading8.tga differ
diff --git a/gfx/loading9.tga b/gfx/loading9.tga
new file mode 100644 (file)
index 0000000..dc63603
Binary files /dev/null and b/gfx/loading9.tga differ
diff --git a/gfx/ons-frame-team.tga b/gfx/ons-frame-team.tga
deleted file mode 100644 (file)
index fb97397..0000000
Binary files a/gfx/ons-frame-team.tga and /dev/null differ
diff --git a/gfx/ons-frame.tga b/gfx/ons-frame.tga
deleted file mode 100644 (file)
index 13a8912..0000000
Binary files a/gfx/ons-frame.tga and /dev/null differ
index 57be0d0a7fd69fa718e1583389404ee6c8a984b5..4c11d42079856dee560dc26463a74c9e2001df10 100644 (file)
@@ -19,8 +19,11 @@ seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
 seta hud_progressbar_nexball_color "0.7 0.1 0"
+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 "12 9 10 5 6 14 0 7 4 11 2 1 3 8 13 "
+seta _hud_panelorder "15 12 9 10 5 6 14 0 7 4 11 2 1 3 8 13 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
@@ -72,10 +75,10 @@ seta hud_panel_powerups_bg_color ""
 seta hud_panel_powerups_bg_color_team ""
 seta hud_panel_powerups_bg_alpha ""
 seta hud_panel_powerups_bg_border ""
-seta hud_panel_powerups_bg_padding "0"
-seta hud_panel_powerups_flip "0"
-seta hud_panel_powerups_iconalign "4"
-seta hud_panel_powerups_baralign "4"
+seta hud_panel_powerups_bg_padding ""
+seta hud_panel_powerups_flip "1"
+seta hud_panel_powerups_iconalign "3"
+seta hud_panel_powerups_baralign "3"
 seta hud_panel_powerups_progressbar "1"
 seta hud_panel_powerups_progressbar_strength "progressbar"
 seta hud_panel_powerups_progressbar_shield "progressbar"
@@ -91,8 +94,8 @@ seta hud_panel_healtharmor_bg_alpha ""
 seta hud_panel_healtharmor_bg_border ""
 seta hud_panel_healtharmor_bg_padding ""
 seta hud_panel_healtharmor_flip "0"
-seta hud_panel_healtharmor_iconalign "4"
-seta hud_panel_healtharmor_baralign "4"
+seta hud_panel_healtharmor_iconalign "3"
+seta hud_panel_healtharmor_baralign "3"
 seta hud_panel_healtharmor_progressbar "1"
 seta hud_panel_healtharmor_progressbar_health "progressbar"
 seta hud_panel_healtharmor_progressbar_armor "progressbar"
@@ -215,4 +218,19 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
+seta hud_panel_physics 0
+seta hud_panel_physics_pos "0.420000 0.620000"
+seta hud_panel_physics_size "0.170000 0.080000"
+seta hud_panel_physics_bg ""
+seta hud_panel_physics_bg_color ""
+seta hud_panel_physics_bg_color_team ""
+seta hud_panel_physics_bg_alpha ""
+seta hud_panel_physics_bg_border ""
+seta hud_panel_physics_bg_padding ""
+seta hud_panel_physics_flip "0"
+seta hud_panel_physics_baralign "0"
+seta hud_panel_physics_acceleration_progressbar_mode "0"
+seta hud_panel_physics_progressbar "1"
+seta hud_panel_physics_text "1"
+
 menu_sync
index fef69f23fd52f73104af2e0f42558d132c931852..5d803304475b0b1a78ee8416ef6a2c62bff8db55 100644 (file)
@@ -19,8 +19,11 @@ seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
 seta hud_progressbar_nexball_color "0.7 0.1 0"
+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 "
+seta _hud_panelorder "10 3 0 14 6 9 13 4 1 2 11 12 7 5 8 15 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
@@ -215,4 +218,19 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
+seta hud_panel_physics 0
+seta hud_panel_physics_pos "0.440000 0.590000"
+seta hud_panel_physics_size "0.120000 0.050000"
+seta hud_panel_physics_bg ""
+seta hud_panel_physics_bg_color ""
+seta hud_panel_physics_bg_color_team ""
+seta hud_panel_physics_bg_alpha ""
+seta hud_panel_physics_bg_border ""
+seta hud_panel_physics_bg_padding ""
+seta hud_panel_physics_flip "0"
+seta hud_panel_physics_baralign "0"
+seta hud_panel_physics_acceleration_progressbar_mode "0"
+seta hud_panel_physics_progressbar "3"
+seta hud_panel_physics_text "2"
+
 menu_sync
index ca8ea38de05476976feaf3a64b31755697d7cd44..a5e16e75a4acb7430e89a8c3e67bf1e07980ce77 100644 (file)
@@ -19,8 +19,11 @@ seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
 seta hud_progressbar_nexball_color "0.7 0.1 0"
+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 9 6 8 14 5 0 4 13 2 7 1 3 11 12 "
+seta _hud_panelorder "15 10 9 6 8 14 5 0 4 13 2 7 1 3 11 12 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
@@ -74,8 +77,8 @@ seta hud_panel_powerups_bg_alpha ""
 seta hud_panel_powerups_bg_border ""
 seta hud_panel_powerups_bg_padding ""
 seta hud_panel_powerups_flip "1"
-seta hud_panel_powerups_iconalign "4"
-seta hud_panel_powerups_baralign "4"
+seta hud_panel_powerups_iconalign "3"
+seta hud_panel_powerups_baralign "3"
 seta hud_panel_powerups_progressbar "1"
 seta hud_panel_powerups_progressbar_strength "progressbar"
 seta hud_panel_powerups_progressbar_shield "progressbar"
@@ -91,8 +94,8 @@ seta hud_panel_healtharmor_bg_alpha ""
 seta hud_panel_healtharmor_bg_border ""
 seta hud_panel_healtharmor_bg_padding ""
 seta hud_panel_healtharmor_flip "0"
-seta hud_panel_healtharmor_iconalign "4"
-seta hud_panel_healtharmor_baralign "4"
+seta hud_panel_healtharmor_iconalign "3"
+seta hud_panel_healtharmor_baralign "3"
 seta hud_panel_healtharmor_progressbar "1"
 seta hud_panel_healtharmor_progressbar_health "progressbar"
 seta hud_panel_healtharmor_progressbar_armor "progressbar"
@@ -215,4 +218,19 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
+seta hud_panel_physics 0
+seta hud_panel_physics_pos "0.410000 0.590000"
+seta hud_panel_physics_size "0.180000 0.100000"
+seta hud_panel_physics_bg ""
+seta hud_panel_physics_bg_color ""
+seta hud_panel_physics_bg_color_team ""
+seta hud_panel_physics_bg_alpha ""
+seta hud_panel_physics_bg_border ""
+seta hud_panel_physics_bg_padding ""
+seta hud_panel_physics_flip "0"
+seta hud_panel_physics_baralign "0"
+seta hud_panel_physics_acceleration_progressbar_mode "0"
+seta hud_panel_physics_progressbar "1"
+seta hud_panel_physics_text "1"
+
 menu_sync
index e054fa0e44a1a2ae95b34a71d58e05d050316bb1..55a1149e9226adbe2140ddaae253cf51cdd4fcba 100644 (file)
@@ -19,8 +19,11 @@ seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
 seta hud_progressbar_nexball_color "0.7 0.1 0"
+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 "3 1 2 11 10 0 14 6 9 13 4 12 7 5 8 "
+seta _hud_panelorder "15 3 1 2 11 10 0 14 6 9 13 4 12 7 5 8 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.010000"
@@ -215,4 +218,19 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding "0"
 seta hud_panel_infomessages_flip "1"
 
+seta hud_panel_physics 0
+seta hud_panel_physics_pos "0.270000 0.730000"
+seta hud_panel_physics_size "0.170000 0.030000"
+seta hud_panel_physics_bg ""
+seta hud_panel_physics_bg_color ""
+seta hud_panel_physics_bg_color_team ""
+seta hud_panel_physics_bg_alpha ""
+seta hud_panel_physics_bg_border ""
+seta hud_panel_physics_bg_padding ""
+seta hud_panel_physics_flip "0"
+seta hud_panel_physics_baralign "0"
+seta hud_panel_physics_acceleration_progressbar_mode "0"
+seta hud_panel_physics_progressbar "3"
+seta hud_panel_physics_text "2"
+
 menu_sync
index cfa50af89acb4dd8add91079c3c9cfcc7a886954..87bebc5d035fd5e49d33a74a149e23ffcce4bbc3 100644 (file)
@@ -19,8 +19,11 @@ seta hud_progressbar_health_color "0.6 0 0"
 seta hud_progressbar_armor_color "0 0.6 0"
 seta hud_progressbar_fuel_color "0.6 0.6 0"
 seta hud_progressbar_nexball_color "0.7 0.1 0"
+seta hud_progressbar_speed_color "0.25 0.25 1"
+seta hud_progressbar_acceleration_color "0.25 1 0.25"
+seta hud_progressbar_acceleration_neg_color "1 0.25 0.25"
 
-seta _hud_panelorder "0 11 8 5 6 14 9 13 7 2 3 1 10 12 4 "
+seta _hud_panelorder "15 0 11 8 5 6 14 9 13 7 2 3 1 10 12 4 "
 
 seta hud_configure_grid "1"
 seta hud_configure_grid_xsize "0.01"
@@ -101,10 +104,10 @@ seta hud_panel_healtharmor_text "1"
 seta hud_panel_notify 0
 seta hud_panel_notify_pos "0 0.650000"
 seta hud_panel_notify_size "0.300000 0.070000"
-seta hud_panel_notify_bg ""
+seta hud_panel_notify_bg "0"
 seta hud_panel_notify_bg_color ""
 seta hud_panel_notify_bg_color_team ""
-seta hud_panel_notify_bg_alpha "0"
+seta hud_panel_notify_bg_alpha ""
 seta hud_panel_notify_bg_border ""
 seta hud_panel_notify_bg_padding ""
 seta hud_panel_notify_flip "0"
@@ -215,4 +218,19 @@ seta hud_panel_infomessages_bg_border ""
 seta hud_panel_infomessages_bg_padding ""
 seta hud_panel_infomessages_flip "1"
 
+seta hud_panel_physics 0
+seta hud_panel_physics_pos "0.430000 0.640000"
+seta hud_panel_physics_size "0.140000 0.100000"
+seta hud_panel_physics_bg "0"
+seta hud_panel_physics_bg_color ""
+seta hud_panel_physics_bg_color_team ""
+seta hud_panel_physics_bg_alpha ""
+seta hud_panel_physics_bg_border ""
+seta hud_panel_physics_bg_padding ""
+seta hud_panel_physics_flip "0"
+seta hud_panel_physics_baralign "0"
+seta hud_panel_physics_acceleration_progressbar_mode "0"
+seta hud_panel_physics_progressbar "3"
+seta hud_panel_physics_text "2"
+
 menu_sync
index b3b0569489d992798c0ea9355f3a7a5296730968..666fd8823e1eec2930fec848188efd9deb85ece0 100644 (file)
@@ -263,6 +263,8 @@ float nex_scope;
 
 float minelayer_maxmines;
 
+float hagar_maxrockets;
+
 float bgmtime;
 
 string weaponorder_byimpulse;
index 0609b3d177b74e43840d12e454dae0ac4779c4e5..cb456393fe197c198cd555a1034b5d63757a7852 100644 (file)
@@ -169,7 +169,9 @@ void CSQC_Init(void)
        minimapname = strzone(minimapname);
 
        WarpZone_Init();
+
        hud_configure_prev = -1;
+       tab_panel = -1;
 }
 
 // CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc)
@@ -592,6 +594,7 @@ void GameCommand(string msg)
             vote_prev = 0;
             cvar_set("cl_allow_uid2name", "1");
             vote_change = -9999;
+                       uid2name_dialog = 0;
         }
         else
         {
@@ -606,6 +609,7 @@ void GameCommand(string msg)
             vote_prev = 0;
             cvar_set("cl_allow_uid2name", "0");
             vote_change = -9999;
+                       uid2name_dialog = 0;
         }
         else
         {
@@ -650,6 +654,10 @@ float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary)
 
 // --------------------------------------------------------------------------
 // BEGIN OPTIONAL CSQC FUNCTIONS
+void Ent_RemoveEntCS()
+{
+       entcs_receiver[self.sv_entnum] = world;
+}
 void Ent_ReadEntCS()
 {
        InterpolateOrigin_Undo();
@@ -660,7 +668,9 @@ void Ent_ReadEntCS()
        self.origin_y = ReadShort();
        self.origin_z = ReadShort();
        self.angles_y = ReadByte() * 360.0 / 256;
-       self.origin_z = self.angles_x = self.angles_z = 0;
+       self.angles_x = self.angles_z = 0;
+       entcs_receiver[self.sv_entnum] = self;
+       self.entremove = Ent_RemoveEntCS;
 
        InterpolateOrigin_Note();
 }
@@ -694,7 +704,8 @@ void Ent_ReadPlayerScore()
 #ifdef DP_CSQC_ENTITY_REMOVE_IS_B0RKED
        if(!isNew && n != self.sv_entnum)
        {
-               print(_("A CSQC entity changed its owner!\n"));
+               //print(_("A CSQC entity changed its owner!\n"));
+               print(sprintf(_("A CSQC entity changed its owner! (edict: %d, classname: %s)\n"), num_for_edict(self), self.classname));
                isNew = true;
                Ent_Remove();
                self.enttype = ENT_CLIENT_SCORES;
@@ -766,10 +777,6 @@ void Ent_ReadTeamScore()
        HUD_UpdateTeamPos(o);
 }
 
-void Net_Reset()
-{
-}
-
 void Ent_ClientData()
 {
        float f;
@@ -808,6 +815,15 @@ void Ent_ClientData()
                race_laptime = 0;
                race_checkpointtime = 0;
        }
+       if (autocvar_hud_panel_healtharmor_progressbar_gfx)
+       {
+               if ( (spectatee_status == -1 && newspectatee_status > 0) //before observing, now spectating
+                 || (spectatee_status > 0 && newspectatee_status > 0 && spectatee_status != newspectatee_status) //changed spectated player
+               )
+                       prev_p_health = -1;
+               else if(spectatee_status && !newspectatee_status) //before observing/spectating, now playing
+                       prev_health = -1;
+       }
        spectatee_status = newspectatee_status;
 }
 
@@ -880,6 +896,41 @@ void Ent_ReadAccuracy(void)
        }
 }
 
+void Ent_ShowNames()
+{
+    float sf;
+
+    // entity init, TODO can this be done only once somehow?
+    self.the_entnum = ReadByte(); // TODO: fixme to only send once somehow
+    self.draw2d = Draw_ShowNames;
+    //self.movetype = MOVETYPE_FLY; // movetype needed so we can traceline?
+    self.mins = '-20 -20 -24';
+    self.maxs = '20 20 45';
+    self.classname = "shownames_tag";
+
+    sf = ReadByte();
+
+    if(sf & 1)
+    {
+        self.origin_x = ReadShort();
+        self.origin_y = ReadShort();
+        self.origin_z = ReadShort();
+    }
+    if(sf & 2)
+    {
+        self.healthvalue = ReadByte();
+    }
+    if(sf & 4)
+    {
+        self.armorvalue = ReadByte();
+    }
+
+    if(sf & 128) // same team
+        self.sameteam = TRUE;
+    else
+        self.sameteam = FALSE;
+}
+
 // CSQC_Ent_Update : Called every frame that the server has indicated an update to the SSQC / CSQC entity has occured.
 // The only parameter reflects if the entity is "new" to the client, meaning it just came into the client's PVS.
 void Ent_RadarLink();
@@ -908,7 +959,8 @@ void(float bIsNewEntity) CSQC_Ent_Update =
        if(self.enttype)
                if(t != self.enttype)
                {
-                       print(_("A CSQC entity changed its type!\n"));
+                       //print(_("A CSQC entity changed its type!\n"));
+                       print(sprintf(_("A CSQC entity changed its type! (edict: %d, classname: %s)\n"), num_for_edict(self), self.classname));
                        Ent_Remove();
                        bIsNewEntity = 1;
                }
@@ -945,8 +997,10 @@ void(float bIsNewEntity) CSQC_Ent_Update =
                case ENT_CLIENT_LGBEAM: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_LGBEAM); break;
                case ENT_CLIENT_GAUNTLET: Ent_ReadHook(bIsNewEntity, ENT_CLIENT_GAUNTLET); break;
                case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break;
+               case ENT_CLIENT_SHOWNAMES: Ent_ShowNames(); break;
                default:
-                       error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype));
+                       //error(strcat(_("unknown entity type in CSQC_Ent_Update: %d\n"), self.enttype));
+                       error(sprintf(_("Unknown entity type in CSQC_Ent_Update (enttype: %d, edict: %d, classname: %s)\n"), self.enttype, num_for_edict(self), self.classname));
                        break;
        }
 
@@ -976,15 +1030,6 @@ void CSQC_Ent_Remove()
 
 void Gamemode_Init()
 {
-       if(gametype == GAME_ONSLAUGHT) {
-               print(strcat("Using ", minimapname, " as minimap.\n"));
-               precache_pic("gfx/ons-cp-neutral.tga");
-               precache_pic("gfx/ons-cp-red.tga");
-               precache_pic("gfx/ons-cp-blue.tga");
-               precache_pic("gfx/ons-frame.tga");
-               precache_pic("gfx/ons-frame-team.tga");
-       }
-
        if not(isdemo())
        {
                localcmd("\n_cl_hook_gamestart ", GametypeNameFromType(gametype), "\n");
@@ -1077,6 +1122,8 @@ void Ent_Init()
 
        minelayer_maxmines = ReadByte();
 
+       hagar_maxrockets = ReadByte();
+
        g_trueaim_minrange = ReadCoord();
 
        if(!postinit)
@@ -1391,7 +1438,7 @@ string getcommandkey(string text, string command)
        string keys;
        float n, j, k, l;
 
-       if (!hud_showbinds)
+       if (!autocvar_hud_showbinds)
                return text;
 
        keys = db_get(binddb, command);
@@ -1409,7 +1456,7 @@ string getcommandkey(string text, string command)
                                        keys = strcat(keys, ", ", keynumtostring(k));
 
                                ++l;
-                               if (hud_showbinds_limit > 0 && hud_showbinds_limit >= l) break;
+                               if (autocvar_hud_showbinds_limit > 0 && autocvar_hud_showbinds_limit >= l) break;
                        }
 
                }
@@ -1417,12 +1464,12 @@ string getcommandkey(string text, string command)
        }
 
        if ("" == keys) {
-               if (hud_showbinds > 1)
+               if (autocvar_hud_showbinds > 1)
                        return sprintf(_("%s (not bound)"), text);
                else
                        return text;
        }
-       else if (hud_showbinds > 1)
+       else if (autocvar_hud_showbinds > 1)
                return sprintf(_("%s (%s)"), text, keys);
        else
                return keys;
index 6e4098fa226be35074ef146f000b2a8b8dc974c0..f1ba9abfde0f30860099e4e41237845b8040e580 100644 (file)
@@ -454,6 +454,7 @@ void CSQC_UpdateView(float w, float h)
                        eventchase_target_origin = pmove_org - v_forward * eventchase_current_distance * (trace_fraction - 0.1);
 
                        R_SetView(VF_ORIGIN, eventchase_target_origin);
+                       R_SetView(VF_ANGLES, view_angles);
                }
                else if(autocvar_chase_active < 0) // time to disable chase_active if it was set by this code
                {
@@ -605,10 +606,6 @@ void CSQC_UpdateView(float w, float h)
        // Draw the Engine Status Bar (the default Quake HUD)
        R_SetView(VF_DRAWENGINEHUD, 0);
 
-       // fetch this one only once per frame
-       hud_showbinds = autocvar_hud_showbinds;
-       hud_showbinds_limit = autocvar_hud_showbinds_limit;
-
        // Update the mouse position
        /*
           mousepos_x = vid_conwidth;
@@ -1171,6 +1168,13 @@ void CSQC_UpdateView(float w, float h)
                                        ring_rgb = wcross_color;
                                        ring_image = "gfx/crosshair_ring.tga";
                                }
+                               else if (activeweapon == WEP_HAGAR && getstati(STAT_HAGAR_LOAD) && autocvar_crosshair_ring_hagar)
+                               {
+                                       ring_value = bound(0, getstati(STAT_HAGAR_LOAD) / hagar_maxrockets, 1);
+                                       ring_alpha = autocvar_crosshair_ring_hagar_alpha;
+                                       ring_rgb = wcross_color;
+                                       ring_image = "gfx/crosshair_ring.tga";
+                               }
 
                                if(autocvar_crosshair_ring_reload && weapon_clipsize) // forces there to be only an ammo ring 
                                {
@@ -1598,7 +1602,6 @@ const float STAT_VEHICLESTAT_RELOAD2 = 66;
 
 }
 
-
 void CSQC_common_hud(void)
 {
        // HUD_SortFrags(); done in HUD_Draw
index 6d157405b04653cadafb3933e162022de10aec41..1e48eed9de3e68e53a636a1fcbeb3a1c277d9ec9 100644 (file)
@@ -60,19 +60,6 @@ float autocvar_cl_readpicture_force;
 float autocvar_cl_reticle_item_nex;
 float autocvar_cl_reticle_item_normal;
 float autocvar_cl_reticle_stretch;
-float autocvar_cl_showacceleration;
-float autocvar_cl_showacceleration_alpha;
-string autocvar_cl_showacceleration_color;
-float autocvar_cl_showacceleration_color_custom;
-float autocvar_cl_showacceleration_position;
-float autocvar_cl_showacceleration_scale;
-float autocvar_cl_showacceleration_size;
-float autocvar_cl_showacceleration_z;
-float autocvar_cl_showspeed;
-float autocvar_cl_showspeed_position;
-float autocvar_cl_showspeed_size;
-float autocvar_cl_showspeed_unit;
-float autocvar_cl_showspeed_z;
 float autocvar_cl_sound_maptime_warning;
 float autocvar_cl_stripcolorcodes;
 var float autocvar_cl_vehicle_spiderbot_cross_alpha = 0.6;
@@ -85,6 +72,7 @@ float autocvar_cl_zoomsensitivity;
 float autocvar_cl_zoomspeed;
 float autocvar_con_chat;
 float autocvar_con_chatpos;
+float autocvar_con_chatrect;
 float autocvar_con_chatsize;
 float autocvar_con_chattime;
 float autocvar_con_notify;
@@ -112,6 +100,8 @@ float autocvar_crosshair_ring;
 float autocvar_crosshair_ring_inner;
 float autocvar_crosshair_ring_minelayer;
 float autocvar_crosshair_ring_minelayer_alpha;
+float autocvar_crosshair_ring_hagar;
+float autocvar_crosshair_ring_hagar_alpha;
 float autocvar_crosshair_ring_nex;
 float autocvar_crosshair_ring_nex_alpha;
 float autocvar_crosshair_ring_nex_currentcharge_movingavg_rate;
@@ -210,16 +200,36 @@ float autocvar_hud_panel_healtharmor_maxhealth;
 float autocvar_hud_panel_healtharmor_progressbar;
 string autocvar_hud_panel_healtharmor_progressbar_armor;
 string autocvar_hud_panel_healtharmor_progressbar_health;
+float autocvar_hud_panel_healtharmor_progressbar_gfx;
+float autocvar_hud_panel_healtharmor_progressbar_gfx_damage;
+float autocvar_hud_panel_healtharmor_progressbar_gfx_lowhealth;
+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_modicons;
+float autocvar_hud_panel_modicons_dom_layout;
 float autocvar_hud_panel_notify;
 float autocvar_hud_panel_notify_fadetime;
 float autocvar_hud_panel_notify_flip;
 float autocvar_hud_panel_notify_fontsize;
 float autocvar_hud_panel_notify_print;
 float autocvar_hud_panel_notify_time;
+float autocvar_hud_panel_physics;
+float autocvar_hud_panel_physics_acceleration_progressbar_mode;
+float autocvar_hud_panel_physics_acceleration_max;
+float autocvar_hud_panel_physics_progressbar;
+float autocvar_hud_panel_physics_acceleration_vertical;
+float autocvar_hud_panel_physics_baralign;
+float autocvar_hud_panel_physics_flip;
+float autocvar_hud_panel_physics_speed_max;
+float autocvar_hud_panel_physics_speed_unit;
+float autocvar_hud_panel_physics_speed_unit_show;
+float autocvar_hud_panel_physics_speed_vertical;
+float autocvar_hud_panel_physics_text;
+float autocvar_hud_panel_physics_topspeed;
+float autocvar_hud_panel_physics_topspeed_time;
 float autocvar_hud_panel_powerups;
 float autocvar_hud_panel_powerups_baralign;
 float autocvar_hud_panel_powerups_flip;
@@ -237,6 +247,7 @@ float autocvar_hud_panel_radar_rotation;
 float autocvar_hud_panel_radar_scale;
 float autocvar_hud_panel_radar_zoommode;
 float autocvar_hud_panel_score;
+float autocvar_hud_panel_score_rankings;
 float autocvar_hud_panel_timer;
 float autocvar_hud_panel_timer_increment;
 float autocvar_hud_panel_vote;
@@ -267,6 +278,19 @@ float autocvar_hud_panel_weapons_timeout_effect;
 float autocvar_hud_progressbar_alpha;
 float autocvar_hud_showbinds;
 float autocvar_hud_showbinds_limit;
+float autocvar_hud_shownames;
+float autocvar_hud_shownames_enemies;
+float autocvar_hud_shownames_status;
+float autocvar_hud_shownames_height;
+float autocvar_hud_shownames_aspect;
+float autocvar_hud_shownames_fontsize;
+float autocvar_hud_shownames_decolorize;
+float autocvar_hud_shownames_alpha;
+float autocvar_hud_shownames_resize;
+float autocvar_hud_shownames_mindistance;
+float autocvar_hud_shownames_maxdistance;
+float autocvar_hud_shownames_antioverlap;
+float autocvar_hud_shownames_antioverlap_distance;
 string autocvar_hud_skin;
 float autocvar_loddebug;
 float autocvar_menu_mouse_speed;
index 6a5536bcda95e0035ef23dbdb72d4c50d59b2512..c224fcd7ccb386855fe0e96bc35d350bf41d5ce8 100644 (file)
@@ -424,1055 +424,138 @@ HUD panels
 ==================
 */
 
-#define HUD_Write(s) fputs(fh, s)
-// q: quoted, n: not quoted
-#define HUD_Write_Cvar_n(cvar) HUD_Write(strcat("seta ", cvar, " ", cvar_string(cvar), "\n"))
-#define HUD_Write_Cvar_q(cvar) HUD_Write(strcat("seta ", cvar, " \"", cvar_string(cvar), "\"\n"))
-#define HUD_Write_PanelCvar_n(cvar_suf) HUD_Write_Cvar_n(strcat("hud_panel_", panel_name, cvar_suf))
-#define HUD_Write_PanelCvar_q(cvar_suf) HUD_Write_Cvar_q(strcat("hud_panel_", panel_name, cvar_suf))
-// Save the config
-void HUD_Panel_ExportCfg(string cfgname)
-{
-       float fh;
-       string filename = strcat("hud_", autocvar_hud_skin, "_", cfgname, ".cfg");
-       fh = fopen(filename, FILE_WRITE);
-       if(fh >= 0)
-       {
-               HUD_Write_Cvar_q("hud_skin");
-               HUD_Write_Cvar_q("hud_panel_bg");
-               HUD_Write_Cvar_q("hud_panel_bg_color");
-               HUD_Write_Cvar_q("hud_panel_bg_color_team");
-               HUD_Write_Cvar_q("hud_panel_bg_alpha");
-               HUD_Write_Cvar_q("hud_panel_bg_border");
-               HUD_Write_Cvar_q("hud_panel_bg_padding");
-               HUD_Write_Cvar_q("hud_panel_fg_alpha");
-               HUD_Write("\n");
-
-               HUD_Write_Cvar_q("hud_dock");
-               HUD_Write_Cvar_q("hud_dock_color");
-               HUD_Write_Cvar_q("hud_dock_color_team");
-               HUD_Write_Cvar_q("hud_dock_alpha");
-               HUD_Write("\n");
-
-               HUD_Write_Cvar_q("hud_progressbar_alpha");
-               HUD_Write_Cvar_q("hud_progressbar_strength_color");
-               HUD_Write_Cvar_q("hud_progressbar_shield_color");
-               HUD_Write_Cvar_q("hud_progressbar_health_color");
-               HUD_Write_Cvar_q("hud_progressbar_armor_color");
-               HUD_Write_Cvar_q("hud_progressbar_fuel_color");
-               HUD_Write_Cvar_q("hud_progressbar_nexball_color");
-               HUD_Write("\n");
-
-               HUD_Write_Cvar_q("_hud_panelorder");
-               HUD_Write("\n");
-
-               HUD_Write_Cvar_q("hud_configure_grid");
-               HUD_Write_Cvar_q("hud_configure_grid_xsize");
-               HUD_Write_Cvar_q("hud_configure_grid_ysize");
-               HUD_Write("\n");
-
-               HUD_Write_Cvar_q("scr_centerpos");
-               HUD_Write("\n");
-
-               // common cvars for all panels
-               float i;
-               for (i = 0; i < HUD_PANEL_NUM; ++i)
-               {
-                       HUD_Panel_GetName(i);
-
-                       HUD_Write_PanelCvar_n("");
-                       HUD_Write_PanelCvar_q("_pos");
-                       HUD_Write_PanelCvar_q("_size");
-                       HUD_Write_PanelCvar_q("_bg");
-                       HUD_Write_PanelCvar_q("_bg_color");
-                       HUD_Write_PanelCvar_q("_bg_color_team");
-                       HUD_Write_PanelCvar_q("_bg_alpha");
-                       HUD_Write_PanelCvar_q("_bg_border");
-                       HUD_Write_PanelCvar_q("_bg_padding");
-                       switch(i) {
-                               case HUD_PANEL_WEAPONS:
-                                       HUD_Write_PanelCvar_q("_complainbubble");
-                                       HUD_Write_PanelCvar_q("_complainbubble_padding");
-                                       HUD_Write_PanelCvar_q("_complainbubble_color_outofammo");
-                                       HUD_Write_PanelCvar_q("_complainbubble_color_donthave");
-                                       HUD_Write_PanelCvar_q("_complainbubble_color_unavailable");
-                                       HUD_Write_PanelCvar_q("_ammo_color");
-                                       HUD_Write_PanelCvar_q("_ammo_alpha");
-                                       HUD_Write_PanelCvar_q("_aspect");
-                                       HUD_Write_PanelCvar_q("_timeout");
-                                       HUD_Write_PanelCvar_q("_timeout_effect");
-                                       break;
-                               case HUD_PANEL_AMMO:
-                                       HUD_Write_PanelCvar_q("_onlycurrent");
-                                       HUD_Write_PanelCvar_q("_iconalign");
-                                       HUD_Write_PanelCvar_q("_progressbar");
-                                       HUD_Write_PanelCvar_q("_progressbar_name");
-                                       HUD_Write_PanelCvar_q("_progressbar_xoffset");
-                                       HUD_Write_PanelCvar_q("_text");
-                                       break;
-                               case HUD_PANEL_POWERUPS:
-                                       HUD_Write_PanelCvar_q("_flip");
-                                       HUD_Write_PanelCvar_q("_iconalign");
-                                       HUD_Write_PanelCvar_q("_baralign");
-                                       HUD_Write_PanelCvar_q("_progressbar");
-                                       HUD_Write_PanelCvar_q("_progressbar_strength");
-                                       HUD_Write_PanelCvar_q("_progressbar_shield");
-                                       HUD_Write_PanelCvar_q("_text");
-                                       break;
-                               case HUD_PANEL_HEALTHARMOR:
-                                       HUD_Write_PanelCvar_q("_flip");
-                                       HUD_Write_PanelCvar_q("_iconalign");
-                                       HUD_Write_PanelCvar_q("_baralign");
-                                       HUD_Write_PanelCvar_q("_progressbar");
-                                       HUD_Write_PanelCvar_q("_progressbar_health");
-                                       HUD_Write_PanelCvar_q("_progressbar_armor");
-                                       HUD_Write_PanelCvar_q("_text");
-                                       break;
-                               case HUD_PANEL_NOTIFY:
-                                       HUD_Write_PanelCvar_q("_flip");
-                                       HUD_Write_PanelCvar_q("_fontsize");
-                                       HUD_Write_PanelCvar_q("_print");
-                                       break;
-                               case HUD_PANEL_RADAR:
-                                       HUD_Write_PanelCvar_q("_foreground_alpha");
-                                       break;
-                               case HUD_PANEL_VOTE:
-                                       HUD_Write_PanelCvar_q("_alreadyvoted_alpha");
-                                       break;
-                               case HUD_PANEL_PRESSEDKEYS:
-                                       HUD_Write_PanelCvar_q("_aspect");
-                                       break;
-                               case HUD_PANEL_INFOMESSAGES:
-                                       HUD_Write_PanelCvar_q("_flip");
-                                       break;
-                       }
-                       HUD_Write("\n");
-               }
-               HUD_Write("menu_sync\n"); // force the menu to reread the cvars, so that the dialogs are updated
-
-               print(sprintf(_("^2Successfully exported to %s! (Note: It's saved in data/data/)\n"), filename));
-               fclose(fh);
-       }
-       else
-               print(sprintf(_("^1Couldn't write to %s\n"), filename));
-}
-
-const float hlBorderSize = 4;
-const string hlBorder = "gfx/hud/default/border_highlighted";
-const string hlBorder2 = "gfx/hud/default/border_highlighted2";
-void HUD_Panel_HlBorder(float myBorder, vector color, float alpha)
-{
-       drawfill(panel_pos - '1 1 0' * myBorder, panel_size + '2 2 0' * myBorder, '0 0.5 1', .5 * alpha, DRAWFLAG_NORMAL);
-       drawpic_tiled(panel_pos - '1 1 0' * myBorder, hlBorder, '8 1 0' * hlBorderSize, eX * (panel_size_x + 2 * myBorder) + eY * hlBorderSize, color, alpha, DRAWFLAG_NORMAL);
-       drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * (panel_size_y + 2 * myBorder - hlBorderSize), hlBorder, '8 1 0' * hlBorderSize, eX * (panel_size_x + 2 * myBorder) + eY * hlBorderSize, color, alpha, DRAWFLAG_NORMAL);
-       drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * hlBorderSize, hlBorder2, '1 8 0' * hlBorderSize, eY * (panel_size_y + 2 * myBorder - 2 * hlBorderSize) + eX * hlBorderSize, color, alpha, DRAWFLAG_NORMAL);
-       drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * hlBorderSize + eX * (panel_size_x + 2 * myBorder - hlBorderSize), hlBorder2, '1 8 0' * hlBorderSize, eY * (panel_size_y + 2 * myBorder - 2 * hlBorderSize) + eX * hlBorderSize, color, alpha, DRAWFLAG_NORMAL);
-}
-
 // draw the background/borders
 #define HUD_Panel_DrawBg(alpha)\
 if(panel_bg != "0")\
        draw_BorderPicture(panel_pos - '1 1 0' * panel_bg_border, panel_bg, panel_size + '1 1 0' * 2 * panel_bg_border, panel_bg_color, panel_bg_alpha * alpha, '1 1 0' * (panel_bg_border/BORDER_MULTIPLIER));\
-if(highlightedPanel_prev == active_panel && autocvar__hud_configure)\
+if(highlightedPanel == hud_configure_active_panel && autocvar__hud_configure)\
 {\
        HUD_Panel_HlBorder(panel_bg_border + 1.5 * hlBorderSize, '0 0.5 1', 0.25 * (1 - autocvar__menu_alpha) * alpha);\
 } ENDS_WITH_CURLY_BRACE
 
-void HUD_Panel_DrawProgressBar(vector pos, vector mySize, string pic, float vertical, float barflip, float x, vector color, float alpha, float drawflag)
+//basically the same code of draw_ButtonPicture and draw_VertButtonPicture for the menu
+void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, float vertical, float baralign, vector theColor, float theAlpha, float drawflag)
 {
-       if(!alpha || x == 0)
+       if(!length_ratio || !theAlpha)
+               return;
+       if(length_ratio > 1)
+               length_ratio = 1;
+       if (baralign == 3)
+       {
+               if(length_ratio < -1)
+                       length_ratio = -1;
+       }
+       else if(length_ratio < 0)
                return;
 
-    x = bound(0, x, 1);
-
+       vector square;
+       vector width, height;
        if(vertical) {
                pic = strcat(hud_skin_path, "/", pic, "_vertical");
                if(precache_pic(pic) == "") {
-                       pic = "gfx/hud/default/statusbar_vertical";
-               }
-
-        if(barflip)
-            drawsetcliparea(pos_x, pos_y + mySize_y * (1 - x), mySize_x, mySize_y * x);
-        else
-            drawsetcliparea(pos_x, pos_y, mySize_x, mySize_y * x);
-       } else {
-               pic = strcat(hud_skin_path, "/", pic);
-               if(precache_pic(pic) == "") {
-                       pic = "gfx/hud/default/statusbar";
-               }
-
-        if(barflip)
-            drawsetcliparea(pos_x + mySize_x * (1 - x), pos_y, mySize_x * x, mySize_y);
-        else
-            drawsetcliparea(pos_x, pos_y, mySize_x * x, mySize_y);
-       }
-
-    drawpic(pos, pic, mySize, color, alpha, drawflag);
-    drawresetcliparea();
-}
-
-void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float alpha, float drawflag)
-{
-       if(!alpha)
-               return;
-
-       string pic;
-       pic = strcat(hud_skin_path, "/num_leading");
-       if(precache_pic(pic) == "") {
-               pic = "gfx/hud/default/num_leading";
-       }
-
-       drawsubpic(pos, eX * min(mySize_x * 0.5, mySize_y) + eY * mySize_y, pic, '0 0 0', '0.25 1 0', color, alpha, drawflag);
-       if(mySize_x/mySize_y > 2)
-               drawsubpic(pos + eX * mySize_y, eX * (mySize_x - 2 * mySize_y) + eY * mySize_y, pic, '0.25 0 0', '0.5 1 0', color, alpha, drawflag);
-       drawsubpic(pos + eX * mySize_x - eX * min(mySize_x * 0.5, mySize_y), eX * min(mySize_x * 0.5, mySize_y) + eY * mySize_y, pic, '0.75 0 0', '0.25 1 0', color, alpha, drawflag);
-}
-
-// check if move will result in panel being moved into another panel. If so, return snapped vector, otherwise return the given vector
-vector HUD_Panel_CheckMove(vector myPos, vector mySize)
-{
-       float i;
-
-       vector myTarget;
-       myTarget = myPos;
-
-       vector myCenter;
-       vector targCenter;
-       myCenter = '0 0 0'; // shut up fteqcc, there IS a reference
-       targCenter = '0 0 0'; // shut up fteqcc, there IS a reference
-
-       for (i = 0; i < HUD_PANEL_NUM; ++i) {
-               if(i == highlightedPanel || !panel_enabled)
-                       continue;
-
-               HUD_Panel_UpdatePosSizeForId(i);
-
-               panel_pos -= '1 1 0' * panel_bg_border;
-               panel_size += '2 2 0' * panel_bg_border;
-
-               if(myPos_y + mySize_y < panel_pos_y)
-                       continue;
-               if(myPos_y > panel_pos_y + panel_size_y)
-                       continue;
-
-               if(myPos_x + mySize_x < panel_pos_x)
-                       continue;
-               if(myPos_x > panel_pos_x + panel_size_x)
-                       continue;
-
-               // OK, there IS a collision.
-
-               myCenter_x = myPos_x + 0.5 * mySize_x;
-               myCenter_y = myPos_y + 0.5 * mySize_y;
-
-               targCenter_x = panel_pos_x + 0.5 * panel_size_x;
-               targCenter_y = panel_pos_y + 0.5 * panel_size_y;
-
-               if(myCenter_x < targCenter_x && myCenter_y < targCenter_y) // top left (of the target panel)
-               {
-                       if(myPos_x + mySize_x - panel_pos_x < myPos_y + mySize_y - panel_pos_y) // push it to the side
-                               myTarget_x = panel_pos_x - mySize_x;
-                       else // push it upwards
-                               myTarget_y = panel_pos_y - mySize_y;
-               }
-               else if(myCenter_x > targCenter_x && myCenter_y < targCenter_y) // top right
-               {
-                       if(panel_pos_x + panel_size_x - myPos_x < myPos_y + mySize_y - panel_pos_y) // push it to the side
-                               myTarget_x = panel_pos_x + panel_size_x;
-                       else // push it upwards
-                               myTarget_y = panel_pos_y - mySize_y;
-               }
-               else if(myCenter_x < targCenter_x && myCenter_y > targCenter_y) // bottom left
-               {
-                       if(myPos_x + mySize_x - panel_pos_x < panel_pos_y + panel_size_y - myPos_y) // push it to the side
-                               myTarget_x = panel_pos_x - mySize_x;
-                       else // push it downwards
-                               myTarget_y = panel_pos_y + panel_size_y;
-               }
-               else if(myCenter_x > targCenter_x && myCenter_y > targCenter_y) // bottom right
-               {
-                       if(panel_pos_x + panel_size_x - myPos_x < panel_pos_y + panel_size_y - myPos_y) // push it to the side
-                               myTarget_x = panel_pos_x + panel_size_x;
-                       else // push it downwards
-                               myTarget_y = panel_pos_y + panel_size_y;
-               }
-               //if(cvar("hud_configure_checkcollisions_debug"))
-                       //drawfill(panel_pos, panel_size, '1 1 0', .3, DRAWFLAG_NORMAL);
-       }
-
-       return myTarget;
-}
-
-void HUD_Panel_SetPos(vector pos)
-{
-       HUD_Panel_UpdatePosSizeForId(highlightedPanel);
-       vector mySize;
-       mySize = panel_size;
-
-       //if(cvar("hud_configure_checkcollisions_debug"))
-               //drawfill(pos, mySize, '1 1 1', .2, DRAWFLAG_NORMAL);
-
-       if(autocvar_hud_configure_grid)
-       {
-               pos_x = floor((pos_x/vid_conwidth)/bound(0.005, autocvar_hud_configure_grid_xsize, 0.2) + 0.5) * bound(0.005, autocvar_hud_configure_grid_xsize, 0.2) * vid_conwidth;
-               pos_y = floor((pos_y/vid_conheight)/bound(0.005, autocvar_hud_configure_grid_ysize, 0.2) + 0.5) * bound(0.005, autocvar_hud_configure_grid_ysize, 0.2) * vid_conheight;
-       }
-
-       if(hud_configure_checkcollisions)
-               pos = HUD_Panel_CheckMove(pos, mySize);
-
-       pos_x = bound(0, pos_x, vid_conwidth - mySize_x);
-       pos_y = bound(0, pos_y, vid_conheight - mySize_y);
-
-       string s;
-       s = strcat(ftos(pos_x/vid_conwidth), " ", ftos(pos_y/vid_conheight));
-
-       HUD_Panel_GetName(highlightedPanel);
-       cvar_set(strcat("hud_panel_", panel_name, "_pos"), s);
-}
-
-// check if resize will result in panel being moved into another panel. If so, return snapped vector, otherwise return the given vector
-vector HUD_Panel_CheckResize(vector mySize, vector resizeorigin) {
-       float i;
-
-       vector targEndPos;
-
-       float dist_x, dist_y;
-       float ratio;
-       ratio = mySize_x/mySize_y;
-
-       for (i = 0; i < HUD_PANEL_NUM; ++i) {
-               if(i == highlightedPanel || !panel_enabled)
-                       continue;
-
-               HUD_Panel_UpdatePosSizeForId(i);
-
-               panel_pos -= '1 1 0' * panel_bg_border;
-               panel_size += '2 2 0' * panel_bg_border;
-
-               targEndPos = panel_pos + panel_size;
-
-               // resizeorigin is WITHIN target panel, just abort any collision testing against that particular panel to produce expected behaviour!
-               if(resizeorigin_x > panel_pos_x && resizeorigin_x < targEndPos_x && resizeorigin_y > panel_pos_y && resizeorigin_y < targEndPos_y)
-                       continue;
-
-               if (resizeCorner == 1)
-               {
-                       // check if this panel is on our way
-                       if (resizeorigin_x <= panel_pos_x)
-                               continue;
-                       if (resizeorigin_y <= panel_pos_y)
-                               continue;
-                       if (targEndPos_x <= resizeorigin_x - mySize_x)
-                               continue;
-                       if (targEndPos_y <= resizeorigin_y - mySize_y)
-                               continue;
-
-                       // there is a collision:
-                       // detect which side of the panel we are facing is actually limiting the resizing
-                       // (which side the resize direction finds for first) and reduce the size up to there
-                       //
-                       // dist is the distance between resizeorigin and the "analogous" point of the panel
-                       // in this case resizeorigin (bottom-right point) and the bottom-right point of the panel
-                       dist_x = resizeorigin_x - targEndPos_x;
-                       dist_y = resizeorigin_y - targEndPos_y;
-                       if (dist_y <= 0 || dist_x / dist_y > ratio)
-                               mySize_x = min(mySize_x, dist_x);
-                       else
-                               mySize_y = min(mySize_y, dist_y);
+                       pic = "gfx/hud/default/progressbar_vertical";
                }
-               else if (resizeCorner == 2)
-               {
-                       if (resizeorigin_x >= targEndPos_x)
-                               continue;
-                       if (resizeorigin_y <= panel_pos_y)
-                               continue;
-                       if (panel_pos_x >= resizeorigin_x + mySize_x)
-                               continue;
-                       if (targEndPos_y <= resizeorigin_y - mySize_y)
-                               continue;
 
-                       dist_x = panel_pos_x - resizeorigin_x;
-                       dist_y = resizeorigin_y - targEndPos_y;
-                       if (dist_y <= 0 || dist_x / dist_y > ratio)
-                               mySize_x = min(mySize_x, dist_x);
-                       else
-                               mySize_y = min(mySize_y, dist_y);
-               }
-               else if (resizeCorner == 3)
+        if (baralign == 1) // bottom align
+                       theOrigin_y += (1 - length_ratio) * theSize_y;
+        else if (baralign == 2) // center align
+            theOrigin_y += 0.5 * (1 - length_ratio) * theSize_y;
+        else if (baralign == 3) // center align, positive values down, negative up
                {
-                       if (resizeorigin_x <= panel_pos_x)
-                               continue;
-                       if (resizeorigin_y >= targEndPos_y)
-                               continue;
-                       if (targEndPos_x <= resizeorigin_x - mySize_x)
-                               continue;
-                       if (panel_pos_y >= resizeorigin_y + mySize_y)
-                               continue;
-
-                       dist_x = resizeorigin_x - targEndPos_x;
-                       dist_y = panel_pos_y - resizeorigin_y;
-                       if (dist_y <= 0 || dist_x / dist_y > ratio)
-                               mySize_x = min(mySize_x, dist_x);
+                       theSize_y *= 0.5;
+                       if (length_ratio > 0)
+                               theOrigin_y += theSize_y;
                        else
-                               mySize_y = min(mySize_y, dist_y);
-               }
-               else if (resizeCorner == 4)
-               {
-                       if (resizeorigin_x >= targEndPos_x)
-                               continue;
-                       if (resizeorigin_y >= targEndPos_y)
-                               continue;
-                       if (panel_pos_x >= resizeorigin_x + mySize_x)
-                               continue;
-                       if (panel_pos_y >= resizeorigin_y + mySize_y)
-                               continue;
-
-                       dist_x = panel_pos_x - resizeorigin_x;
-                       dist_y = panel_pos_y - resizeorigin_y;
-                       if (dist_y <= 0 || dist_x / dist_y > ratio)
-                               mySize_x = min(mySize_x, dist_x);
-                       else
-                               mySize_y = min(mySize_y, dist_y);
+                       {
+                               theOrigin_y += (1 + length_ratio) * theSize_y;
+                               length_ratio = -length_ratio;
+                       }
                }
-               //if(cvar("hud_configure_checkcollisions_debug"))
-                       //drawfill(panel_pos, panel_size, '1 1 0', .3, DRAWFLAG_NORMAL);
-       }
-
-       return mySize;
-}
-
-void HUD_Panel_SetPosSize(vector mySize)
-{
-       HUD_Panel_UpdatePosSizeForId(highlightedPanel);
-       vector resizeorigin;
-       resizeorigin = panel_click_resizeorigin;
-       vector myPos;
-
-       // minimum panel size cap
-       mySize_x = max(0.025 * vid_conwidth, mySize_x);
-       mySize_y = max(0.025 * vid_conheight, mySize_y);
-
-       if(highlightedPanel == HUD_PANEL_CHAT) // some panels have their own restrictions, like the chat panel (which actually only moves the engine chat print around). Looks bad if it's too small.
-       {
-               mySize_x = max(17 * autocvar_con_chatsize, mySize_x);
-               mySize_y = max(2 * autocvar_con_chatsize + 2 * panel_bg_padding, mySize_y);
-       }
-
-       // collision testing|
-       // -----------------+
-
-       // we need to know pos at this stage, but it might still change later if we hit a screen edge/other panel (?)
-       if(resizeCorner == 1) {
-               myPos_x = resizeorigin_x - mySize_x;
-               myPos_y = resizeorigin_y - mySize_y;
-       } else if(resizeCorner == 2) {
-               myPos_x = resizeorigin_x;
-               myPos_y = resizeorigin_y - mySize_y;
-       } else if(resizeCorner == 3) {
-               myPos_x = resizeorigin_x - mySize_x;
-               myPos_y = resizeorigin_y;
-       } else { // resizeCorner == 4
-               myPos_x = resizeorigin_x;
-               myPos_y = resizeorigin_y;
-       }
-
-       // left/top screen edges
-       if(myPos_x < 0)
-               mySize_x = mySize_x + myPos_x;
-       if(myPos_y < 0)
-               mySize_y = mySize_y + myPos_y;
-
-       // bottom/right screen edges
-       if(myPos_x + mySize_x > vid_conwidth)
-               mySize_x = vid_conwidth - myPos_x;
-       if(myPos_y + mySize_y > vid_conheight)
-               mySize_y = vid_conheight - myPos_y;
-
-       //if(cvar("hud_configure_checkcollisions_debug"))
-               //drawfill(myPos, mySize, '1 1 1', .2, DRAWFLAG_NORMAL);
-
-       // before checkresize, otherwise panel can be snapped partially inside another panel or panel aspect ratio can be broken
-       if(autocvar_hud_configure_grid)
-       {
-               mySize_x = floor((mySize_x/vid_conwidth)/bound(0.005, autocvar_hud_configure_grid_xsize, 0.2) + 0.5) * bound(0.005, autocvar_hud_configure_grid_xsize, 0.2) * vid_conwidth;
-               mySize_y = floor((mySize_y/vid_conheight)/bound(0.005, autocvar_hud_configure_grid_ysize, 0.2) + 0.5) * bound(0.005, autocvar_hud_configure_grid_ysize, 0.2) * vid_conheight;
-       }
-
-       if(hud_configure_checkcollisions)
-               mySize = HUD_Panel_CheckResize(mySize, resizeorigin);
-
-       // minimum panel size cap, do this once more so we NEVER EVER EVER have a panel smaller than this, JUST IN CASE above code still makes the panel eg negative (impossible to resize back without changing cvars manually then)
-       mySize_x = max(0.025 * vid_conwidth, mySize_x);
-       mySize_y = max(0.025 * vid_conheight, mySize_y);
-
-       // do another pos check, as size might have changed by now
-       if(resizeCorner == 1) {
-               myPos_x = resizeorigin_x - mySize_x;
-               myPos_y = resizeorigin_y - mySize_y;
-       } else if(resizeCorner == 2) {
-               myPos_x = resizeorigin_x;
-               myPos_y = resizeorigin_y - mySize_y;
-       } else if(resizeCorner == 3) {
-               myPos_x = resizeorigin_x - mySize_x;
-               myPos_y = resizeorigin_y;
-       } else { // resizeCorner == 4
-               myPos_x = resizeorigin_x;
-               myPos_y = resizeorigin_y;
-       }
-
-       //if(cvar("hud_configure_checkcollisions_debug"))
-               //drawfill(myPos, mySize, '0 1 0', .3, DRAWFLAG_NORMAL);
-
-       HUD_Panel_GetName(highlightedPanel);
-       string s;
-       s = strcat(ftos(mySize_x/vid_conwidth), " ", ftos(mySize_y/vid_conheight));
-       cvar_set(strcat("hud_panel_", panel_name, "_size"), s);
-
-       s = strcat(ftos(myPos_x/vid_conwidth), " ", ftos(myPos_y/vid_conheight));
-       cvar_set(strcat("hud_panel_", panel_name, "_pos"), s);
-}
+               theSize_y *= length_ratio;
 
-float mouseClicked;
-float prevMouseClicked; // previous state
-float prevMouseClickedTime; // time during previous mouse click, to check for doubleclicks
-vector prevMouseClickedPos; // pos during previous mouse click, to check for doubleclicks
-
-float pressed_key_time;
-void HUD_Panel_Arrow_Action(float nPrimary)
-{
-       if (highlightedPanel_prev == -1 || mouseClicked)
-               return;
-
-       hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && autocvar_hud_configure_checkcollisions);
-
-       float step;
-       if(autocvar_hud_configure_grid)
-       {
-               if (nPrimary == K_UPARROW || nPrimary == K_DOWNARROW)
+               vector bH;
+               width = eX * theSize_x;
+               height = eY * theSize_y;
+               if(theSize_y <= theSize_x * 2)
                {
-                       if (hudShiftState & S_SHIFT)
-                               step = bound(0.005, autocvar_hud_configure_grid_ysize, 0.2) * vid_conheight;
-                       else
-                               step = 2 * bound(0.005, autocvar_hud_configure_grid_ysize, 0.2) * vid_conheight;
+                       // button not high enough
+                       // draw just upper and lower part then
+                       square = eY * theSize_y * 0.5;
+                       bH = eY * (0.25 * theSize_y / (theSize_x * 2));
+                       drawsubpic(theOrigin,          square + width, pic, '0 0 0', eX + bH, theColor, theAlpha, drawflag);
+                       drawsubpic(theOrigin + square, square + width, pic, eY - bH, eX + bH, theColor, theAlpha, drawflag);
                }
                else
                {
-                       if (hudShiftState & S_SHIFT)
-                               step = bound(0.005, autocvar_hud_configure_grid_xsize, 0.2) * vid_conwidth;
-                       else
-                               step = 2 * bound(0.005, autocvar_hud_configure_grid_xsize, 0.2) * vid_conwidth;
-               }
-       }
-       else
-       {
-               if (nPrimary == K_UPARROW || nPrimary == K_DOWNARROW)
-                       step = vid_conheight;
-               else
-                       step = vid_conwidth;
-               if (hudShiftState & S_SHIFT)
-                       step = (step / 256); // more precision
-               else
-                       step = (step / 64) * (1 + 2 * (time - pressed_key_time));
-       }
-
-       highlightedPanel = highlightedPanel_prev;
-
-       HUD_Panel_UpdatePosSizeForId(highlightedPanel);
-
-       vector prev_pos, prev_size;
-       prev_pos = panel_pos;
-       prev_size = panel_size;
-
-       if (hudShiftState & S_ALT) // resize
-       {
-               highlightedAction = 1;
-               if(nPrimary == K_UPARROW)
-                       resizeCorner = 1;
-               else if(nPrimary == K_RIGHTARROW)
-                       resizeCorner = 2;
-               else if(nPrimary == K_LEFTARROW)
-                       resizeCorner = 3;
-               else // if(nPrimary == K_DOWNARROW)
-                       resizeCorner = 4;
-
-               // ctrl+arrow reduces the size, instead of increasing it
-               // Note that ctrl disables collisions check too, but it's fine
-               // since we don't collide with anything reducing the size
-               if (hudShiftState & S_CTRL) {
-                       step = -step;
-                       resizeCorner = 5 - resizeCorner;
-               }
-
-               vector mySize;
-               mySize = panel_size;
-               panel_click_resizeorigin = panel_pos;
-               if(resizeCorner == 1) {
-                       panel_click_resizeorigin += mySize;
-                       mySize_y += step;
-               } else if(resizeCorner == 2) {
-                       panel_click_resizeorigin_y += mySize_y;
-                       mySize_x += step;
-               } else if(resizeCorner == 3) {
-                       panel_click_resizeorigin_x += mySize_x;
-                       mySize_x += step;
-               } else { // resizeCorner == 4
-                       mySize_y += step;
+                       square = eY * theSize_x;
+                       drawsubpic(theOrigin,                   width   +     square, pic, '0 0    0', '1 0.25 0', theColor, theAlpha, drawflag);
+                       drawsubpic(theOrigin +          square, theSize - 2 * square, pic, '0 0.25 0', '1 0.5  0', theColor, theAlpha, drawflag);
+                       drawsubpic(theOrigin + height - square, width   +     square, pic, '0 0.75 0', '1 0.25 0', theColor, theAlpha, drawflag);
                }
-               HUD_Panel_SetPosSize(mySize);
-       }
-       else // move
-       {
-               highlightedAction = 2;
-               vector pos;
-               pos = panel_pos;
-               if(nPrimary == K_UPARROW)
-                       pos_y -= step;
-               else if(nPrimary == K_DOWNARROW)
-                       pos_y += step;
-               else if(nPrimary == K_LEFTARROW)
-                       pos_x -= step;
-               else // if(nPrimary == K_RIGHTARROW)
-                       pos_x += step;
-
-               HUD_Panel_SetPos(pos);
-       }
-
-       HUD_Panel_UpdatePosSizeForId(highlightedPanel);
-
-       if (prev_pos != panel_pos || prev_size != panel_size)
-       {
-               // backup!
-               panel_pos_backup = prev_pos;
-               panel_size_backup = prev_size;
-               highlightedPanel_backup = highlightedPanel;
-       }
-}
-
-float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
-{
-       string s;
-
-       if(!autocvar__hud_configure)
-               return false;
-
-       // allow console bind to work
-       string con_keys;
-       float keys;
-       con_keys = findkeysforcommand("toggleconsole");
-       keys = tokenize(con_keys);
-
-       float hit_con_bind, i;
-       for (i = 0; i < keys; ++i)
-       {
-               if(nPrimary == stof(argv(i)))
-                       hit_con_bind = 1;
-       }
-
-       if(bInputType == 0) {
-               if(nPrimary == K_ALT) hudShiftState |= S_ALT;
-               if(nPrimary == K_CTRL) hudShiftState |= S_CTRL;
-               if(nPrimary == K_SHIFT) hudShiftState |= S_SHIFT;
-       }
-       else if(bInputType == 1) {
-               if(nPrimary == K_ALT) hudShiftState -= (hudShiftState & S_ALT);
-               if(nPrimary == K_CTRL) hudShiftState -= (hudShiftState & S_CTRL);
-               if(nPrimary == K_SHIFT) hudShiftState -= (hudShiftState & S_SHIFT);
-       }
-
-       if(nPrimary == K_MOUSE1)
-       {
-               if(bInputType == 0) { // key pressed
-                       mouseClicked = 1;
-                       return true;
-               }
-               else if(bInputType == 1) {// key released
-                       mouseClicked = 0;
-                       return true;
+       } else {
+               pic = strcat(hud_skin_path, "/", pic);
+               if(precache_pic(pic) == "") {
+                       pic = "gfx/hud/default/progressbar";
                }
-       }
-       else if(nPrimary == K_ESCAPE)
-       {
-               if (bInputType == 1)
-                       return true;
-               menu_enabled = 1;
-               menu_enabled_time = time;
-               localcmd("menu_showhudexit\n");
-       }
-       else if(hudShiftState & S_CTRL)
-       {
-               if (mouseClicked)
-                       return true;
 
-               if(nPrimary == K_SPACE) // enable/disable highlighted panel or dock
+               if (baralign == 1) // right align
+                       theOrigin_x += (1 - length_ratio) * theSize_x;
+        else if (baralign == 2) // center align
+            theOrigin_x += 0.5 * (1 - length_ratio) * theSize_x;
+        else if (baralign == 3) // center align, positive values on the right, negative on the left
                {
-                       if (bInputType == 1)
-                               return true;
-
-                       if (highlightedPanel_prev != -1)
-                               cvar_set(strcat("hud_panel_", panel_name), ftos(!(panel_enabled)));
+                       theSize_x *= 0.5;
+                       if (length_ratio > 0)
+                               theOrigin_x += theSize_x;
                        else
-                               cvar_set(strcat("hud_dock"), (autocvar_hud_dock == "") ? "dock" : "");
-               }
-               if(nPrimary == 'c') // copy highlighted panel size
-               {
-                       if (bInputType == 1)
-                               return true;
-
-                       if (highlightedPanel_prev != -1)
                        {
-                               panel_size_copied = panel_size;
-                               highlightedPanel_copied = highlightedPanel_prev;
+                               theOrigin_x += (1 + length_ratio) * theSize_x;
+                               length_ratio = -length_ratio;
                        }
                }
-               else if(nPrimary == 'v') // past copied size on the highlighted panel
-               {
-                       if (bInputType == 1)
-                               return true;
-
-                       if (highlightedPanel_copied == -1 || highlightedPanel_prev == -1)
-                               return true;
-
-                       HUD_Panel_UpdatePosSizeForId(highlightedPanel_prev);
-
-                       // reduce size if it'd go beyond screen boundaries
-                       vector tmp_size = panel_size_copied;
-                       if (panel_pos_x + panel_size_copied_x > vid_conwidth)
-                               tmp_size_x = vid_conwidth - panel_pos_x;
-                       if (panel_pos_y + panel_size_copied_y > vid_conheight)
-                               tmp_size_y = vid_conheight - panel_pos_y;
+               theSize_x *= length_ratio;
 
-                       if (panel_size == tmp_size)
-                               return true;
-
-                       // backup first!
-                       panel_pos_backup = panel_pos;
-                       panel_size_backup = panel_size;
-                       highlightedPanel_backup = highlightedPanel_prev;
-
-                       s = strcat(ftos(tmp_size_x/vid_conwidth), " ", ftos(tmp_size_y/vid_conheight));
-                       cvar_set(strcat("hud_panel_", panel_name, "_size"), s);
-               }
-               else if(nPrimary == 'z') // undo last action
-               {
-                       if (bInputType == 1)
-                               return true;
-                       //restore previous values
-                       if (highlightedPanel_backup != -1)
-                       {
-                               HUD_Panel_GetName(highlightedPanel_backup);
-                               s = strcat(ftos(panel_pos_backup_x/vid_conwidth), " ", ftos(panel_pos_backup_y/vid_conheight));
-                               cvar_set(strcat("hud_panel_", panel_name, "_pos"), s);
-                               s = strcat(ftos(panel_size_backup_x/vid_conwidth), " ", ftos(panel_size_backup_y/vid_conheight));
-                               cvar_set(strcat("hud_panel_", panel_name, "_size"), s);
-                               highlightedPanel_backup = -1;
-                       }
-               }
-       }
-       else if(nPrimary == K_UPARROW || nPrimary == K_DOWNARROW || nPrimary == K_LEFTARROW || nPrimary == K_RIGHTARROW)
-       {
-               if (bInputType == 1)
+               vector bW;
+               width = eX * theSize_x;
+               height = eY * theSize_y;
+               if(theSize_x <= theSize_y * 2)
                {
-                       pressed_key_time = 0;
-                       return true;
-               }
-               else if (pressed_key_time == 0)
-                       pressed_key_time = time;
-
-               HUD_Panel_Arrow_Action(nPrimary); //move or resize panel
-       }
-       else if(hit_con_bind)
-               return false;
-
-       return true; // Suppress ALL other input
-}
-
-float HUD_Panel_HighlightCheck()
-{
-       float i, j, border;
-       vector panelPos;
-       vector panelSize;
-
-       while(j <= HUD_PANEL_NUM)
-       {
-               i = panel_order[j];
-               j += 1;
-
-               HUD_Panel_UpdatePosSizeForId(i);
-
-               panelPos = panel_pos;
-               panelSize = panel_size;
-               border = max(8, panel_bg_border); // FORCED border so a small border size doesn't mean you can't resize
-
-               // move
-               if(mousepos_x >= panelPos_x && mousepos_y >= panelPos_y && mousepos_x <= panelPos_x + panelSize_x && mousepos_y <= panelPos_y + panelSize_y)
-               {
-                       return 1;
-               }
-               // resize from topleft border
-               else if(mousepos_x >= panelPos_x - border && mousepos_y >= panelPos_y - border && mousepos_x <= panelPos_x + 0.5 * panelSize_x && mousepos_y <= panelPos_y + 0.5 * panelSize_y)
-               {
-                       return 2;
-               }
-               // resize from topright border
-               else if(mousepos_x >= panelPos_x + 0.5 * panelSize_x && mousepos_y >= panelPos_y - border && mousepos_x <= panelPos_x + panelSize_x + border && mousepos_y <= panelPos_y + 0.5 * panelSize_y)
-               {
-                       return 3;
-               }
-               // resize from bottomleft border
-               else if(mousepos_x >= panelPos_x - border && mousepos_y >= panelPos_y + 0.5 * panelSize_y && mousepos_x <= panelPos_x + 0.5 * panelSize_x && mousepos_y <= panelPos_y + panelSize_y + border)
-               {
-                       return 3;
-               }
-               // resize from bottomright border
-               else if(mousepos_x >= panelPos_x + 0.5 * panelSize_x && mousepos_y >= panelPos_y + 0.5 * panelSize_y && mousepos_x <= panelPos_x + panelSize_x + border && mousepos_y <= panelPos_y + panelSize_y + border)
-               {
-                       return 2;
-               }
-       }
-       return 0;
-}
-
-// move a panel to the beginning of the panel order array (which means it gets drawn last, on top of everything else)
-void HUD_Panel_FirstInDrawQ(float id)
-{
-       float i;
-       var float place = -1;
-       // find out where in the array our current id is, save into place
-       for(i = 0; i < HUD_PANEL_NUM; ++i)
-       {
-               if(panel_order[i] == id)
-               {
-                       place = i;
-                       break;
-               }
-       }
-       // place last if we didn't find a place for it yet (probably new panel, or screwed up cvar)
-       if(place == -1)
-               place = HUD_PANEL_NUM - 1;
-
-       // move all ids up by one step in the array until "place"
-       for(i = place; i > 0; --i)
-       {
-               panel_order[i] = panel_order[i-1];
-       }
-       // now save the new top id
-       panel_order[0] = id;
-       
-       // let's save them into the cvar by some strcat trickery
-       string s;
-       for(i = 0; i < HUD_PANEL_NUM; ++i)
-       {
-               s = strcat(s, ftos(panel_order[i]), " ");
-       }
-       cvar_set("_hud_panelorder", s);
-       if(hud_panelorder_prev)
-               strunzone(hud_panelorder_prev);
-       hud_panelorder_prev = strzone(autocvar__hud_panelorder); // prevent HUD_Main from doing useless update, we already updated here
-}
-
-void HUD_Panel_Highlight()
-{
-       float i, j, border;
-       vector panelPos;
-       vector panelSize;
-
-       while(j <= HUD_PANEL_NUM)
-       {
-               i = panel_order[j];
-               j += 1;
-
-               HUD_Panel_UpdatePosSizeForId(i);
-
-               panelPos = panel_pos;
-               panelSize = panel_size;
-               border = max(8, panel_bg_border); // FORCED border so a small border size doesn't mean you can't resize
-
-               // move
-               if(mousepos_x >= panelPos_x && mousepos_y >= panelPos_y && mousepos_x <= panelPos_x + panelSize_x && mousepos_y <= panelPos_y + panelSize_y)
-               {
-                       highlightedPanel = i;
-                       HUD_Panel_FirstInDrawQ(i);
-                       highlightedAction = 1;
-                       panel_click_distance = mousepos - panelPos;
-                       return;
-               }
-               // resize from topleft border
-               else if(mousepos_x >= panelPos_x - border && mousepos_y >= panelPos_y - border && mousepos_x <= panelPos_x + 0.5 * panelSize_x && mousepos_y <= panelPos_y + 0.5 * panelSize_y)
-               {
-                       highlightedPanel = i;
-                       HUD_Panel_FirstInDrawQ(i);
-                       highlightedAction = 2;
-                       resizeCorner = 1;
-                       panel_click_distance = mousepos - panelPos;
-                       panel_click_resizeorigin = panelPos + panelSize;
-                       return;
-               }
-               // resize from topright border
-               else if(mousepos_x >= panelPos_x + 0.5 * panelSize_x && mousepos_y >= panelPos_y - border && mousepos_x <= panelPos_x + panelSize_x + border && mousepos_y <= panelPos_y + 0.5 * panelSize_y)
-               {
-                       highlightedPanel = i;
-                       HUD_Panel_FirstInDrawQ(i);
-                       highlightedAction = 2;
-                       resizeCorner = 2;
-                       panel_click_distance_x = panelSize_x - mousepos_x + panelPos_x;
-                       panel_click_distance_y = mousepos_y - panelPos_y;
-                       panel_click_resizeorigin = panelPos + eY * panelSize_y;
-                       return;
-               }
-               // resize from bottomleft border
-               else if(mousepos_x >= panelPos_x - border && mousepos_y >= panelPos_y + 0.5 * panelSize_y && mousepos_x <= panelPos_x + 0.5 * panelSize_x && mousepos_y <= panelPos_y + panelSize_y + border)
-               {
-                       highlightedPanel = i;
-                       HUD_Panel_FirstInDrawQ(i);
-                       highlightedAction = 2;
-                       resizeCorner = 3;
-                       panel_click_distance_x = mousepos_x - panelPos_x;
-                       panel_click_distance_y = panelSize_y - mousepos_y + panelPos_y;
-                       panel_click_resizeorigin = panelPos + eX * panelSize_x;
-                       return;
-               }
-               // resize from bottomright border
-               else if(mousepos_x >= panelPos_x + 0.5 * panelSize_x && mousepos_y >= panelPos_y + 0.5 * panelSize_y && mousepos_x <= panelPos_x + panelSize_x + border && mousepos_y <= panelPos_y + panelSize_y + border)
-               {
-                       highlightedPanel = i;
-                       HUD_Panel_FirstInDrawQ(i);
-                       highlightedAction = 2;
-                       resizeCorner = 4;
-                       panel_click_distance = panelSize - mousepos + panelPos;
-                       panel_click_resizeorigin = panelPos;
-                       return;
+                       // button not wide enough
+                       // draw just left and right part then
+                       square = eX * theSize_x * 0.5;
+                       bW = eX * (0.25 * theSize_x / (theSize_y * 2));
+                       drawsubpic(theOrigin,          square + height, pic, '0 0 0', eY + bW, theColor, theAlpha, drawflag);
+                       drawsubpic(theOrigin + square, square + height, pic, eX - bW, eY + bW, theColor, theAlpha, drawflag);
                }
                else
                {
-                       highlightedPanel_prev = -1;
+                       square = eX * theSize_y;
+                       drawsubpic(theOrigin,                  height  +     square, pic, '0    0 0', '0.25 1 0', theColor, theAlpha, drawflag);
+                       drawsubpic(theOrigin +         square, theSize - 2 * square, pic, '0.25 0 0', '0.5  1 0', theColor, theAlpha, drawflag);
+                       drawsubpic(theOrigin + width - square, height  +     square, pic, '0.75 0 0', '0.25 1 0', theColor, theAlpha, drawflag);
                }
        }
 }
 
-float highlightcheck;
-vector prev_pos, prev_size;
-void HUD_Panel_Mouse()
+void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float alpha, float drawflag)
 {
-       // TODO: needs better check... is there any float that contains the current state of the menu? _menu_alpha isn't apparently updated the frame the menu gets enabled
-       if (autocvar__menu_alpha == 0 && time - menu_enabled_time > 0.5)
-               menu_enabled = 0;
-
-       /*
-       print("menu_enabled: ", ftos(menu_enabled), "\n");
-       print("Highlighted: ", ftos(highlightedPanel), "\n");
-       print("Menu alpha: ", ftos(autocvar__menu_alpha), "\n");
-       */
-
-       // instantly hide the editor cursor if we open the HUDExit dialog
-       // as hud_fade_alpha doesn't decrease to 0 in this case
-       // TODO: find a way to fade the cursor out even in this case
-       if(menu_enabled == 1 || (menu_enabled == 2 && !hud_fade_alpha))
+       if(!alpha)
                return;
 
-       if(mouseClicked == 0 && menu_enabled != 2 && highlightedPanel >= 0) { // don't reset these variables in menu_enabled mode 2!
-               highlightedPanel = -1;
-               highlightedAction = 0;
-       }
-       if(highlightedPanel != -1)
-               highlightedPanel_prev = highlightedPanel;
-
-       mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
-
-       mousepos_x = bound(0, mousepos_x, vid_conwidth);
-       mousepos_y = bound(0, mousepos_y, vid_conheight);
-
-       if(mouseClicked)
-       {
-               if(prevMouseClicked == 0)
-               {
-                       HUD_Panel_Highlight(); // sets highlightedPanel, highlightedAction, panel_click_distance, panel_click_resizeorigin
-                                                                       // and calls HUD_Panel_UpdatePosSizeForId() for the highlighted panel
-                       prev_pos = panel_pos;
-                       prev_size = panel_size;
-               }
-               else
-                       HUD_Panel_UpdatePosSizeForId(highlightedPanel);
-
-               if (prev_pos != panel_pos || prev_size != panel_size)
-               {
-                       hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && autocvar_hud_configure_checkcollisions);
-                       // backup!
-                       panel_pos_backup = prev_pos;
-                       panel_size_backup = prev_size;
-                       highlightedPanel_backup = highlightedPanel;
-               }
-               else
-                       // in case the clicked panel is inside another panel and we aren't
-                       // moving it, avoid the immediate "fix" of its position/size
-                       // (often unwanted and hateful) by disabling collisions check
-                       hud_configure_checkcollisions = false;
-
-               if(highlightedAction == 1)
-                       HUD_Panel_SetPos(mousepos - panel_click_distance);
-               else if(highlightedAction == 2)
-               {
-                       vector mySize;
-                       if(resizeCorner == 1) {
-                               mySize_x = panel_click_resizeorigin_x - (mousepos_x - panel_click_distance_x);
-                               mySize_y = panel_click_resizeorigin_y - (mousepos_y - panel_click_distance_y);
-                       } else if(resizeCorner == 2) {
-                               mySize_x = mousepos_x + panel_click_distance_x - panel_click_resizeorigin_x;
-                               mySize_y = panel_click_distance_y + panel_click_resizeorigin_y - mousepos_y;
-                       } else if(resizeCorner == 3) {
-                               mySize_x = panel_click_resizeorigin_x + panel_click_distance_x - mousepos_x;
-                               mySize_y = mousepos_y + panel_click_distance_y - panel_click_resizeorigin_y;
-                       } else { // resizeCorner == 4
-                               mySize_x = mousepos_x - (panel_click_resizeorigin_x - panel_click_distance_x);
-                               mySize_y = mousepos_y - (panel_click_resizeorigin_y - panel_click_distance_y);
-                       }
-                       HUD_Panel_SetPosSize(mySize);
-               }
-
-               // doubleclick check
-               if(time - prevMouseClickedTime < 0.4 && prevMouseClicked == 0 && prevMouseClickedPos == mousepos && highlightedPanel >= 0)
-               {
-                       mouseClicked = 0; // to prevent spam, I guess.
-                       menu_enabled = 2;
-                       menu_enabled_time = time;
-                       HUD_Panel_GetName(highlightedPanel);
-                       localcmd("menu_showhudoptions ", panel_name, "\n");
-                       return;
-               }
-               if(prevMouseClicked == 0)
-               {
-                       prevMouseClickedTime = time;
-                       prevMouseClickedPos = mousepos;
-               }
-       }
-       else
-       {
-               highlightcheck = HUD_Panel_HighlightCheck();
+       string pic;
+       pic = strcat(hud_skin_path, "/num_leading");
+       if(precache_pic(pic) == "") {
+               pic = "gfx/hud/default/num_leading";
        }
-       // draw cursor after performing move/resize to have the panel pos/size updated before highlightcheck
-       vector cursorsize;
-       cursorsize = '32 32 0';
 
-       if(highlightcheck == 0)
-               drawpic(mousepos, strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
-       else if(highlightcheck == 1)
-               drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_move.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
-       else if(highlightcheck == 2)
-               drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_resize.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
-       else
-               drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_resize2.tga"), '32 32 0', '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
-
-       prevMouseClicked = mouseClicked;
+       drawsubpic(pos, eX * min(mySize_x * 0.5, mySize_y) + eY * mySize_y, pic, '0 0 0', '0.25 1 0', color, alpha, drawflag);
+       if(mySize_x/mySize_y > 2)
+               drawsubpic(pos + eX * mySize_y, eX * (mySize_x - 2 * mySize_y) + eY * mySize_y, pic, '0.25 0 0', '0.5 1 0', color, alpha, drawflag);
+       drawsubpic(pos + eX * mySize_x - eX * min(mySize_x * 0.5, mySize_y), eX * min(mySize_x * 0.5, mySize_y) + eY * mySize_y, pic, '0.75 0 0', '0.25 1 0', color, alpha, drawflag);
 }
 
 // Weapon icons (#0)
 //
-float weaponspace[10];
-#define HUD_Weapons_Clear()\
-       float idx;\
-       for(idx = 0; idx < 10; ++idx)\
-               weaponspace[idx] = 0
-
 entity weaponorder[WEP_MAXCOUNT];
 void weaponorder_swap(float i, float j, entity pass)
 {
@@ -1532,8 +615,13 @@ void HUD_Weapons(void)
        float f, screen_ar;
        float center_x, center_y;
 
-       if(!autocvar_hud_panel_weapons && !autocvar__hud_configure)
-               return;
+       if(!autocvar__hud_configure)
+       {
+               if(!autocvar_hud_panel_weapons) return;
+               if(spectatee_status == -1) return;
+       }
+       else
+               hud_configure_active_panel = HUD_PANEL_WEAPONS;
 
        float timeout = autocvar_hud_panel_weapons_timeout;
        float timeout_effect_length, timein_effect_length;
@@ -1554,18 +642,17 @@ void HUD_Weapons(void)
                return;
        }
 
-       active_panel = HUD_PANEL_WEAPONS;
        HUD_Panel_UpdateCvars(weapons);
 
        if (timeout && time >= weapontime + timeout && !autocvar__hud_configure)
        {
                f = (time - (weapontime + timeout)) / timeout_effect_length;
-               if (autocvar_hud_panel_weapons_timeout_effect)
+               if (autocvar_hud_panel_weapons_timeout_effect == 1 || autocvar_hud_panel_weapons_timeout_effect == 3)
                {
                        panel_bg_alpha *= (1 - f);
                        panel_fg_alpha *= (1 - f);
                }
-               if (autocvar_hud_panel_weapons_timeout_effect == 1)
+               if (autocvar_hud_panel_weapons_timeout_effect == 2 || autocvar_hud_panel_weapons_timeout_effect == 3)
                {
                        f *= f; // for a cooler movement
                        center_x = panel_pos_x + panel_size_x/2;
@@ -1591,12 +678,12 @@ void HUD_Weapons(void)
        else if (timeout && time < weaponprevtime + timein_effect_length && !autocvar__hud_configure)
        {
                f = (time - weaponprevtime) / timein_effect_length;
-               if (autocvar_hud_panel_weapons_timeout_effect)
+               if (autocvar_hud_panel_weapons_timeout_effect == 1 || autocvar_hud_panel_weapons_timeout_effect == 3)
                {
                        panel_bg_alpha *= (f);
                        panel_fg_alpha *= (f);
                }
-               if (autocvar_hud_panel_weapons_timeout_effect == 1)
+               if (autocvar_hud_panel_weapons_timeout_effect == 2 || autocvar_hud_panel_weapons_timeout_effect == 3)
                {
                        f *= f; // for a cooler movement
                        f = 1 - f;
@@ -1621,13 +708,6 @@ void HUD_Weapons(void)
        }
 
        float i, weapid, wpnalpha, weapon_cnt;
-       weapon_cnt = 0;
-       for(i = WEP_FIRST; i <= WEP_LAST; ++i)
-       {
-               self = get_weaponinfo(i);
-               if(self.impulse >= 0)
-                       ++weapon_cnt;
-       }
 
        // TODO make this configurable
        if(weaponorder_bypriority != autocvar_cl_weaponpriority || !weaponorder[0])
@@ -1651,6 +731,8 @@ void HUD_Weapons(void)
                                ++weapon_cnt;
                        }
                }
+               for(i = weapon_cnt; i < WEP_MAXCOUNT; ++i)
+                       weaponorder[i] = NULL;
                heapsort(weapon_cnt, weaponorder_swap, weaponorder_cmp, world);
 
                weaponorder_cmp_str = string_null;
@@ -1671,8 +753,6 @@ void HUD_Weapons(void)
        else
                wpnalpha = panel_fg_alpha;
 
-       HUD_Weapons_Clear();
-
        float rows, columns;
        float aspect = autocvar_hud_panel_weapons_aspect;
        rows = panel_size_y/panel_size_x;
@@ -1691,19 +771,12 @@ void HUD_Weapons(void)
        vector wpnpos;
        vector wpnsize;
        
-       float fullammo_shells, fullammo_nails, fullammo_rockets, fullammo_cells, fullammo_fuel;
        vector ammo_color;
        float ammo_alpha;
        wpnsize = eX * panel_size_x*(1/columns) + eY * panel_size_y*(1/rows);
        float barsize_x, barsize_y, baroffset_x, baroffset_y;
-       float show_ammo = autocvar_hud_panel_weapons_ammo;
-       if (show_ammo)
-       {
-               fullammo_shells = autocvar_hud_panel_weapons_ammo_full_shells;
-               fullammo_nails = autocvar_hud_panel_weapons_ammo_full_nails;
-               fullammo_rockets = autocvar_hud_panel_weapons_ammo_full_rockets;
-               fullammo_cells = autocvar_hud_panel_weapons_ammo_full_cells;
-               fullammo_fuel = autocvar_hud_panel_weapons_ammo_full_fuel;
+       if (autocvar_hud_panel_weapons_ammo)
+       {
                ammo_color = stov(autocvar_hud_panel_weapons_ammo_color);
                ammo_alpha = panel_fg_alpha * autocvar_hud_panel_weapons_ammo_alpha;
 
@@ -1733,13 +806,14 @@ void HUD_Weapons(void)
        }
 
        float weapons_st = getstati(STAT_WEAPONS);
-       float label = autocvar_hud_panel_weapons_label;
 
-       for(i = 0; i < weapon_cnt; ++i)
+       for(i = 0; i <= WEP_LAST-WEP_FIRST; ++i)
        {
+               self = weaponorder[i];
+               if (!self || self.impulse < 0)
+                       continue;
                wpnpos = panel_pos + eX * column * wpnsize_x + eY * row * wpnsize_y;
 
-               self = weaponorder[i];
                weapid = self.impulse;
 
                // draw background behind currently selected weapon
@@ -1769,17 +843,17 @@ void HUD_Weapons(void)
                }
 
                // draw the weapon icon
-               if((weapid >= 0) && (weapons_st & self.weapons))
+               if(weapons_st & self.weapons)
                {
                        drawpic_aspect_skin(wpnpos, strcat("weapon", self.netname), wpnsize, '1 1 1', wpnalpha, DRAWFLAG_NORMAL);
 
-                       if(label == 1) // weapon number
+                       if(autocvar_hud_panel_weapons_label == 1) // weapon number
                                drawstring(wpnpos, ftos(weapid), '1 1 0' * 0.5 * wpnsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                       else if(label == 2) // bind
+                       else if(autocvar_hud_panel_weapons_label == 2) // bind
                                drawstring(wpnpos, getcommandkey(ftos(weapid), strcat("impulse ", ftos(weapid))), '1 1 0' * 0.5 * wpnsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 
                        // draw ammo status bar
-                       if(show_ammo && self.weapon != WEP_TUBA && self.weapon != WEP_LASER && self.weapon != WEP_PORTO)
+                       if(autocvar_hud_panel_weapons_ammo && self.weapon != WEP_TUBA && self.weapon != WEP_LASER && self.weapon != WEP_PORTO)
                        {
                                a = 0;
                                type = GetAmmoTypeForWep(self.weapon);
@@ -1789,11 +863,11 @@ void HUD_Weapons(void)
                                if(a > 0)
                                {
                                        switch(type) {
-                                               case 0: fullammo = fullammo_shells; break;
-                                               case 1: fullammo = fullammo_nails; break;
-                                               case 2: fullammo = fullammo_rockets; break;
-                                               case 3: fullammo = fullammo_cells; break;
-                                               case 4: fullammo = fullammo_fuel; break;
+                                               case 0: fullammo = autocvar_hud_panel_weapons_ammo_full_shells; break;
+                                               case 1: fullammo = autocvar_hud_panel_weapons_ammo_full_nails; break;
+                                               case 2: fullammo = autocvar_hud_panel_weapons_ammo_full_rockets; break;
+                                               case 3: fullammo = autocvar_hud_panel_weapons_ammo_full_cells; break;
+                                               case 4: fullammo = autocvar_hud_panel_weapons_ammo_full_fuel; break;
                                                default: fullammo = 60;
                                        }
 
@@ -1895,7 +969,7 @@ void DrawAmmoItem(vector myPos, vector mySize, float itemcode, float currently_s
        if(autocvar__hud_configure)
        {
                currently_selected = (itemcode == 2); //rockets always selected
-               a = 100;
+               a = 31 + mod(itemcode*93, 128);
        }
        else
                a = getstati(GetAmmoStat(itemcode)); // how much ammo do we have of type itemcode?
@@ -1928,7 +1002,7 @@ void DrawAmmoItem(vector myPos, vector mySize, float itemcode, float currently_s
                drawpic_aspect_skin(myPos, "ammo_current_bg", mySize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 
     if(a > 0 && autocvar_hud_panel_ammo_progressbar)
-        HUD_Panel_DrawProgressBar(myPos + eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, mySize - eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, autocvar_hud_panel_ammo_progressbar_name, 0, 0, min(1, a/autocvar_hud_panel_ammo_maxammo), color, autocvar_hud_progressbar_alpha * panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+        HUD_Panel_DrawProgressBar(myPos + eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, mySize - eX * autocvar_hud_panel_ammo_progressbar_xoffset * mySize_x, autocvar_hud_panel_ammo_progressbar_name, a/autocvar_hud_panel_ammo_maxammo, 0, 0, color, autocvar_hud_progressbar_alpha * panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
 
     if(autocvar_hud_panel_ammo_text)
     {
@@ -1945,10 +1019,14 @@ void DrawAmmoItem(vector myPos, vector mySize, float itemcode, float currently_s
 
 void HUD_Ammo(void)
 {
-       if(!autocvar_hud_panel_ammo && !autocvar__hud_configure)
-               return;
+       if(!autocvar__hud_configure)
+       {
+               if(!autocvar_hud_panel_ammo) return;
+               if(spectatee_status == -1) return;
+       }
+       else
+               hud_configure_active_panel = HUD_PANEL_AMMO;
 
-       active_panel = HUD_PANEL_AMMO;
        HUD_Panel_UpdateCvars(ammo);
        vector pos, mySize;
        pos = panel_pos;
@@ -2024,12 +1102,53 @@ void HUD_Ammo(void)
                        column = column + 1;
                }
        }
-}
+}
+
+void DrawNumIcon(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float alpha)
+{
+       vector newPos, newSize;
+       vector picpos, numpos;
+
+       if (vertical)
+       {
+               if(mySize_y/mySize_x > 2)
+               {
+                       newSize_y = 2 * mySize_x;
+                       newSize_x = mySize_x;
+
+                       newPos_y = myPos_y + (mySize_y - newSize_y) / 2;
+                       newPos_x = myPos_x;
+               }
+               else
+               {
+                       newSize_x = 1/2 * mySize_y;
+                       newSize_y = mySize_y;
+
+                       newPos_x = myPos_x + (mySize_x - newSize_x) / 2;
+                       newPos_y = myPos_y;
+               }
+
+               if(icon_right_align)
+               {
+                       numpos = newPos;
+                       picpos = newPos + eY * newSize_x;
+               }
+               else
+               {
+                       picpos = newPos;
+                       numpos = newPos + eY * newSize_x;
+               }
+
+               newSize_y /= 2;
+               drawpic_aspect_skin(picpos, icon, newSize, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+               // make number smaller than icon, it looks better
+               // reduce only y to draw numbers with different number of digits with the same y size
+               numpos_y += newSize_y * ((1 - 0.7) / 2);
+               newSize_y *= 0.7;
+               drawstring_aspect(numpos, ftos(x), newSize, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+               return;
+       }
 
-void DrawNumIcon(float iconalign, vector myPos, vector mySize, float x, string icon, float left, vector color, float alpha)
-{
-       vector newPos;
-       float newSize_x, newSize_y;
        if(mySize_x/mySize_y > 3)
        {
                newSize_x = 3 * mySize_y;
@@ -2047,79 +1166,57 @@ void DrawNumIcon(float iconalign, vector myPos, vector mySize, float x, string i
                newPos_x = myPos_x;
        }
 
-       vector picpos, numpos;
-       if(left)
+       if(icon_right_align) // right align
        {
-               if(iconalign == 1 || iconalign == 3) // right align
-               {
-                       numpos = newPos;
-                       picpos = newPos + eX * 2 * newSize_y;
-               }
-               else // left align
-               {
-                       numpos = newPos + eX * newSize_y;
-                       picpos = newPos;
-               }
+               numpos = newPos;
+               picpos = newPos + eX * 2 * newSize_y;
        }
-       else
+       else // left align
        {
-               if(iconalign == 0 || iconalign == 3) // left align
-               {
-                       numpos = newPos + eX * newSize_y;
-                       picpos = newPos;
-               } 
-               else // right align
-               {
-                       numpos = newPos;
-                       picpos = newPos + eX * 2 * newSize_y;
-               }
+               numpos = newPos + eX * newSize_y;
+               picpos = newPos;
        }
 
-       drawstring_aspect(numpos, ftos(x), eX * (2/3) * newSize_x + eY * newSize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
+       drawstring_aspect(numpos, ftos(x), '2 1 0' * newSize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
        drawpic_aspect_skin(picpos, icon, '1 1 0' * newSize_y, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
 }
 
-void DrawNumIcon_expanding(float iconalign, vector myPos, vector mySize, float x, string icon, float left, vector color, float fadelerp)
+void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float fadelerp)
 {
        float sz;
        sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
 
-       DrawNumIcon(iconalign, myPos + expandingbox_resize_centered_box_offset(sz, mySize, 1), mySize * sz, x, icon, left, color, (1 - fadelerp));
+       DrawNumIcon(myPos + expandingbox_resize_centered_box_offset(sz, mySize, 1), mySize * sz, x, icon, vertical, icon_right_align, color, (1 - fadelerp));
 }
 
 // Powerups (#2)
 //
-void HUD_Powerups(void) {
-       if(!autocvar_hud_panel_powerups && !autocvar__hud_configure)
-               return;
-
+void HUD_Powerups(void)
+{
+       float strength_time, shield_time;
        if(!autocvar__hud_configure)
        {
-               if not(getstati(STAT_ITEMS) & (IT_STRENGTH | IT_INVINCIBLE))
-                       return;
+               if(!autocvar_hud_panel_powerups) return;
+               if(spectatee_status == -1) return;
+               if not(getstati(STAT_ITEMS) & (IT_STRENGTH | IT_INVINCIBLE)) return;
+               if (getstati(STAT_HEALTH) <= 0) return;
 
-               if (getstati(STAT_HEALTH) <= 0)
-                       return;
+               strength_time = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 99);
+               shield_time = bound(0, getstatf(STAT_INVINCIBLE_FINISHED) - time, 99);
+       }
+       else
+       {
+               hud_configure_active_panel = HUD_PANEL_POWERUPS;
+
+               strength_time = 15;
+               shield_time = 27;
        }
 
-       active_panel = HUD_PANEL_POWERUPS;
        HUD_Panel_UpdateCvars(powerups);
        vector pos, mySize;
        pos = panel_pos;
        mySize = panel_size;
 
-       float strength_time, shield_time;
-       if(autocvar__hud_configure)
-       {
-               strength_time = 15;
-               shield_time = 27;
-       }
-       else
-       {
-               strength_time = bound(0, getstatf(STAT_STRENGTH_FINISHED) - time, 99);
-               shield_time = bound(0, getstatf(STAT_INVINCIBLE_FINISHED) - time, 99);
-       }
-
        HUD_Panel_DrawBg(bound(0, max(strength_time, shield_time), 1));
        if(panel_bg_padding)
        {
@@ -2127,218 +1224,147 @@ void HUD_Powerups(void) {
                mySize -= '2 2 0' * panel_bg_padding;
        }
 
-       vector barpos, barsize;
-       vector picpos;
-       vector numpos;
-
-       string leftname, rightname;
-    string leftprogressname, rightprogressname;
-       float leftcnt, rightcnt;
-       float leftexact, rightexact;
-       float flip = autocvar_hud_panel_powerups_flip;
-       if (flip) {
-               leftname = "strength";
-        leftprogressname = autocvar_hud_panel_powerups_progressbar_strength;
-               leftcnt = ceil(strength_time);
-               leftexact = strength_time;
-
-               rightname = "shield";
-        rightprogressname = autocvar_hud_panel_powerups_progressbar_shield;
-               rightcnt = ceil(shield_time);
-               rightexact = shield_time;
-       } else {
-               leftname = "shield";
-        leftprogressname = autocvar_hud_panel_powerups_progressbar_shield;
-               leftcnt = ceil(shield_time);
-               leftexact = shield_time;
+       float panel_ar = mySize_x/mySize_y;
+       float is_vertical = (panel_ar < 1);
+       vector shield_offset, strength_offset;
+       if (panel_ar >= 4 || (panel_ar >= 1/4 && panel_ar < 1))
+       {
+               mySize_x *= 0.5;
+               if (autocvar_hud_panel_powerups_flip)
+                       shield_offset_x = mySize_x;
+               else
+                       strength_offset_x = mySize_x;
+       }
+       else
+       {
+               mySize_y *= 0.5;
+               if (autocvar_hud_panel_powerups_flip)
+                       shield_offset_y = mySize_y;
+               else
+                       strength_offset_y = mySize_y;
+       }
 
-               rightname = "strength";
-        rightprogressname = autocvar_hud_panel_powerups_progressbar_strength;
-               rightcnt = ceil(strength_time);
-               rightexact = strength_time;
+       float shield_baralign, strength_baralign;
+       float shield_iconalign, strength_iconalign;
+       if (autocvar_hud_panel_powerups_flip)
+       {
+               strength_baralign = (autocvar_hud_panel_powerups_baralign == 2 || autocvar_hud_panel_powerups_baralign == 1);
+               shield_baralign = (autocvar_hud_panel_powerups_baralign == 3 || autocvar_hud_panel_powerups_baralign == 1);
+               strength_iconalign = (autocvar_hud_panel_powerups_iconalign == 2 || autocvar_hud_panel_powerups_iconalign == 1);
+               shield_iconalign = (autocvar_hud_panel_powerups_iconalign == 3 || autocvar_hud_panel_powerups_iconalign == 1);
+       }
+       else
+       {
+               shield_baralign = (autocvar_hud_panel_powerups_baralign == 2 || autocvar_hud_panel_powerups_baralign == 1);
+               strength_baralign = (autocvar_hud_panel_powerups_baralign == 3 || autocvar_hud_panel_powerups_baralign == 1);
+               shield_iconalign = (autocvar_hud_panel_powerups_iconalign == 2 || autocvar_hud_panel_powerups_iconalign == 1);
+               strength_iconalign = (autocvar_hud_panel_powerups_iconalign == 3 || autocvar_hud_panel_powerups_iconalign == 1);
        }
 
-       float baralign = autocvar_hud_panel_powerups_baralign;
-    float barflip;
-       float iconalign = autocvar_hud_panel_powerups_iconalign;
-       float progressbar = autocvar_hud_panel_powerups_progressbar;
-       if (mySize_x/mySize_y > 4)
+       if(shield_time)
        {
-        barsize = eX * 0.5 * mySize_x + eY * mySize_y;
-               if(leftcnt)
+               const float maxshield = 30;
+               float shield = ceil(shield_time);
+               if(autocvar_hud_panel_powerups_progressbar)
                {
-                       if(baralign == 1 || baralign == 3) { // right align
-                barpos = pos + eX * 0.5 * mySize_x;
-                barflip = 1;
-                       } else { // left align
-                barpos = pos;
-                barflip = 0;
-                       }
-
-                       if(progressbar)
-                       {
-                               HUD_Panel_GetProgressBarColorForString(leftname);
-                               HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
-                       }
-            if(autocvar_hud_panel_powerups_text)
-            {
-                if(leftcnt > 1)
-                    DrawNumIcon(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, '1 1 1', 1);
-                if(leftcnt <= 5)
-                    DrawNumIcon_expanding(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
-            }
+                       HUD_Panel_GetProgressBarColor(shield);
+                       HUD_Panel_DrawProgressBar(pos + shield_offset, mySize, autocvar_hud_panel_powerups_progressbar_shield, shield/maxshield, is_vertical, shield_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                }
-
-               if(rightcnt)
+               if(autocvar_hud_panel_powerups_text)
                {
-                       if(baralign == 0 || baralign == 3) { // left align
-                barpos = pos;
-                barflip = 0;
-                       } else { // right align
-                barpos = pos + eX * 0.5 * mySize_x;
-                barflip = 1;
-                       }
-
-                       if(progressbar)
-                       {
-                               HUD_Panel_GetProgressBarColorForString(rightname);
-                               HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
-                       }
-            if(autocvar_hud_panel_powerups_text)
-            {
-                if(rightcnt > 1)
-                    DrawNumIcon(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, '1 1 1', 1);
-                if(rightcnt <= 5)
-                    DrawNumIcon_expanding(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
-            }
+                       if(shield > 1)
+                               DrawNumIcon(pos + shield_offset, mySize, shield, "shield", is_vertical, shield_iconalign, '1 1 1', 1);
+                       if(shield <= 5)
+                               DrawNumIcon_expanding(pos + shield_offset, mySize, shield, "shield", is_vertical, shield_iconalign, '1 1 1', bound(0, (shield - shield_time) / 0.5, 1));
                }
        }
-       else if (mySize_x/mySize_y > 1.5)
+
+       if(strength_time)
        {
-        barsize = eX * mySize_x + eY * 0.5 * mySize_y;
-               if(leftcnt)
+               const float maxstrength = 30;
+               float strength = ceil(strength_time);
+               if(autocvar_hud_panel_powerups_progressbar)
                {
-            barpos = pos;
-                       if(baralign == 1 || baralign == 3) { // right/down align
-                barflip = 1;
-                       } else { // left/up align
-                barflip = 0;
-                       }
-
-                       if(progressbar)
-                       {
-                               HUD_Panel_GetProgressBarColorForString(leftname);
-                               HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
-                       }
-            if(autocvar_hud_panel_powerups_text)
-            {
-                if(leftcnt > 1)
-                    DrawNumIcon(iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, '1 1 1', 1);
-                if(leftcnt <= 5)
-                    DrawNumIcon_expanding(iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, '1 1 1', bound(0, (leftcnt - leftexact) / 0.5, 1));
-            }
+                       HUD_Panel_GetProgressBarColor(strength);
+                       HUD_Panel_DrawProgressBar(pos + strength_offset, mySize, autocvar_hud_panel_powerups_progressbar_strength, strength/maxstrength, is_vertical, strength_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                }
-
-               if(rightcnt)
+               if(autocvar_hud_panel_powerups_text)
                {
-            barpos = pos + eY * 0.5 * mySize_y;
-                       if(baralign == 0 || baralign == 3) { // left align
-                barflip = 0;
-                       } else { // right align
-                barflip = 1;
-                       }
-
-                       if(progressbar)
-                       {
-                               HUD_Panel_GetProgressBarColorForString(rightname);
-                               HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
-                       }
-            if(autocvar_hud_panel_powerups_text)
-            {
-                if(rightcnt > 1)
-                    DrawNumIcon(iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, '1 1 1', 1);
-                if(rightcnt <= 5)
-                    DrawNumIcon_expanding(iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, '1 1 1', bound(0, (rightcnt - rightexact) / 0.5, 1));
-            }
+                       if(strength > 1)
+                               DrawNumIcon(pos + strength_offset, mySize, strength, "strength", is_vertical, strength_iconalign, '1 1 1', 1);
+                       if(strength <= 5)
+                               DrawNumIcon_expanding(pos + strength_offset, mySize, strength, "strength", is_vertical, strength_iconalign, '1 1 1', bound(0, (strength - strength_time) / 0.5, 1));
                }
        }
-       else
-       {
-        barsize = eX * 0.5 * mySize_x + eY * mySize_y;
-               if(leftcnt)
-               {
-            barpos = pos;
-                       if(baralign == 1 || baralign == 3) { // down align
-                barflip = 1;
-                       } else { // up align
-                barflip = 0;
-                       }
+}
 
-                       if(iconalign == 1 || iconalign == 3) { // down align
-                               picpos = pos + eX * 0.05 * mySize_x + eY * (mySize_y - 0.65 * mySize_x);
-                               numpos = pos + eY * mySize_y - eY * 0.25 * mySize_x;
-                       } else { // up align
-                               picpos = pos + eX * 0.05 * mySize_x;
-                               numpos = pos + eY * 0.4 * mySize_x;
-                       }
+// Health/armor (#3)
+//
 
-                       if(progressbar)
-                       {
-                               HUD_Panel_GetProgressBarColorForString(leftname);
-                               HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 1, barflip, min(1, leftcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
-                       }
-            if(autocvar_hud_panel_powerups_text)
-            {
-                if(leftcnt <= 5)
-                    drawpic_aspect_skin_expanding(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, bound(0, (leftcnt - leftexact) / 0.5, 1));
-                if(leftcnt > 1)
-                    drawpic_aspect_skin(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                drawstring_aspect(numpos, ftos(leftcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-            }
-               }
+// prev_* vars contain the health/armor at the previous FRAME
+// set to -1 when player is dead or was not playing
+float prev_health, prev_armor;
+float health_damagetime, armor_damagetime;
+float health_beforedamage, armor_beforedamage;
+// old_p_* vars keep track of previous values when smoothing value changes of the progressbar
+float old_p_health, old_p_armor;
+float old_p_healthtime, old_p_armortime;
+// prev_p_* vars contain the health/armor progressbar value at the previous FRAME
+// set to -1 to forcedly stop effects when we switch spectated player (e.g. from playerX: 70h to playerY: 50h)
+float prev_p_health, prev_p_armor;
+
+void HUD_HealthArmor(void)
+{
+       float armor, health, fuel;
+       if(!autocvar__hud_configure)
+       {
+               if(!autocvar_hud_panel_healtharmor) return;
+               if(spectatee_status == -1) return;
 
-               if(rightcnt)
+               health = getstati(STAT_HEALTH);
+               if(health <= 0)
                {
-            barpos = pos + eX * 0.5 * mySize_x;
-                       if(baralign == 0 || baralign == 3) { // down align
-                barflip = 1;
-                       } else { // up align
-                barflip = 0;
-                       }
+                       prev_health = -1;
+                       return;
+               }
+               armor = getstati(STAT_ARMOR);
 
-                       if(iconalign == 0 || iconalign == 3) { // up align
-                               picpos = pos + eX * 0.05 * mySize_x + eX * 0.5 * mySize_x;
-                               numpos = pos + eY * 0.4 * mySize_x + eX * 0.5 * mySize_x;
-                       } else { // down align
-                               picpos = pos + eX * 0.05 * mySize_x + eY * (mySize_y - 0.65 * mySize_x) + eX * 0.5 * mySize_x;
-                               numpos = pos + eY * mySize_y - eY * 0.25 * mySize_x + eX * 0.5 * mySize_x;
-                       }
+               // code to check for spectatee_status changes is in Ent_ClientData()
+               // prev_p_health and prev_health can be set to -1 there
 
-                       if(progressbar)
-                       {
-                               HUD_Panel_GetProgressBarColorForString(rightname);
-                               HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 1, barflip, min(1, rightcnt/30), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * bound(0, max(strength_time, shield_time), 1), DRAWFLAG_NORMAL);
-                       }
-            if(autocvar_hud_panel_powerups_text)
-            {
-                if(rightcnt <= 5)
-                    drawpic_aspect_skin_expanding(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL, bound(0, (rightcnt - rightexact) / 0.5, 1));
-                if(rightcnt > 1)
-                    drawpic_aspect_skin(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                drawstring_aspect(numpos, ftos(rightcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-            }
+               if (prev_p_health == -1)
+               {
+                       // no effect
+                       health_beforedamage = 0;
+                       armor_beforedamage = 0;
+                       health_damagetime = 0;
+                       armor_damagetime = 0;
+                       prev_health = health;
+                       prev_armor = armor;
+                       old_p_health = health;
+                       old_p_armor = armor;
+                       prev_p_health = health;
+                       prev_p_armor = armor;
+               }
+               else if (prev_health == -1)
+               {
+                       //start the load effect
+                       health_damagetime = 0;
+                       armor_damagetime = 0;
+                       prev_health = 0;
+                       prev_armor = 0;
                }
+               fuel = getstati(STAT_FUEL);
        }
-}
+       else
+       {
+               hud_configure_active_panel = HUD_PANEL_HEALTHARMOR;
 
-// Health/armor (#3)
-//
-void HUD_HealthArmor(void)
-{
-       if(!autocvar_hud_panel_healtharmor && !autocvar__hud_configure)
-               return;
+               health = 150;
+               armor = 75;
+               fuel = 20;
+       }
 
-       active_panel = HUD_PANEL_HEALTHARMOR;
        HUD_Panel_UpdateCvars(healtharmor);
        vector pos, mySize;
        pos = panel_pos;
@@ -2351,28 +1377,8 @@ void HUD_HealthArmor(void)
                mySize -= '2 2 0' * panel_bg_padding;
        }
 
-       float armor, health, fuel;
-       armor = getstati(STAT_ARMOR);
-       health = getstati(STAT_HEALTH);
-       fuel = getstati(STAT_FUEL);
-
-       if(autocvar__hud_configure)
-       {
-               armor = 75;
-               health = 150;
-               fuel = 20;
-       }
-
-       if(health <= 0)
-               return;
-
-       vector barpos, barsize;
-       vector picpos;
-       vector numpos;
-
        float baralign = autocvar_hud_panel_healtharmor_baralign;
        float iconalign = autocvar_hud_panel_healtharmor_iconalign;
-       float progressbar = autocvar_hud_panel_healtharmor_progressbar;
 
     float maxhealth = autocvar_hud_panel_healtharmor_maxhealth;
     float maxarmor = autocvar_hud_panel_healtharmor_maxarmor;
@@ -2385,18 +1391,14 @@ void HUD_HealthArmor(void)
                x = floor(v_x + 1);
 
         float maxtotal = maxhealth + maxarmor;
-
-        barpos = pos;
-        barsize = mySize;
-
                string biggercount;
                if(v_z) // NOT fully armored
                {
                        biggercount = "health";
-                       if(progressbar)
+                       if(autocvar_hud_panel_healtharmor_progressbar)
                        {
                                HUD_Panel_GetProgressBarColor(health);
-                               HUD_Panel_DrawProgressBar(barpos, barsize, autocvar_hud_panel_healtharmor_progressbar_health, 0, mod(baralign, 2), x/maxtotal, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               HUD_Panel_DrawProgressBar(pos, mySize, autocvar_hud_panel_healtharmor_progressbar_health, x/maxtotal, 0, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                        }
                        if(armor)
             if(autocvar_hud_panel_healtharmor_text)
@@ -2405,231 +1407,180 @@ void HUD_HealthArmor(void)
                else
                {
                        biggercount = "armor";
-                       if(progressbar)
+                       if(autocvar_hud_panel_healtharmor_progressbar)
                        {
                                HUD_Panel_GetProgressBarColor(armor);
-                               HUD_Panel_DrawProgressBar(barpos, barsize, autocvar_hud_panel_healtharmor_progressbar_armor, 0, mod(baralign, 2), x/maxtotal, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               HUD_Panel_DrawProgressBar(pos, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, x/maxtotal, 0, (baralign == 1 || baralign == 2), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                        }
                        if(health)
             if(autocvar_hud_panel_healtharmor_text)
                                drawpic_aspect_skin(pos + eX * mySize_x - eX * 0.5 * mySize_y, "health", '0.5 0.5 0' * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                }
         if(autocvar_hud_panel_healtharmor_text)
-            DrawNumIcon(iconalign, pos, mySize, x, biggercount, 1, HUD_Get_Num_Color(x, maxtotal), 1);
+                       DrawNumIcon(pos, mySize, x, biggercount, 0, iconalign, HUD_Get_Num_Color(x, maxtotal), 1);
 
-               // fuel
                if(fuel)
                {
-            barpos = pos;
-            barsize = eX * mySize_x + eY * 0.2 * mySize_y;
                        HUD_Panel_GetProgressBarColor(fuel);
-            HUD_Panel_DrawProgressBar(barpos, barsize, "progressbar", 0, mod(baralign, 2), min(1, fuel/100), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
+                       HUD_Panel_DrawProgressBar(pos, eX * mySize_x + eY * 0.2 * mySize_y, "progressbar", fuel/100, 0, (baralign == 1 || baralign == 3), progressbar_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
                }
        }
        else
        {
-               string leftname, rightname;
-        string leftprogressname, rightprogressname;
-               float leftcnt, rightcnt;
-               float leftmax, rightmax;
-               float leftactive, rightactive;
-               float leftalpha, rightalpha;
-               float flip = autocvar_hud_panel_healtharmor_flip;
-        float barflip;
-               if (flip) { // old style layout with armor left/top of health
-                       leftname = "armor";
-            leftprogressname = autocvar_hud_panel_healtharmor_progressbar_armor;
-                       leftcnt = armor;
-                       if(leftcnt)
-                               leftactive = 1;
-                       leftalpha = min((armor+10)/55, 1);
-            leftmax = maxarmor;
-
-                       rightname = "health";
-            rightprogressname = autocvar_hud_panel_healtharmor_progressbar_health;
-                       rightcnt = health;
-                       rightactive = 1;
-                       rightalpha = 1;
-            rightmax = maxhealth;
-               } else {
-                       leftname = "health";
-            leftprogressname = autocvar_hud_panel_healtharmor_progressbar_health;
-                       leftcnt = health;
-                       leftactive = 1;
-                       leftalpha = 1;
-            leftmax = maxhealth;
-
-                       rightname = "armor";
-            rightprogressname = autocvar_hud_panel_healtharmor_progressbar_armor;
-                       rightcnt = armor;
-                       if(rightcnt)
-                               rightactive = 1;
-                       rightalpha = min((armor+10)/55, 1);
-            rightmax = maxarmor;
-               }
-
-               if (mySize_x/mySize_y > 4)
+               float panel_ar = mySize_x/mySize_y;
+               float is_vertical = (panel_ar < 1);
+               vector health_offset, armor_offset;
+               if (panel_ar >= 4 || (panel_ar >= 1/4 && panel_ar < 1))
                {
-            barsize = eX * 0.5 * mySize_x + eY * mySize_y;
-                       if(leftactive)
-                       {
-                barpos = pos;
-                               if(baralign == 1 || baralign == 3) { // right align
-                    barflip = 1;
-                               } else { // left align
-                    barflip = 0;
-                               }
-
-                               if(progressbar)
-                               {
-                                       HUD_Panel_GetProgressBarColorForString(leftname);
-                    HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/leftmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                               }
-                if(autocvar_hud_panel_healtharmor_text)
-                    DrawNumIcon(iconalign, pos, eX * 0.5 * mySize_x + eY * mySize_y, leftcnt, leftname, 1, HUD_Get_Num_Color(leftcnt, leftmax), 1);
-                       }
-
-                       if(rightactive)
-                       {
-                barpos = pos + eX * 0.5 * mySize_x;
-                               if(baralign == 0 || baralign == 3) { // left align
-                    barflip = 0;
-                               } else { // right align
-                    barflip = 1;
-                               }
-
-                               if(progressbar)
-                               {
-                                       HUD_Panel_GetProgressBarColorForString(rightname);
-                    HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/rightmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                               }
-                if(autocvar_hud_panel_healtharmor_text)
-                    DrawNumIcon(iconalign, pos + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * mySize_y, rightcnt, rightname, 0, HUD_Get_Num_Color(rightcnt, rightmax), 1);
-                       }
-
-                       if(fuel)
-                       {
-                barpos = pos;
-                barsize = eX * mySize_x + eY * 0.2 * mySize_y;
-                HUD_Panel_GetProgressBarColor(fuel);
-                HUD_Panel_DrawProgressBar(barpos, barsize, "progressbar", 0, mod(baralign, 2), min(1, fuel/100), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
-                       }
+                       mySize_x *= 0.5;
+                       if (autocvar_hud_panel_healtharmor_flip)
+                               health_offset_x = mySize_x;
+                       else
+                               armor_offset_x = mySize_x;
                }
-               else if (mySize_x/mySize_y > 1.5)
+               else
                {
-            barsize = eX * mySize_x + eY * 0.5 * mySize_y;
-                       if(leftactive)
-                       {
-                barpos = pos;
-                               if(baralign == 1 || baralign == 3) { // right align
-                    barflip = 1;
-                               } else { // left align
-                    barflip = 0;
-                               }
-
-                               if(progressbar)
-                               {
-                                       HUD_Panel_GetProgressBarColorForString(leftname);
-                    HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 0, barflip, min(1, leftcnt/leftmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                               }
-                if(autocvar_hud_panel_healtharmor_text)
-                    DrawNumIcon(iconalign, pos, eX * mySize_x + eY * 0.5 * mySize_y, leftcnt, leftname, 1, HUD_Get_Num_Color(leftcnt, leftmax), 1);
-                       }
-
-                       if(rightactive)
-                       {
-                barpos = pos + eY * 0.5 * mySize_y;
-                               if(baralign == 0 || baralign == 3) { // left align
-                    barflip = 0;
-                               } else { // right align
-                    barflip = 1;
-                               }
-
-                               if(progressbar)
-                               {
-                                       HUD_Panel_GetProgressBarColorForString(rightname);
-                    HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 0, barflip, min(1, rightcnt/rightmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                               }
-                if(autocvar_hud_panel_healtharmor_text)
-                    DrawNumIcon(iconalign, pos + eY * 0.5 * mySize_y, eX * mySize_x + eY * 0.5 * mySize_y, rightcnt, rightname, 0, HUD_Get_Num_Color(rightcnt, rightmax), 1);
-                       }
+                       mySize_y *= 0.5;
+                       if (autocvar_hud_panel_healtharmor_flip)
+                               health_offset_y = mySize_y;
+                       else
+                               armor_offset_y = mySize_y;
+               }
 
-                       if(fuel)
-                       {
-                barpos = pos;
-                barsize = eX * mySize_x + eY * 0.2 * mySize_y;
-                HUD_Panel_GetProgressBarColor(fuel);
-                HUD_Panel_DrawProgressBar(barpos, barsize, "progressbar", 0, mod(baralign, 2), min(1, fuel/100), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
-                       }
+               float health_baralign, armor_baralign, fuel_baralign;
+               float health_iconalign, armor_iconalign;
+               if (autocvar_hud_panel_healtharmor_flip)
+               {
+                       armor_baralign = (autocvar_hud_panel_healtharmor_baralign == 2 || autocvar_hud_panel_healtharmor_baralign == 1);
+                       health_baralign = (autocvar_hud_panel_healtharmor_baralign == 3 || autocvar_hud_panel_healtharmor_baralign == 1);
+                       fuel_baralign = health_baralign;
+                       armor_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 2 || autocvar_hud_panel_healtharmor_iconalign == 1);
+                       health_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 3 || autocvar_hud_panel_healtharmor_iconalign == 1);
                }
                else
                {
-            barsize = eX * 0.5 * mySize_x + eY * mySize_y;
-                       if(leftactive)
-                       {
-                barpos = pos;
-                               if(baralign == 1 || baralign == 3) { // right align
-                    barflip = 1;
-                               } else { // left align
-                    barflip = 0;
-                               }
-
-                               if(iconalign == 1 || iconalign == 3) { // down align
-                                       picpos = pos + eX * 0.05 * mySize_x + eY * (mySize_y - 0.65 * mySize_x);
-                                       numpos = pos + eY * mySize_y - eY * 0.25 * mySize_x;
-                               } else { // up align
-                                       picpos = pos + eX * 0.05 * mySize_x;
-                                       numpos = pos + eY * 0.4 * mySize_x;
-                               }
+                       health_baralign = (autocvar_hud_panel_healtharmor_baralign == 2 || autocvar_hud_panel_healtharmor_baralign == 1);
+                       armor_baralign = (autocvar_hud_panel_healtharmor_baralign == 3 || autocvar_hud_panel_healtharmor_baralign == 1);
+                       fuel_baralign = armor_baralign;
+                       health_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 2 || autocvar_hud_panel_healtharmor_iconalign == 1);
+                       armor_iconalign = (autocvar_hud_panel_healtharmor_iconalign == 3 || autocvar_hud_panel_healtharmor_iconalign == 1);
+               }
 
-                               if(progressbar)
+               //if(health)
+               {
+                       if(autocvar_hud_panel_healtharmor_progressbar)
+                       {
+                               HUD_Panel_GetProgressBarColor(health);
+                               float p_health, pain_health_alpha;
+                               p_health = health;
+                               pain_health_alpha = 1;
+                               if (autocvar_hud_panel_healtharmor_progressbar_gfx)
                                {
-                                       HUD_Panel_GetProgressBarColorForString(leftname);
-                    HUD_Panel_DrawProgressBar(barpos, barsize, leftprogressname, 1, barflip, min(1, leftcnt/leftmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       if (autocvar_hud_panel_healtharmor_progressbar_gfx_smooth > 0)
+                                       {
+                                               if (fabs(prev_health - health) >= autocvar_hud_panel_healtharmor_progressbar_gfx_smooth)
+                                               {
+                                                       if (time - old_p_healthtime < 1)
+                                                               old_p_health = prev_p_health;
+                                                       else
+                                                               old_p_health = prev_health;
+                                                       old_p_healthtime = time;
+                                               }
+                                               if (time - old_p_healthtime < 1)
+                                               {
+                                                       p_health += (old_p_health - health) * (1 - (time - old_p_healthtime));
+                                                       prev_p_health = p_health;
+                                               }
+                                       }
+                                       if (autocvar_hud_panel_healtharmor_progressbar_gfx_damage > 0)
+                                       {
+                                               if (prev_health - health >= autocvar_hud_panel_healtharmor_progressbar_gfx_damage)
+                                               {
+                                                       if (time - health_damagetime >= 1)
+                                                               health_beforedamage = prev_health;
+                                                       health_damagetime = time;
+                                               }
+                                               if (time - health_damagetime < 1)
+                                               {
+                                                       float health_damagealpha = 1 - (time - health_damagetime)*(time - health_damagetime);
+                                                       HUD_Panel_DrawProgressBar(pos + health_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_health, health_beforedamage/maxhealth, is_vertical, health_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * health_damagealpha, DRAWFLAG_NORMAL);
+                                               }
+                                       }
+                                       prev_health = health;
+
+                                       if (health <= autocvar_hud_panel_healtharmor_progressbar_gfx_lowhealth)
+                                       {
+                                               float BLINK_FACTOR = 0.15;
+                                               float BLINK_BASE = 0.85;
+                                               float BLINK_FREQ = 9; 
+                                               pain_health_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
+                                       }
                                }
-                if(autocvar_hud_panel_healtharmor_text)
-                {
-                    drawpic_aspect_skin(picpos, leftname, '0.4 0.4 0' * mySize_x, '1 1 1', leftalpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                    drawstring_aspect(numpos, ftos(leftcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, HUD_Get_Num_Color(leftcnt, leftmax), panel_fg_alpha, DRAWFLAG_NORMAL);
-                }
+                               HUD_Panel_DrawProgressBar(pos + health_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_health, p_health/maxhealth, is_vertical, health_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * pain_health_alpha, DRAWFLAG_NORMAL);
                        }
+                       if(autocvar_hud_panel_healtharmor_text)
+                               DrawNumIcon(pos + health_offset, mySize, health, "health", is_vertical, health_iconalign, HUD_Get_Num_Color(health, maxhealth), 1);
+               }
 
-                       if(rightactive)
+               if(armor)
+               {
+                       if(autocvar_hud_panel_healtharmor_progressbar)
                        {
-                barpos = pos + eX * 0.5 * mySize_x;
-                               if(baralign == 0 || baralign == 3) { // left align
-                    barflip = 0;
-                               } else { // right align
-                    barflip = 1;
-                               }
-
-                               if(iconalign == 0 || iconalign == 3) { // up align
-                                       picpos = pos + eX * 0.05 * mySize_x + eX * 0.5 * mySize_x;
-                                       numpos = pos + eY * 0.4 * mySize_x + eX * 0.5 * mySize_x;
-                               } else { // down align
-                                       picpos = pos + eX * 0.05 * mySize_x + eY * (mySize_y - 0.65 * mySize_x) + eX * 0.5 * mySize_x;
-                                       numpos = pos + eY * mySize_y - eY * 0.25 * mySize_x + eX * 0.5 * mySize_x;
-                               }
-
-                               if(progressbar)
+                               HUD_Panel_GetProgressBarColor(armor);
+                               float p_armor;
+                               p_armor = armor;
+                               if (autocvar_hud_panel_healtharmor_progressbar_gfx)
                                {
-                                       HUD_Panel_GetProgressBarColorForString(rightname);
-                    HUD_Panel_DrawProgressBar(barpos, barsize, rightprogressname, 1, barflip, min(1, rightcnt/rightmax), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                                       if (autocvar_hud_panel_healtharmor_progressbar_gfx_smooth > 0)
+                                       {
+                                               if (fabs(prev_armor - armor) >= autocvar_hud_panel_healtharmor_progressbar_gfx_smooth)
+                                               {
+                                                       if (time - old_p_armortime < 1)
+                                                               old_p_armor = prev_p_armor;
+                                                       else
+                                                               old_p_armor = prev_armor;
+                                                       old_p_armortime = time;
+                                               }
+                                               if (time - old_p_armortime < 1)
+                                               {
+                                                       p_armor += (old_p_armor - armor) * (1 - (time - old_p_armortime));
+                                                       prev_p_armor = p_armor;
+                                               }
+                                       }
+                                       if (autocvar_hud_panel_healtharmor_progressbar_gfx_damage > 0)
+                                       {
+                                               if (prev_armor - armor >= autocvar_hud_panel_healtharmor_progressbar_gfx_damage)
+                                               {
+                                                       if (time - armor_damagetime >= 1)
+                                                               armor_beforedamage = prev_armor;
+                                                       armor_damagetime = time;
+                                               }
+                                               if (time - armor_damagetime < 1)
+                                               {
+                                                       float armor_damagealpha = 1 - (time - armor_damagetime)*(time - armor_damagetime);
+                                                       HUD_Panel_DrawProgressBar(pos + armor_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, armor_beforedamage/maxarmor, is_vertical, armor_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * armor_damagealpha, DRAWFLAG_NORMAL);
+                                               }
+                                       }
+                                       prev_armor = armor;
                                }
-                if(autocvar_hud_panel_healtharmor_text)
-                {
-                    drawpic_aspect_skin(picpos, rightname, '0.4 0.4 0' * mySize_x, '1 1 1', rightalpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-                    drawstring_aspect(numpos, ftos(rightcnt), eX * 0.5 * mySize_x + eY * 0.25 * mySize_x, HUD_Get_Num_Color(rightcnt, rightmax), panel_fg_alpha, DRAWFLAG_NORMAL);
-                }
+                               HUD_Panel_DrawProgressBar(pos + armor_offset, mySize, autocvar_hud_panel_healtharmor_progressbar_armor, p_armor/maxarmor, is_vertical, armor_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                        }
+                       if(autocvar_hud_panel_healtharmor_text)
+                               DrawNumIcon(pos + armor_offset, mySize, armor, "armor", is_vertical, armor_iconalign, HUD_Get_Num_Color(armor, maxarmor), 1);
+               }
 
-                       if(fuel)
-                       {
-                barpos = pos;
-                barsize = eX * 0.05 * mySize_x + eY * mySize_y;
-                HUD_Panel_GetProgressBarColor(fuel);
-                HUD_Panel_DrawProgressBar(barpos, barsize, "progressbar", 1, mod(baralign, 2), min(1, fuel/100), progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
-                       }
+               if(fuel)
+               {
+                       if (is_vertical)
+                               mySize_x *= 0.2 / 2; //if vertical always halve x to not cover too much numbers with 3 digits
+                       else
+                               mySize_y *= 0.2;
+                       if (panel_ar >= 4)
+                               mySize_x *= 2; //restore full panel size
+                       else if (panel_ar < 1/4)
+                               mySize_y *= 2; //restore full panel size
+                       HUD_Panel_GetProgressBarColor(fuel);
+                       HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", fuel/100, is_vertical, fuel_baralign, progressbar_color, panel_fg_alpha * 0.8, DRAWFLAG_NORMAL);
                }
        }
 }
@@ -3132,10 +2083,13 @@ void HUD_Centerprint(string s1, string s2, float type, float msg)
 
 void HUD_Notify (void)
 {
-       if(!autocvar_hud_panel_notify && !autocvar__hud_configure)
-               return;
+       if(!autocvar__hud_configure)
+       {
+               if(!autocvar_hud_panel_notify) return;
+       }
+       else
+               hud_configure_active_panel = HUD_PANEL_NOTIFY;
 
-       active_panel = HUD_PANEL_NOTIFY;
        HUD_Panel_UpdateCvars(notify);
        vector pos, mySize;
        pos = panel_pos;
@@ -3442,10 +2396,13 @@ string seconds_tostring(float sec)
 
 void HUD_Timer(void)
 {
-       if(!autocvar_hud_panel_timer && !autocvar__hud_configure)
-               return;
+       if(!autocvar__hud_configure)
+       {
+               if(!autocvar_hud_panel_timer) return;
+       }
+       else
+               hud_configure_active_panel = HUD_PANEL_TIMER;
 
-       active_panel = HUD_PANEL_TIMER;
        HUD_Panel_UpdateCvars(timer);
        vector pos, mySize;
        pos = panel_pos;
@@ -3495,10 +2452,14 @@ void HUD_Timer(void)
 //
 void HUD_Radar(void)
 {
-       if ((autocvar_hud_panel_radar == 0 || (autocvar_hud_panel_radar != 2 && !teamplay)) && !autocvar__hud_configure)
-               return;
+       if (!autocvar__hud_configure)
+       {
+               if (autocvar_hud_panel_radar == 0) return;
+               if (autocvar_hud_panel_radar != 2 && !teamplay) return;
+       }
+       else
+               hud_configure_active_panel = HUD_PANEL_RADAR;
 
-       active_panel = HUD_PANEL_RADAR;
        HUD_Panel_UpdateCvars(radar);
        vector pos, mySize;
        pos = panel_pos;
@@ -3511,8 +2472,7 @@ void HUD_Radar(void)
                mySize -= '2 2 0' * panel_bg_padding;
        }
 
-       local float color1, color2; // color already declared as a global in hud.qc
-       local vector rgb;
+       local float color2;
        local entity tm;
        float scale2d, normalsize, bigsize;
        float f;
@@ -3592,9 +2552,6 @@ void HUD_Radar(void)
                  f * mi_center
                + (1 - f) * view_origin);
 
-       color1 = GetPlayerColor(player_localentnum-1);
-       rgb = GetTeamRGB(color1);
-
        drawsetcliparea(
                pos_x,
                pos_y,
@@ -3602,31 +2559,156 @@ void HUD_Radar(void)
                mySize_y
        );
 
-       draw_teamradar_background(hud_panel_radar_foreground_alpha);
+       draw_teamradar_background(hud_panel_radar_foreground_alpha);
+
+       for(tm = world; (tm = find(tm, classname, "radarlink")); )
+               draw_teamradar_link(tm.origin, tm.velocity, tm.team);
+       for(tm = world; (tm = findflags(tm, teamradar_icon, 0xFFFFFF)); )
+               draw_teamradar_icon(tm.origin, tm.teamradar_icon, tm, tm.teamradar_color, panel_fg_alpha);
+       for(tm = world; (tm = find(tm, classname, "entcs_receiver")); )
+       {
+               color2 = GetPlayerColor(tm.sv_entnum);
+               //if(color == COLOR_SPECTATOR || color == color2)
+                       draw_teamradar_player(tm.origin, tm.angles, GetTeamRGB(color2));
+       }
+       draw_teamradar_player(view_origin, view_angles, '1 1 1');
+
+       drawresetcliparea();
+};
+
+// Score (#7)
+//
+void HUD_UpdatePlayerTeams();
+void HUD_Score_Rankings(vector pos, vector mySize, entity me, float team_count)
+{
+       float score;
+       entity tm, pl;
+#define SCOREPANEL_MAX_ENTRIES 6
+#define SCOREPANEL_ASPECTRATIO 2
+       const float entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize_y/mySize_x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES);
+       const float height = mySize_y/entries;
+       const vector fontsize = '0.9 0.9 0' * height;
+       pos_y += height * (1 - 0.9) / 2;
+
+       vector rgb, score_color;
+       rgb = '1 1 1';
+       score_color = '1 1 1';
+
+       const float name_size = mySize_x*0.75;
+       const float spacing_size = mySize_x*0.04;
+       const float highlight_alpha = 0.2;
+       float i, me_printed, first_pl;
+       string s;
+       i, first_pl = 0;
+       if (autocvar__hud_configure)
+       {
+               if (team_count)
+               {
+                       // show team scores in the first line
+                       float score_size = mySize_x / team_count;
+                       for(tm = teams.sort_next; tm; tm = tm.sort_next) {
+                               if(tm.team == COLOR_SPECTATOR)
+                                       continue;
+                               if (tm.team == myteam)
+                                       HUD_Panel_DrawHighlight(pos - eY * (height * (1 - 0.9) / 2) + eX * score_size * i, eX * score_size + eY * height, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawstring_aspect(pos + eX * score_size * i, ftos(123), eX * score_size + eY * fontsize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                               ++i;
+                       }
+                       first_pl = 1;
+                       pos_y += height;
+               }
+               score = 10 + SCOREPANEL_MAX_ENTRIES * 3;
+               for (i=first_pl; i<entries; ++i)
+               {
+                       //simulate my score is lower than all displayed players,
+                       //so that I don't appear at all showing pure rankings.
+                       //This is to better show the difference between the 2 ranking views
+                       if (i == entries-1 && autocvar_hud_panel_score_rankings == 1)
+                       {
+                               rgb = '1 1 0';
+                               drawfill(pos - eY * (height * (1 - 0.9) / 2), eX * mySize_x + eY * height, rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                               s = GetPlayerName(pl.sv_entnum);
+                               score = 7;
+                       }
+                       else
+                       {
+                               s = sprintf(_("Player %d"), i + 1 - first_pl);
+                               score -= 3;
+                       }
+
+                       if (team_count)
+                               score_color = GetTeamRGB(ColorByTeam(mod(i + 2, team_count))) * 0.8;
+                       s = textShortenToWidth(s, name_size, fontsize, stringwidth_colors);
+                       drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, TRUE, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring(pos + eX * (name_size + spacing_size), ftos(score), fontsize, score_color, panel_fg_alpha, DRAWFLAG_NORMAL);
+                       pos_y += height;
+               }
+               return;
+       }
+
+       if (!scoreboard_fade_alpha) // the scoreboard too calls HUD_UpdatePlayerTeams
+               HUD_UpdatePlayerTeams();
+       if (team_count)
+       {
+               // show team scores in the first line
+               float score_size = mySize_x / team_count;
+               for(tm = teams.sort_next; tm; tm = tm.sort_next) {
+                       if(tm.team == COLOR_SPECTATOR)
+                               continue;
+                       if (tm.team == myteam)
+                               drawfill(pos - eY * (height * (1 - 0.9) / 2) + eX * score_size * i, eX * score_size + eY * height, '1 1 1', highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       drawstring_aspect(pos + eX * score_size * i, ftos(tm.(teamscores[ts_primary])), eX * score_size + eY * fontsize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                       ++i;
+               }
+               first_pl = 1;
+               pos_y += height;
+       }
+       i = first_pl;
+       for (pl = players.sort_next; pl && i<entries; pl = pl.sort_next, ++i)
+       {
+               if (pl.team == COLOR_SPECTATOR)
+                       continue;
+
+               if (i == entries-1 && !me_printed && pl != me)
+               if (autocvar_hud_panel_score_rankings == 1 && spectatee_status != -1)
+               {
+                       for (pl = me.sort_next; pl; pl = pl.sort_next)
+                               if (pl.team != COLOR_SPECTATOR)
+                                       break;
+
+                       if (pl)
+                               rgb = '1 1 0'; //not last but not among the leading players: yellow
+                       else
+                               rgb = '1 0 0'; //last: red
+                       pl = me;
+               }
 
-       for(tm = world; (tm = find(tm, classname, "radarlink")); )
-               draw_teamradar_link(tm.origin, tm.velocity, tm.team);
-       for(tm = world; (tm = findflags(tm, teamradar_icon, 0xFFFFFF)); )
-               draw_teamradar_icon(tm.origin, tm.teamradar_icon, tm, tm.teamradar_color, panel_fg_alpha);
-       for(tm = world; (tm = find(tm, classname, "entcs_receiver")); )
-       {
-               color2 = GetPlayerColor(tm.sv_entnum);
-               //if(color == COLOR_SPECTATOR || color == color2)
-                       draw_teamradar_player(tm.origin, tm.angles, GetTeamRGB(color2));
+               if (pl == me)
+               {
+                       if (i == first_pl)
+                               rgb = '0 1 0'; //first: green
+                       me_printed = 1;
+                       drawfill(pos - eY * (height * (1 - 0.9) / 2), eX * mySize_x + eY * height, rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+               }
+               if (team_count)
+                       score_color = GetTeamRGB(pl.team) * 0.8;
+               s = textShortenToWidth(GetPlayerName(pl.sv_entnum), name_size, fontsize, stringwidth_colors);
+               drawcolorcodedstring(pos + eX * (name_size - stringwidth(s, TRUE, fontsize)), s, fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
+               drawstring(pos + eX * (name_size + spacing_size), ftos(pl.(scores[ps_primary])), fontsize, score_color, panel_fg_alpha, DRAWFLAG_NORMAL);
+               pos_y += height;
        }
-       draw_teamradar_player(view_origin, view_angles, '1 1 1');
-
-       drawresetcliparea();
-};
+}
 
-// Score (#7)
-//
 void HUD_Score(void)
 {
-       if(!autocvar_hud_panel_score && !autocvar__hud_configure)
-               return;
+       if(!autocvar__hud_configure)
+       {
+               if(!autocvar_hud_panel_score) return;
+               if(spectatee_status == -1 && (gametype == GAME_RACE || gametype == GAME_CTS)) return;
+       }
+       else
+               hud_configure_active_panel = HUD_PANEL_SCORE;
 
-       active_panel = HUD_PANEL_SCORE;
        HUD_Panel_UpdateCvars(score);
        vector pos, mySize;
        pos = panel_pos;
@@ -3639,7 +2721,7 @@ void HUD_Score(void)
                mySize -= '2 2 0' * panel_bg_padding;
        }
 
-       float score, distribution, leader;
+       float score, distribution;
        string sign;
        vector distribution_color;
        entity tm, pl, me;
@@ -3679,6 +2761,11 @@ void HUD_Score(void)
                        HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                drawstring_aspect(pos, timer, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
        } else if (!teamplay) { // non-teamgames
+               if ((spectatee_status == -1 && !autocvar__hud_configure) || autocvar_hud_panel_score_rankings)
+               {
+                       HUD_Score_Rankings(pos, mySize, me, 0);
+                       return;
+               }
                // me vector := [team/connected frags id]
                pl = players.sort_next;
                if(pl == me)
@@ -3695,50 +2782,99 @@ void HUD_Score(void)
                if(autocvar__hud_configure)
                        score = 123;
 
-               if(distribution >= 5) {
+               if(distribution >= 5)
                        distribution_color = eY;
-                       leader = 1;
-               } else if(distribution >= 0) {
+               else if(distribution >= 0)
                        distribution_color = '1 1 1';
-                       leader = 1;
-               } else if(distribution >= -5)
+               else if(distribution >= -5)
                        distribution_color = '1 1 0';
                else
                        distribution_color = eX;
 
-               drawstring_aspect(pos + eX * 0.75 * mySize_x, ftos(distribution), eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL);
-               if (leader)
+               string distribution_str;
+               distribution_str = ftos(distribution);
+               if (distribution >= 0)
+               {
+                       if (distribution > 0)
+                               distribution_str = strcat("+", distribution_str);
                        HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+               }
                drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL);
+               drawstring_aspect(pos + eX * 0.75 * mySize_x, distribution_str, eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL);
        } else { // teamgames
+               float scores_count, row, column, rows, columns;
+               vector offset;
+               vector score_pos, score_size; //for scores other than myteam
+               if (spectatee_status == -1 || autocvar_hud_panel_score_rankings)
+               {
+                       for(tm = teams.sort_next; tm, tm.team != COLOR_SPECTATOR; tm = tm.sort_next)
+                               ++scores_count;
+                       if (autocvar_hud_panel_score_rankings)
+                       {
+                               HUD_Score_Rankings(pos, mySize, me, scores_count);
+                               return;
+                       }
+                       rows = mySize_y/mySize_x;
+                       rows = bound(1, floor((sqrt(4 * (3/1) * rows * scores_count + rows * rows) + rows + 0.5) / 2), scores_count);
+                       //                               ^^^ ammo item aspect goes here
+
+                       columns = ceil(scores_count/rows);
+
+                       score_size = eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows);
+
+                       float newSize;
+                       if(score_size_x/score_size_y > 3)
+                       {
+                               newSize = 3 * score_size_y;
+                               offset_x = score_size_x - newSize;
+                               pos_x += offset_x/2;
+                               score_size_x = newSize;
+                       }
+                       else
+                       {
+                               newSize = 1/3 * score_size_x;
+                               offset_y = score_size_y - newSize;
+                               pos_y += offset_y/2;
+                               score_size_y = newSize;
+                       }
+               }
+               else
+                       score_size = eX * mySize_x*(1/4) + eY * mySize_y*(1/3);
+
                float max_fragcount;
                max_fragcount = -99;
-
-               float teamnum;
                for(tm = teams.sort_next; tm; tm = tm.sort_next) {
-                       if(tm.team == COLOR_SPECTATOR || (!tm.team_size && !autocvar__hud_configure)) // no players? don't display
+                       if(tm.team == COLOR_SPECTATOR)
                                continue;
                        score = tm.(teamscores[ts_primary]);
                        if(autocvar__hud_configure)
                                score = 123;
-                       leader = 0;
                        
                        if (score > max_fragcount)
                                max_fragcount = score;
 
-                       if(tm.team == myteam) {
+                       if (spectatee_status == -1)
+                       {
+                               score_pos = pos + eX * column * (score_size_x + offset_x) + eY * row * (score_size_y + offset_y);
+                               if (max_fragcount == score)
+                                       HUD_Panel_DrawHighlight(score_pos, score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawstring_aspect(score_pos, ftos(score), score_size, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                               ++row;
+                               if(row >= rows)
+                               {
+                                       row = 0;
+                                       ++column;
+                               }
+                       }
+                       else if(tm.team == myteam) {
                                if (max_fragcount == score)
-                                       leader = 1;
-                               if (leader)
                                        HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                                drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
                        } else {
                                if (max_fragcount == score)
-                                       leader = 1;
-                               if (leader)
-                                       HUD_Panel_DrawHighlight(pos + eX * 0.75 * mySize_x + eY * (1/3) * teamnum * mySize_y, eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                               drawstring_aspect(pos + eX * 0.75 * mySize_x + eY * (1/3) * teamnum * mySize_y, ftos(score), eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
-                               teamnum += 1;
+                                       HUD_Panel_DrawHighlight(pos + eX * 0.75 * mySize_x + eY * (1/3) * rows * mySize_y, score_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawstring_aspect(pos + eX * 0.75 * mySize_x + eY * (1/3) * rows * mySize_y, ftos(score), score_size, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                               ++rows;
                        }
                }
        }
@@ -3746,11 +2882,17 @@ void HUD_Score(void)
 
 // Race timer (#8)
 //
-void HUD_RaceTimer (void) {
-       if(!autocvar_hud_panel_racetimer && !(gametype == GAME_RACE || gametype == GAME_CTS) && !autocvar__hud_configure)
-               return;
+void HUD_RaceTimer (void)
+{
+       if(!autocvar__hud_configure)
+       {
+               if(!autocvar_hud_panel_racetimer) return;
+               if(!(gametype == GAME_RACE || gametype == GAME_CTS)) return;
+               if(spectatee_status == -1) return;
+       }
+       else
+               hud_configure_active_panel = HUD_PANEL_RACETIMER;
 
-       active_panel = HUD_PANEL_RACETIMER;
        HUD_Panel_UpdateCvars(racetimer);
        vector pos, mySize;
        pos = panel_pos;
@@ -3896,19 +3038,24 @@ float vote_change; // "time" when vote_active changed
 
 void HUD_VoteWindow(void) 
 {
-    uid2name_dialog = 0;
        if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE))
        {
                vote_active = 1;
+               if (autocvar__hud_configure)
+               {
+                       vote_yescount = 0;
+                       vote_nocount = 0;
+                       print(_("^1You must answer before entering hud configure mode\n"));
+                       cvar_set("_hud_configure", "0");
+               }
                vote_called_vote = strzone(_("^2Name ^7instead of \"^1Unregistered player^7\" in stats"));
-        uid2name_dialog = 1;
+               uid2name_dialog = 1;
        }
 
-       if(!autocvar_hud_panel_vote && !autocvar__hud_configure)
-               return;
-
        if(!autocvar__hud_configure)
        {
+               if(!autocvar_hud_panel_vote) return;
+
                panel_fg_alpha = autocvar_hud_panel_fg_alpha;
                panel_bg_alpha_str = autocvar_hud_panel_vote_bg_alpha;
 
@@ -3917,6 +3064,14 @@ void HUD_VoteWindow(void)
                }
                panel_bg_alpha = stof(panel_bg_alpha_str);
        }
+       else
+       {
+               hud_configure_active_panel = HUD_PANEL_VOTE;
+
+               vote_yescount = 3;
+               vote_nocount = 2;
+               vote_needed = 4;
+       }
 
        string s;
        float a;
@@ -3930,17 +3085,9 @@ void HUD_VoteWindow(void)
        else
                vote_alpha = bound(0, 1 - (time - vote_change) * 2, 1);
 
-       if(autocvar__hud_configure)
-       {
-               vote_yescount = 3;
-               vote_nocount = 2;
-               vote_needed = 4;
-       }
-
        if(!vote_alpha)
                return;
 
-       active_panel = HUD_PANEL_VOTE;
        HUD_Panel_UpdateCvars(vote);
 
        if(uid2name_dialog)
@@ -4429,17 +3576,11 @@ void HUD_Mod_NexBall(vector pos, vector mySize)
                        p = 2 - p;
 
                //Draw the filling
-               float vertical;
+               HUD_Panel_GetProgressBarColor(nexball);
                if(mySize_x > mySize_y)
-               {
-                       vertical = 0;
-               }
+                       HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", p, 0, 0, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
                else
-               {
-                       vertical = 1;
-               }
-               HUD_Panel_GetProgressBarColor(nexball);
-        HUD_Panel_DrawProgressBar(pos, mySize, "statusbar", vertical, 0, p, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       HUD_Panel_DrawProgressBar(pos, mySize, "progressbar", p, 1, 0, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
        }
 
        if (stat_items & IT_KEY1)
@@ -4591,19 +3732,117 @@ void HUD_Mod_Race(vector pos, vector mySize)
        }
 }
 
+void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, float layout, float i)
+{
+       float stat, pps_ratio;
+       string pic;
+       vector color;
+       switch(i)
+       {
+               case 0:
+                       stat = getstatf(STAT_DOM_PPS_RED);
+                       pic = "dom_icon_red";
+                       color = '1 0 0';
+                       break;
+               case 1:
+                       stat = getstatf(STAT_DOM_PPS_BLUE);
+                       pic = "dom_icon_blue";
+                       color = '0 0 1';
+                       break;
+               case 2:
+                       stat = getstatf(STAT_DOM_PPS_YELLOW);
+                       pic = "dom_icon_yellow";
+                       color = '1 1 0';
+                       break;
+               case 3:
+                       stat = getstatf(STAT_DOM_PPS_PINK);
+                       pic = "dom_icon_pink";
+                       color = '1 0 1';
+       }
+       pps_ratio = stat / getstatf(STAT_DOM_TOTAL_PPS);
+
+       if(mySize_x/mySize_y > aspect_ratio)
+       {
+               i = aspect_ratio * mySize_y;
+               myPos_x = myPos_x + (mySize_x - i) / 2;
+               mySize_x = i;
+       }
+       else
+       {
+               i = 1/aspect_ratio * mySize_x;
+               myPos_y = myPos_y + (mySize_y - i) / 2;
+               mySize_y = i;
+       }
+
+       if (layout) // show text too
+       {
+               //draw the text
+               color *= 0.5 + pps_ratio * (1 - 0.5); // half saturated color at min, full saturated at max
+               if (layout == 2) // average pps
+                       drawstring_aspect(myPos + eX * mySize_y, ftos_decimals(stat, 2), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+               else // percentage of average pps
+                       drawstring_aspect(myPos + eX * mySize_y, strcat( ftos(floor(pps_ratio*100 + 0.5)), "%" ), eX * (2/3) * mySize_x + eY * mySize_y, color, panel_fg_alpha, DRAWFLAG_NORMAL);
+       }
+
+       //draw the icon
+       drawpic_aspect_skin(myPos, pic, '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+       if (stat > 0)
+       {
+               drawsetcliparea(myPos_x, myPos_y + mySize_y * (1 - pps_ratio), mySize_y, mySize_y * pps_ratio);
+               drawpic_aspect_skin(myPos, strcat(pic, "-highlighted"), '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+               drawresetcliparea();
+       }
+}
+
+void HUD_Mod_Dom(vector myPos, vector mySize)
+{
+       mod_active = 1; // required in each mod function that always shows something
+       entity tm;
+       float teams_count;
+       for(tm = teams.sort_next; tm; tm = tm.sort_next)
+               if(tm.team != COLOR_SPECTATOR)
+                       ++teams_count;
+
+       float layout = autocvar_hud_panel_modicons_dom_layout;
+       float rows, columns, aspect_ratio;
+       rows = mySize_y/mySize_x;
+       aspect_ratio = (layout) ? 3 : 1;
+       rows = bound(1, floor((sqrt((4 * aspect_ratio * teams_count + rows) * rows) + rows + 0.5) / 2), teams_count);
+       columns = ceil(teams_count/rows);
+
+       int i;
+       float row, column;
+       for(i=0; i<teams_count; ++i)
+       {
+               vector pos, itemSize;
+               pos = myPos + eX * column * mySize_x*(1/columns) + eY * row * mySize_y*(1/rows);
+               itemSize = eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows);
+
+               DrawDomItem(pos, itemSize, aspect_ratio, layout, i);
+
+               ++row;
+               if(row >= rows)
+               {
+                       row = 0;
+                       ++column;
+               }
+       }
+}
+
 float mod_prev; // previous state of mod_active to check for a change
 float mod_alpha;
 float mod_change; // "time" when mod_active changed
 
 void HUD_ModIcons(void)
 {
-       if(!autocvar_hud_panel_modicons && !autocvar__hud_configure)
-               return;
-
-       if (gametype != GAME_KEYHUNT && gametype != GAME_CTF && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && gametype != GAME_CA && gametype != GAME_FREEZETAG && gametype != GAME_KEEPAWAY && !autocvar__hud_configure)
-               return;
+       if(!autocvar__hud_configure)
+       {
+               if(!autocvar_hud_panel_modicons) return;
+               if (gametype != GAME_CTF && gametype != GAME_KEYHUNT && gametype != GAME_NEXBALL && gametype != GAME_CTS && gametype != GAME_RACE && gametype != GAME_CA && gametype != GAME_FREEZETAG && gametype != GAME_KEEPAWAY && gametype != GAME_DOMINATION) return;
+       }
+       else
+               hud_configure_active_panel = HUD_PANEL_MODICONS;
 
-       active_panel = HUD_PANEL_MODICONS;
        HUD_Panel_UpdateCvars(modicons);
        vector pos, mySize;
        pos = panel_pos;
@@ -4639,6 +3878,8 @@ void HUD_ModIcons(void)
                HUD_Mod_Race(pos, mySize);
        else if(gametype == GAME_CA || gametype == GAME_FREEZETAG)
                HUD_Mod_CA(pos, mySize);
+       else if(gametype == GAME_DOMINATION)
+               HUD_Mod_Dom(pos, mySize);
        else if(gametype == GAME_KEEPAWAY)
                HUD_Mod_Keepaway(pos, mySize);
 }
@@ -4647,13 +3888,15 @@ void HUD_ModIcons(void)
 //
 void HUD_DrawPressedKeys(void)
 {
-       if(!autocvar_hud_panel_pressedkeys && !autocvar__hud_configure)
-               return;
+       if(!autocvar__hud_configure)
+       {
+               if(!autocvar_hud_panel_pressedkeys) return;
+               if(spectatee_status <= 0 && autocvar_hud_panel_pressedkeys < 2) return;
+       }
+       else
+               hud_configure_active_panel = HUD_PANEL_PRESSEDKEYS;
 
-       if(!(spectatee_status > 0 || autocvar_hud_panel_pressedkeys >= 2 || autocvar__hud_configure))
-               return;
 
-       active_panel = HUD_PANEL_PRESSEDKEYS;
        HUD_Panel_UpdateCvars(pressedkeys);
        vector pos, mySize;
        pos = panel_pos;
@@ -4691,27 +3934,33 @@ void HUD_DrawPressedKeys(void)
        vector keysize;
        keysize = eX * mySize_x * (1/3) + eY * mySize_y * 0.5;
        float pressedkeys;
-
        pressedkeys = getstatf(STAT_PRESSED_KEYS);
+
        drawpic_aspect_skin(pos, ((pressedkeys & KEY_CROUCH) ? "key_crouch_inv.tga" : "key_crouch.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-       drawpic_aspect_skin(pos + eX * mySize_x * (1/3), ((pressedkeys & KEY_FORWARD) ? "key_forward_inv.tga" : "key_forward.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-       drawpic_aspect_skin(pos + eX * mySize_x * (2/3), ((pressedkeys & KEY_JUMP) ? "key_jump_inv.tga" : "key_jump.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-       drawpic_aspect_skin(pos + eY * 0.5 * mySize_y, ((pressedkeys & KEY_LEFT) ? "key_left_inv.tga" : "key_left.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-       drawpic_aspect_skin(pos + eY * 0.5 * mySize_y + eX * mySize_x * (1/3), ((pressedkeys & KEY_BACKWARD) ? "key_backward_inv.tga" : "key_backward.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-       drawpic_aspect_skin(pos + eY * 0.5 * mySize_y + eX * mySize_x * (2/3), ((pressedkeys & KEY_RIGHT) ? "key_right_inv.tga" : "key_right.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawpic_aspect_skin(pos + eX * keysize_x, ((pressedkeys & KEY_FORWARD) ? "key_forward_inv.tga" : "key_forward.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawpic_aspect_skin(pos + eX * keysize_x * 2, ((pressedkeys & KEY_JUMP) ? "key_jump_inv.tga" : "key_jump.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+       pos_y += keysize_y;
+       drawpic_aspect_skin(pos, ((pressedkeys & KEY_LEFT) ? "key_left_inv.tga" : "key_left.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawpic_aspect_skin(pos + eX * keysize_x, ((pressedkeys & KEY_BACKWARD) ? "key_backward_inv.tga" : "key_backward.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+       drawpic_aspect_skin(pos + eX * keysize_x * 2, ((pressedkeys & KEY_RIGHT) ? "key_right_inv.tga" : "key_right.tga"), keysize, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 }
 
 // Handle chat as a panel (#12)
 //
 void HUD_Chat(void)
 {
-       if(!autocvar_hud_panel_chat && !autocvar__hud_configure)
+       if(!autocvar__hud_configure)
        {
-               cvar_set("con_chatrect", "0");
-               return;
+               if (!autocvar_hud_panel_chat)
+               {
+                       if (!autocvar_con_chatrect)
+                               cvar_set("con_chatrect", "0");
+                       return;
+               }
        }
+       else
+               hud_configure_active_panel = HUD_PANEL_CHAT;
 
-       active_panel = HUD_PANEL_CHAT;
        HUD_Panel_UpdateCvars(chat);
 
        if(autocvar__con_chat_maximized && !autocvar__hud_configure) // draw at full screen height if maximized
@@ -4742,7 +3991,8 @@ void HUD_Chat(void)
                mySize -= '2 2 0' * panel_bg_padding;
        }
 
-       cvar_set("con_chatrect", "1");
+       if (!autocvar_con_chatrect)
+               cvar_set("con_chatrect", "1");
 
        cvar_set("con_chatrect_x", ftos(pos_x/vid_conwidth));
        cvar_set("con_chatrect_y", ftos(pos_y/vid_conheight));
@@ -4752,8 +4002,8 @@ void HUD_Chat(void)
 
        if(autocvar__hud_configure)
        {
-               float chatsize;
-               chatsize = autocvar_con_chatsize;
+               vector chatsize;
+               chatsize = '1 1 0' * autocvar_con_chatsize;
                cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such
                float i, a;
                for(i = 0; i < autocvar_con_chat; ++i)
@@ -4762,7 +4012,8 @@ void HUD_Chat(void)
                                a = panel_fg_alpha;
                        else
                                a = panel_fg_alpha * floor(((i + 1) * 7 + autocvar_con_chattime)/45);
-                       drawcolorcodedstring(pos + eY * i * chatsize, textShortenToWidth(_("^3Player^7: This is the chat area."), mySize_x, '1 1 0' * chatsize, stringwidth_colors), '1 1 0' * chatsize, a, DRAWFLAG_NORMAL);
+                       drawcolorcodedstring(pos, textShortenToWidth(_("^3Player^7: This is the chat area."), mySize_x, chatsize, stringwidth_colors), chatsize, a, DRAWFLAG_NORMAL);
+                       pos_y += chatsize_y;
                }
        }
 }
@@ -4778,10 +4029,13 @@ float frametimeavg1; // 1 frame ago
 float frametimeavg2; // 2 frames ago
 void HUD_EngineInfo(void)
 {
-       if(!autocvar_hud_panel_engineinfo && !autocvar__hud_configure)
-               return;
+       if(!autocvar__hud_configure)
+       {
+               if(!autocvar_hud_panel_engineinfo) return;
+       }
+       else
+               hud_configure_active_panel = HUD_PANEL_ENGINEINFO;
 
-       active_panel = HUD_PANEL_ENGINEINFO;
        HUD_Panel_UpdateCvars(engineinfo);
        vector pos, mySize;
        pos = panel_pos;
@@ -4837,10 +4091,13 @@ void HUD_EngineInfo(void)
        o_y += fontsize_y;
 void HUD_InfoMessages(void)
 {
-       if(!autocvar_hud_panel_infomessages && !autocvar__hud_configure)
-               return;
+       if(!autocvar__hud_configure)
+       {
+               if(!autocvar_hud_panel_infomessages) return;
+       }
+       else
+               hud_configure_active_panel = HUD_PANEL_INFOMESSAGES;
 
-       active_panel = HUD_PANEL_INFOMESSAGES;
        HUD_Panel_UpdateCvars(infomessages);
        vector pos, mySize;
        pos = panel_pos;
@@ -5014,25 +4271,36 @@ void HUD_InfoMessages(void)
        }
 }
 
-/*
-==================
-Main HUD system
-==================
-*/
-
-void HUD_ShowSpeed(void)
+// Physics panel (#15)
+//
+vector acc_prevspeed;
+float acc_prevtime, acc_avg, top_speed, top_speed_time;
+void HUD_Physics(void)
 {
-       vector numsize;
-       float pos, conversion_factor;
-       string speed, zspeed, unit;
+       if(!autocvar__hud_configure)
+       {
+               if(!autocvar_hud_panel_physics) return;
+               if(spectatee_status == -1 && autocvar_hud_panel_physics < 2) return;
+       }
+       else
+               hud_configure_active_panel = HUD_PANEL_PHYSICS;
+
+       HUD_Panel_UpdateCvars(physics);
+
+       HUD_Panel_DrawBg(1);
+       if(panel_bg_padding)
+       {
+               panel_pos += '1 1 0' * panel_bg_padding;
+               panel_size -= '2 2 0' * panel_bg_padding;
+       }
+
+       //compute speed
+       float speed, conversion_factor;
+       string unit;
 
-       switch(autocvar_cl_showspeed_unit)
+       switch(autocvar_hud_panel_physics_speed_unit)
        {
                default:
-               case 0:
-                       unit = "";
-                       conversion_factor = 1.0;
-                       break;
                case 1:
                        unit = _(" qu/s");
                        conversion_factor = 1.0;
@@ -5055,64 +4323,185 @@ void HUD_ShowSpeed(void)
                        break;
        }
 
-       speed = strcat(ftos(floor( vlen(pmove_vel - pmove_vel_z * '0 0 1') * conversion_factor + 0.5 )), unit);
+       float max_speed = floor( autocvar_hud_panel_physics_speed_max * conversion_factor + 0.5 );
+       if (autocvar__hud_configure)
+               speed = floor( max_speed * 0.65 + 0.5 );
+       else if(autocvar_hud_panel_physics_speed_vertical)
+               speed = floor( vlen(pmove_vel) * conversion_factor + 0.5 );
+       else
+               speed = floor( vlen(pmove_vel - pmove_vel_z * '0 0 1') * conversion_factor + 0.5 );
 
-       numsize_x = numsize_y = autocvar_cl_showspeed_size;
-       pos = (vid_conheight - numsize_y) * autocvar_cl_showspeed_position;
+       //compute acceleration
+       float acceleration, f;
+       if (autocvar__hud_configure)
+               acceleration = autocvar_hud_panel_physics_acceleration_max * 0.3;
+       else
+       {
+               // 1 m/s = 0.0254 qu/s; 1 g = 9.80665 m/s^2
+               f = time - acc_prevtime;
+               if(autocvar_hud_panel_physics_acceleration_vertical)
+                       acceleration = (vlen(pmove_vel) - vlen(acc_prevspeed)) * (1 / f) * (0.0254 / 9.80665);
+               else
+                       acceleration = (vlen(pmove_vel - '0 0 1' * pmove_vel_z) - vlen(acc_prevspeed - '0 0 1' * acc_prevspeed_z)) * (1 / f) * (0.0254 / 9.80665);
+               acc_prevspeed = pmove_vel;
+               acc_prevtime = time;
 
-       drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
+               f = bound(0, f * 10, 1);
+               acc_avg = acc_avg * (1 - f) + acceleration * f;
+       }
 
-       if (autocvar_cl_showspeed_z == 1) {
-               zspeed = strcat(ftos(fabs(floor( pmove_vel_z * conversion_factor + 0.5 ))), unit);
-               drawstringcenter(eX + pos * eY + numsize_y * eY, zspeed, numsize * 0.5, '1 1 1', autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
+       //compute layout
+       float panel_ar = panel_size_x/panel_size_y;
+       vector speed_offset, acceleration_offset;
+       if (panel_ar >= 5)
+       {
+               panel_size_x *= 0.5;
+               if (autocvar_hud_panel_physics_flip)
+                       speed_offset_x = panel_size_x;
+               else
+                       acceleration_offset_x = panel_size_x;
        }
-}
+       else
+       {
+               panel_size_y *= 0.5;
+               if (autocvar_hud_panel_physics_flip)
+                       speed_offset_y = panel_size_y;
+               else
+                       acceleration_offset_y = panel_size_y;
+       }
+       float speed_baralign, acceleration_baralign;
+       if (autocvar_hud_panel_physics_baralign == 1)
+               acceleration_baralign = speed_baralign = 1;
+    else if(autocvar_hud_panel_physics_baralign == 4)
+               acceleration_baralign = speed_baralign = 2;
+       else if (autocvar_hud_panel_physics_flip)
+       {
+               acceleration_baralign = (autocvar_hud_panel_physics_baralign == 2);
+               speed_baralign = (autocvar_hud_panel_physics_baralign == 3);
+       }
+       else
+       {
+               speed_baralign = (autocvar_hud_panel_physics_baralign == 2);
+               acceleration_baralign = (autocvar_hud_panel_physics_baralign == 3);
+       }
+       if (autocvar_hud_panel_physics_acceleration_progressbar_mode == 0)
+               acceleration_baralign = 3; //override hud_panel_physics_baralign value for acceleration
 
-vector acc_prevspeed;
-float acc_prevtime;
-float acc_avg;
+       //draw speed
+       if(speed)
+       if(autocvar_hud_panel_physics_progressbar == 1 || autocvar_hud_panel_physics_progressbar == 2)
+       {
+               HUD_Panel_GetProgressBarColor(speed);
+               HUD_Panel_DrawProgressBar(panel_pos + speed_offset, panel_size, "progressbar", speed/max_speed, 0, speed_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+       }
+       vector tmp_offset, tmp_size;
+       if (autocvar_hud_panel_physics_text == 1 || autocvar_hud_panel_physics_text == 2)
+       {
+               tmp_size_x = panel_size_x * 0.75;
+               tmp_size_y = panel_size_y;
+               if (speed_baralign)
+                       tmp_offset_x = panel_size_x - tmp_size_x;
+               //else
+                       //tmp_offset_x = 0;
+               drawstring_aspect(panel_pos + speed_offset + tmp_offset, ftos(speed), tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 
-void HUD_ShowAcceleration(void)
-{
-       float acceleration, sz, scale, alpha, f;
-       vector pos, top, rgb;
-       top_x = vid_conwidth/2;
-       top_y = 0;
-
-       f = time - acc_prevtime;
-       if(autocvar_cl_showacceleration_z)
-               acceleration = (vlen(pmove_vel) - vlen(acc_prevspeed)) * (1 / f);
-       else
-               acceleration = (vlen(pmove_vel - '0 0 1' * pmove_vel_z) - vlen(acc_prevspeed - '0 0 1' * acc_prevspeed_z)) * (1 / f);
-       acc_prevspeed = pmove_vel;
-       acc_prevtime = time;
-
-       f = bound(0, f * 10, 1);
-       acc_avg = acc_avg * (1 - f) + acceleration * f;
-       acceleration = acc_avg / getstatf(STAT_MOVEVARS_MAXSPEED);
-       if (acceleration == 0)
-               return;
+               //draw speed unit
+               if (speed_baralign)
+                       tmp_offset_x = 0;
+               else
+                       tmp_offset_x = tmp_size_x;
+               if (autocvar_hud_panel_physics_speed_unit_show)
+               {
+                       //tmp_offset_y = 0;
+                       tmp_size_x = panel_size_x * (1 - 0.75);
+                       tmp_size_y = panel_size_y * 0.4;
+                       drawstring_aspect(panel_pos + speed_offset + tmp_offset, unit, tmp_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+               }
+       }
 
-       pos = top - sz/2 * eY + (autocvar_cl_showacceleration_position * vid_conheight) * eY;
+       //compute and draw top speed
+       if (autocvar_hud_panel_physics_topspeed)
+       if (autocvar_hud_panel_physics_text == 1 || autocvar_hud_panel_physics_text == 2)
+       {
+               if (autocvar__hud_configure)
+               {
+                       top_speed = floor( max_speed * 0.75 + 0.5 );
+                       f = 1;
+               }
+               else
+               {
+                       if (speed >= top_speed)
+                       {
+                               top_speed = speed;
+                               top_speed_time = time;
+                       }
+                       if (top_speed != 0)
+                       {
+                               f = max(1, autocvar_hud_panel_physics_topspeed_time);
+                               // divide by f to make it start from 1
+                               f = cos( ((time - top_speed_time) / f) * PI/2 );
+                       }
+            else //hide top speed 0, it would be stupid
+                               f = 0;
+               }
+               if (f > 0)
+               {
+                       //top speed progressbar peak
+                       if(speed < top_speed)
+                       if(autocvar_hud_panel_physics_progressbar == 1 || autocvar_hud_panel_physics_progressbar == 2)
+                       {
+                               float peak_offset_x;
+                               vector peak_size;
+                               if (speed_baralign == 0)
+                                       peak_offset_x = min(top_speed, max_speed)/max_speed * panel_size_x;
+                else if (speed_baralign == 1)
+                                       peak_offset_x = (1 - min(top_speed, max_speed)/max_speed) * panel_size_x;
+                else if (speed_baralign == 2)
+                    peak_offset_x = min(top_speed, max_speed)/max_speed * panel_size_x * 0.5;
+                               //if speed is not 0 the speed progressbar already fetched the color
+                               if (speed == 0)
+                                       HUD_Panel_GetProgressBarColor(speed);
+                               peak_size_x = floor(panel_size_x * 0.01 + 1.5);
+                peak_size_y = panel_size_y;
+                if (speed_baralign == 2) // draw two peaks, on both sides
+                {
+                    drawfill(panel_pos + speed_offset + eX * (0.5 * panel_size_x + peak_offset_x - peak_size_x), peak_size, progressbar_color, f * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                    drawfill(panel_pos + speed_offset + eX * (0.5 * panel_size_x - peak_offset_x + peak_size_x), peak_size, progressbar_color, f * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                }
+                else
+                    drawfill(panel_pos + speed_offset + eX * (peak_offset_x - peak_size_x), peak_size, progressbar_color, f * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+                       }
 
-       sz = autocvar_cl_showacceleration_size;
-       scale = autocvar_cl_showacceleration_scale;
-       alpha = autocvar_cl_showacceleration_alpha;
-       if (autocvar_cl_showacceleration_color_custom)
-               rgb = stov(autocvar_cl_showacceleration_color);
-       else {
-               if (acceleration < 0)
-                       rgb = '1 .5 .5' - '0 .5 .5' * bound(0, -acceleration * 0.2, 1);
+                       //top speed
+                       tmp_offset_y = panel_size_y * 0.4;
+                       tmp_size_x = panel_size_x * (1 - 0.75);
+                       tmp_size_y = panel_size_y - tmp_offset_y;
+                       drawstring_aspect(panel_pos + speed_offset + tmp_offset, ftos(top_speed), tmp_size, '1 0 0', f * panel_fg_alpha, DRAWFLAG_NORMAL);
+               }
                else
-                       rgb = '.5 1 .5' - '.5 0 .5' * bound(0, +acceleration * 0.2, 1);
+                       top_speed = 0;
        }
 
-       if (acceleration > 0)
-        HUD_Panel_DrawProgressBar(pos, eX * (vid_conwidth - pos_x) + eY * sz, "accelbar", 0, 0, acceleration * scale, rgb, alpha * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
-       else
-        HUD_Panel_DrawProgressBar(eY * pos_y, eX * pos_x + eY * sz, "accelbar", 0, 1, -acceleration * scale, rgb, alpha * autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+       //draw acceleration
+       if(acceleration)
+       if(autocvar_hud_panel_physics_progressbar == 1 || autocvar_hud_panel_physics_progressbar == 3)
+       {
+               if (acceleration < 0)
+                       HUD_Panel_GetProgressBarColor(acceleration_neg);
+               else
+                       HUD_Panel_GetProgressBarColor(acceleration);
+               HUD_Panel_DrawProgressBar(panel_pos + acceleration_offset, panel_size, "accelbar", acceleration/autocvar_hud_panel_physics_acceleration_max, 0, acceleration_baralign, progressbar_color, autocvar_hud_progressbar_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
+       }
+       if (autocvar_hud_panel_physics_text == 1 || autocvar_hud_panel_physics_text == 3)
+               drawstring_aspect(panel_pos + acceleration_offset, strcat(ftos_decimals(acceleration, 2), "g"), panel_size, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
 }
 
+/*
+==================
+Main HUD system
+==================
+*/
+
 void HUD_Reset (void)
 {
        // reset gametype specific icons
@@ -5154,6 +4543,8 @@ switch (id) {\
                HUD_EngineInfo(); break;\
        case (HUD_PANEL_INFOMESSAGES):\
                 HUD_InfoMessages(); break;\
+       case (HUD_PANEL_PHYSICS):\
+                HUD_Physics(); break;\
 } ENDS_WITH_CURLY_BRACE
 
 void HUD_Main (void)
@@ -5173,8 +4564,6 @@ void HUD_Main (void)
        else if(autocvar__menu_alpha == 0 && scoreboard_fade_alpha == 0)
                hud_fade_alpha = 1;
 
-       hud_fontsize = HUD_GetFontsize("hud_fontsize");
-
        if(!autocvar__hud_configure && !hud_fade_alpha)
                return;
 
@@ -5189,16 +4578,16 @@ void HUD_Main (void)
        // HUD configure visible grid
        if(autocvar__hud_configure && autocvar_hud_configure_grid && autocvar_hud_configure_grid_alpha)
        {
+               hud_configure_gridSize_x = bound(0.005, cvar("hud_configure_grid_xsize"), 0.2);
+               hud_configure_gridSize_y = bound(0.005, cvar("hud_configure_grid_ysize"), 0.2);
+               hud_configure_realGridSize_x = hud_configure_gridSize_x * vid_conwidth;
+               hud_configure_realGridSize_y = hud_configure_gridSize_y * vid_conheight;
                // x-axis
-               for(i = 0; i < 1/bound(0.005, autocvar_hud_configure_grid_xsize, 0.2); ++i)
-               {
-                       drawfill(eX * i * vid_conwidth * bound(0.005, autocvar_hud_configure_grid_xsize, 0.2), eX + eY * vid_conheight, '0.5 0.5 0.5', autocvar_hud_configure_grid_alpha, DRAWFLAG_NORMAL);
-               }
+               for(i = 0; i < 1/hud_configure_gridSize_x; ++i)
+                       drawfill(eX * i * hud_configure_realGridSize_x, eX + eY * vid_conheight, '0.5 0.5 0.5', autocvar_hud_configure_grid_alpha, DRAWFLAG_NORMAL);
                // y-axis
-               for(i = 0; i < 1/bound(0.005, autocvar_hud_configure_grid_ysize, 0.2); ++i)
-               {
-                       drawfill(eY * i * vid_conheight * bound(0.005, autocvar_hud_configure_grid_ysize, 0.2), eY + eX * vid_conwidth, '0.5 0.5 0.5', autocvar_hud_configure_grid_alpha, DRAWFLAG_NORMAL);
-               }
+               for(i = 0; i < 1/hud_configure_gridSize_y; ++i)
+                       drawfill(eY * i * hud_configure_realGridSize_y, eY + eX * vid_conwidth, '0.5 0.5 0.5', autocvar_hud_configure_grid_alpha, DRAWFLAG_NORMAL);
        }
 
     current_player = (spectatee_status > 0) ? spectatee_status : player_localentnum;
@@ -5244,14 +4633,45 @@ void HUD_Main (void)
 
        // cache the panel order into the panel_order array
        if(autocvar__hud_panelorder != hud_panelorder_prev) {
+               for(i = 0; i < HUD_PANEL_NUM; ++i)
+                       panel_order[i] = -1;
+               string s;
+               float p_num, warning;
+               float argc = tokenize_console(autocvar__hud_panelorder);
+               if (argc > HUD_PANEL_NUM)
+                       warning = true;
+               //first detect wrong/missing panel numbers
+               for(i = 0; i < HUD_PANEL_NUM; ++i) {
+                       p_num = stof(argv(i));
+                       if (p_num >= 0 && p_num < HUD_PANEL_NUM) { //correct panel number?
+                               if (panel_order[p_num] == -1) //found for the first time?
+                                       s = strcat(s, ftos(p_num), " ");
+                               panel_order[p_num] = 1; //mark as found
+                       }
+                       else
+                               warning = true;
+               }
+               for(i = 0; i < HUD_PANEL_NUM; ++i) {
+                       if (panel_order[i] == -1) {
+                               warning = true;
+                               s = strcat(s, ftos(i), " "); //add missing panel number
+                       }
+               }
+               if (warning)
+                       print(_("Automatically fixed wrong/missing panel numbers in _hud_panelorder\n"));
+
+               cvar_set("_hud_panelorder", s);
                if(hud_panelorder_prev)
                        strunzone(hud_panelorder_prev);
-               hud_panelorder_prev = strzone(autocvar__hud_panelorder);
-               tokenize_console(autocvar__hud_panelorder);
+               hud_panelorder_prev = strzone(s);
+
+               //now properly set panel_order
+               tokenize_console(s);
                for(i = 0; i < HUD_PANEL_NUM; ++i) {
                        panel_order[i] = stof(argv(i));
                }
        }
+
        // draw panels in order specified by panel_order array
        for(i = HUD_PANEL_NUM - 1; i >= 0; --i) {
                if(i != HUD_PANEL_CHAT || !autocvar__con_chat_maximized) // don't draw maximized chat panel twice!
@@ -5262,15 +4682,15 @@ void HUD_Main (void)
        if(autocvar__con_chat_maximized)
                HUD_Chat(); // HUD_DrawPanel(HUD_PANEL_CHAT);
 
-       // TODO hud_'ify these
-       if (autocvar_cl_showspeed)
-               HUD_ShowSpeed();
-       if (autocvar_cl_showacceleration)
-               HUD_ShowAcceleration();
-
        if (autocvar__hud_configure && spectatee_status && hud_configure_prev == -1) // try to join if we are in hud_configure mode, but still spectating, and in the first frame (in order to get rid of motd when launching a server via the menu "HUD Setup" button)
                localcmd("cmd selectteam auto; cmd join\n");
 
+       if(autocvar__hud_configure && tab_panel != -1)
+       {
+               HUD_Panel_UpdatePosSizeForId(tab_panel)
+               drawfill(panel_pos - '1 1 0' * panel_bg_border, panel_size + '2 2 0' * panel_bg_border, '1 1 1', .2, DRAWFLAG_NORMAL);
+       }
+
        hud_configure_prev = autocvar__hud_configure;
 
        if (!autocvar__hud_configure) // hud config mode disabled, enable normal alpha stuff again
index 21e3746b560811ee3d89c7b422b8c28f5f55a1bc..d2fbfebef2603ca71bc6ee2fc470cfbc47076f44 100644 (file)
@@ -10,7 +10,6 @@ vector panel_click_distance; // mouse cursor distance from the top left corner o
 vector panel_click_resizeorigin; // coordinates for opposite point when resizing
 float resizeCorner; // 1 = topleft, 2 = topright, 3 = bottomleft, 4 = bottomright
 var float highlightedPanel = -1;
-var float highlightedPanel_prev = -1;
 float highlightedAction; // 0 = nothing, 1 = move, 2 = resize
 
 const float BORDER_MULTIPLIER = 0.25;
@@ -39,6 +38,8 @@ float teamnagger;
 
 float hud_configure_checkcollisions;
 float hud_configure_prev;
+vector hud_configure_gridSize;
+vector hud_configure_realGridSize;
 
 float hudShiftState;
 const float S_SHIFT = 1;
@@ -61,7 +62,7 @@ var vector panel_size_backup;
 var float highlightedPanel_copied = -1; //this is good only to know if there is something copied
 var vector panel_size_copied;
 
-var float active_panel; // this panel has recently referred the UpdateCvars macro
+var float hud_configure_active_panel; // this panel has recently referred the UpdateCvars macro
 var string panel_name;
 var float panel_enabled;
 var vector panel_pos;
@@ -92,12 +93,15 @@ float current_player;
                progressbar_color = stov(cvar_string("hud_progressbar_" #item "_color"))
 #define HUD_Panel_GetProgressBarColorForString(item) \
 switch(item) {\
-       case "strength": HUD_Panel_GetProgressBarColor(strength); break;\
-       case "shield": HUD_Panel_GetProgressBarColor(shield); break;\
        case "health": HUD_Panel_GetProgressBarColor(health); break;\
        case "armor": HUD_Panel_GetProgressBarColor(armor); break;\
+       case "strength": HUD_Panel_GetProgressBarColor(strength); break;\
+       case "shield": HUD_Panel_GetProgressBarColor(shield); break;\
        case "fuel": HUD_Panel_GetProgressBarColor(fuel); break;\
        case "nexball": HUD_Panel_GetProgressBarColor(nexball); break;\
+       case "speed": HUD_Panel_GetProgressBarColor(speed); break;\
+       case "acceleration": HUD_Panel_GetProgressBarColor(acceleration); break;\
+       case "acceleration_neg": HUD_Panel_GetProgressBarColor(acceleration_neg); break;\
 } ENDS_WITH_CURLY_BRACE
 
 // Get value for panel_bg: if "" fetch default, else use panel_bg_str
@@ -159,13 +163,14 @@ if(panel_bg_alpha_str == "") {\
        panel_bg_alpha_str = ftos(autocvar_hud_panel_bg_alpha);\
 }\
 panel_bg_alpha = stof(panel_bg_alpha_str);\
-if(autocvar__hud_configure && menu_enabled == 2 && highlightedPanel == active_panel) {\
-       panel_bg_alpha = (1 - autocvar__menu_alpha) * max(autocvar_hud_configure_bg_minalpha, panel_bg_alpha) + autocvar__menu_alpha * panel_bg_alpha;\
-} else if(autocvar__hud_configure) {\
-       panel_bg_alpha = max(autocvar_hud_configure_bg_minalpha, panel_bg_alpha);\
-} if(autocvar__hud_configure && !panel_enabled) {\
-       panel_bg_alpha = 0.25;\
-} if(!(menu_enabled == 2 && highlightedPanel == active_panel)) {\
+if(autocvar__hud_configure) {\
+       if(!panel_enabled)\
+               panel_bg_alpha = 0.25;\
+       else if(menu_enabled == 2 && highlightedPanel == hud_configure_active_panel)\
+               panel_bg_alpha = (1 - autocvar__menu_alpha) * max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha) + autocvar__menu_alpha * panel_bg_alpha;\
+       else\
+               panel_bg_alpha = max(cvar("hud_configure_bg_minalpha"), panel_bg_alpha);\
+} if(!(menu_enabled == 2 && highlightedPanel == hud_configure_active_panel)) {\
        panel_bg_alpha *= hud_fade_alpha;\
 }
 
@@ -176,7 +181,7 @@ if(autocvar__hud_configure && menu_enabled == 2 && highlightedPanel == active_pa
 panel_fg_alpha = autocvar_hud_panel_fg_alpha;\
 if(autocvar__hud_configure && !panel_enabled)\
        panel_fg_alpha = 0.25;\
-if(!(menu_enabled == 2 && highlightedPanel == active_panel))\
+if(!(menu_enabled == 2 && highlightedPanel == hud_configure_active_panel))\
        panel_fg_alpha *= hud_fade_alpha;
 
 // Get border. See comments above, it's similar.
@@ -205,13 +210,15 @@ if(panel_bg_padding_str == "") {\
 panel_bg_padding = min(min(panel_size_x, panel_size_y)/2 - 5, panel_bg_padding);
 
 // Point to the macros above (stupid max macro length)
-#define HUD_Panel_StringVars()\
+#define HUD_Panel_GetStringVars()\
 HUD_Panel_GetBg()\
-HUD_Panel_GetColorTeam()\
-HUD_Panel_GetColor()\
-HUD_Panel_GetBgAlpha()\
+if (panel_bg != "0") {\
+       HUD_Panel_GetColorTeam()\
+       HUD_Panel_GetColor()\
+       HUD_Panel_GetBgAlpha()\
+       HUD_Panel_GetBorder()\
+}\
 HUD_Panel_GetFgAlpha()\
-HUD_Panel_GetBorder()\
 HUD_Panel_GetScaledVectors()\
 HUD_Panel_GetPadding()
 
@@ -225,7 +232,9 @@ else\
 panel_pos = (1 - autocvar__menu_alpha) * panel_pos + (autocvar__menu_alpha) * menu_enable_panelpos;
 
 // return smoothly faded size of given panel when a dialog is active
-var vector menu_enable_maxsize; FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(menu_enable_maxsize);
+//var vector menu_enable_maxsize; FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(menu_enable_maxsize);
+var float menu_enable_maxsize_x;
+var float menu_enable_maxsize_y;
 var vector menu_enable_size;
 #define HUD_Panel_GetMenuSize()\
 menu_enable_maxsize_x = 0.3 * vid_conwidth;\
@@ -260,13 +269,22 @@ panel_bg_color_team_str = cvar_string("hud_panel_" #name "_bg_color_team"); \
 panel_bg_alpha_str = cvar_string("hud_panel_" #name "_bg_alpha"); \
 panel_bg_border_str = cvar_string("hud_panel_" #name "_bg_border"); \
 panel_bg_padding_str = cvar_string("hud_panel_" #name "_bg_padding"); \
-HUD_Panel_StringVars()\
-if(menu_enabled == 2 && active_panel == highlightedPanel) {\
+HUD_Panel_GetStringVars()\
+if(menu_enabled == 2 && hud_configure_active_panel == highlightedPanel) {\
        HUD_Panel_GetMenuSize()\
        HUD_Panel_GetMenuPos()\
 } ENDS_WITH_CURLY_BRACE
 
+// FTEQCC I HATE YOU WHY DO YOU MAKE ME DO THIS??? :(
+// max macro length is 1024 characters, I must split it up :(
+
 // Update all common cvars of given panel id
+#define HUD_Panel_UpdateCvarsForId_Part2(id) \
+switch(id) { \
+       case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdateCvars(infomessages) break; \
+       case HUD_PANEL_PHYSICS: HUD_Panel_UpdateCvars(physics); break;\
+}
+
 #define HUD_Panel_UpdateCvarsForId(id) \
 switch(id) { \
        case HUD_PANEL_WEAPONS: HUD_Panel_UpdateCvars(weapons) break; \
@@ -283,14 +301,14 @@ switch(id) { \
        case HUD_PANEL_PRESSEDKEYS: HUD_Panel_UpdateCvars(pressedkeys) break; \
        case HUD_PANEL_CHAT: HUD_Panel_UpdateCvars(chat) break; \
        case HUD_PANEL_ENGINEINFO: HUD_Panel_UpdateCvars(engineinfo) break; \
-       case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdateCvars(infomessages) break; \
+       default: HUD_Panel_UpdateCvarsForId_Part2(id)\
 }
 
 #define HUD_Panel_UpdatePosSize(name) \
 panel_pos = stov(cvar_string("hud_panel_" #name "_pos")); \
 panel_size = stov(cvar_string("hud_panel_" #name "_size")); \
 HUD_Panel_GetScaledVectors()\
-if(menu_enabled == 2 && active_panel == highlightedPanel) {\
+if(menu_enabled == 2 && hud_configure_active_panel == highlightedPanel) {\
        HUD_Panel_GetMenuSize()\
        HUD_Panel_GetMenuPos()\
 }\
@@ -298,6 +316,12 @@ panel_bg_border_str = cvar_string("hud_panel_" #name "_bg_border"); \
 HUD_Panel_GetBorder()
 
 // Update pos and size of given panel id
+#define HUD_Panel_UpdatePosSizeForId_Part2(id) \
+switch(id) { \
+       case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdatePosSize(infomessages) break;\
+       case HUD_PANEL_PHYSICS: HUD_Panel_UpdatePosSize(physics); break;\
+}
+
 #define HUD_Panel_UpdatePosSizeForId(id) \
 switch(id) { \
        case HUD_PANEL_WEAPONS: HUD_Panel_UpdatePosSize(weapons) break;\
@@ -314,5 +338,5 @@ switch(id) { \
        case HUD_PANEL_PRESSEDKEYS: HUD_Panel_UpdatePosSize(pressedkeys) break;\
        case HUD_PANEL_CHAT: HUD_Panel_UpdatePosSize(chat) break;\
        case HUD_PANEL_ENGINEINFO: HUD_Panel_UpdatePosSize(engineinfo) break;\
-       case HUD_PANEL_INFOMESSAGES: HUD_Panel_UpdatePosSize(infomessages)\
+       default: HUD_Panel_UpdatePosSizeForId_Part2(id)\
 }
diff --git a/qcsrc/client/hud_config.qc b/qcsrc/client/hud_config.qc
new file mode 100644 (file)
index 0000000..0923e4e
--- /dev/null
@@ -0,0 +1,1115 @@
+#define HUD_Write(s) fputs(fh, s)
+// q: quoted, n: not quoted
+#define HUD_Write_Cvar_n(cvar) HUD_Write(strcat("seta ", cvar, " ", cvar_string(cvar), "\n"))
+#define HUD_Write_Cvar_q(cvar) HUD_Write(strcat("seta ", cvar, " \"", cvar_string(cvar), "\"\n"))
+#define HUD_Write_PanelCvar_n(cvar_suf) HUD_Write_Cvar_n(strcat("hud_panel_", panel_name, cvar_suf))
+#define HUD_Write_PanelCvar_q(cvar_suf) HUD_Write_Cvar_q(strcat("hud_panel_", panel_name, cvar_suf))
+// Save the config
+void HUD_Panel_ExportCfg(string cfgname)
+{
+       float fh;
+       string filename = strcat("hud_", autocvar_hud_skin, "_", cfgname, ".cfg");
+       fh = fopen(filename, FILE_WRITE);
+       if(fh >= 0)
+       {
+               HUD_Write_Cvar_q("hud_skin");
+               HUD_Write_Cvar_q("hud_panel_bg");
+               HUD_Write_Cvar_q("hud_panel_bg_color");
+               HUD_Write_Cvar_q("hud_panel_bg_color_team");
+               HUD_Write_Cvar_q("hud_panel_bg_alpha");
+               HUD_Write_Cvar_q("hud_panel_bg_border");
+               HUD_Write_Cvar_q("hud_panel_bg_padding");
+               HUD_Write_Cvar_q("hud_panel_fg_alpha");
+               HUD_Write("\n");
+
+               HUD_Write_Cvar_q("hud_dock");
+               HUD_Write_Cvar_q("hud_dock_color");
+               HUD_Write_Cvar_q("hud_dock_color_team");
+               HUD_Write_Cvar_q("hud_dock_alpha");
+               HUD_Write("\n");
+
+               HUD_Write_Cvar_q("hud_progressbar_alpha");
+               HUD_Write_Cvar_q("hud_progressbar_strength_color");
+               HUD_Write_Cvar_q("hud_progressbar_shield_color");
+               HUD_Write_Cvar_q("hud_progressbar_health_color");
+               HUD_Write_Cvar_q("hud_progressbar_armor_color");
+               HUD_Write_Cvar_q("hud_progressbar_fuel_color");
+               HUD_Write_Cvar_q("hud_progressbar_nexball_color");
+               HUD_Write("\n");
+
+               HUD_Write_Cvar_q("_hud_panelorder");
+               HUD_Write("\n");
+
+               HUD_Write_Cvar_q("hud_configure_grid");
+               HUD_Write_Cvar_q("hud_configure_grid_xsize");
+               HUD_Write_Cvar_q("hud_configure_grid_ysize");
+               HUD_Write("\n");
+
+               HUD_Write_Cvar_q("scr_centerpos");
+               HUD_Write("\n");
+
+               // common cvars for all panels
+               float i;
+               for (i = 0; i < HUD_PANEL_NUM; ++i)
+               {
+                       HUD_Panel_GetName(i);
+
+                       HUD_Write_PanelCvar_n("");
+                       HUD_Write_PanelCvar_q("_pos");
+                       HUD_Write_PanelCvar_q("_size");
+                       HUD_Write_PanelCvar_q("_bg");
+                       HUD_Write_PanelCvar_q("_bg_color");
+                       HUD_Write_PanelCvar_q("_bg_color_team");
+                       HUD_Write_PanelCvar_q("_bg_alpha");
+                       HUD_Write_PanelCvar_q("_bg_border");
+                       HUD_Write_PanelCvar_q("_bg_padding");
+                       switch(i) {
+                               case HUD_PANEL_WEAPONS:
+                                       HUD_Write_PanelCvar_q("_complainbubble");
+                                       HUD_Write_PanelCvar_q("_complainbubble_padding");
+                                       HUD_Write_PanelCvar_q("_complainbubble_color_outofammo");
+                                       HUD_Write_PanelCvar_q("_complainbubble_color_donthave");
+                                       HUD_Write_PanelCvar_q("_complainbubble_color_unavailable");
+                                       HUD_Write_PanelCvar_q("_ammo_color");
+                                       HUD_Write_PanelCvar_q("_ammo_alpha");
+                                       HUD_Write_PanelCvar_q("_aspect");
+                                       HUD_Write_PanelCvar_q("_timeout");
+                                       HUD_Write_PanelCvar_q("_timeout_effect");
+                                       break;
+                               case HUD_PANEL_AMMO:
+                                       HUD_Write_PanelCvar_q("_onlycurrent");
+                                       HUD_Write_PanelCvar_q("_iconalign");
+                                       HUD_Write_PanelCvar_q("_progressbar");
+                                       HUD_Write_PanelCvar_q("_progressbar_name");
+                                       HUD_Write_PanelCvar_q("_progressbar_xoffset");
+                                       HUD_Write_PanelCvar_q("_text");
+                                       break;
+                               case HUD_PANEL_POWERUPS:
+                                       HUD_Write_PanelCvar_q("_flip");
+                                       HUD_Write_PanelCvar_q("_iconalign");
+                                       HUD_Write_PanelCvar_q("_baralign");
+                                       HUD_Write_PanelCvar_q("_progressbar");
+                                       HUD_Write_PanelCvar_q("_progressbar_strength");
+                                       HUD_Write_PanelCvar_q("_progressbar_shield");
+                                       break;
+                               case HUD_PANEL_HEALTHARMOR:
+                                       HUD_Write_PanelCvar_q("_flip");
+                                       HUD_Write_PanelCvar_q("_iconalign");
+                                       HUD_Write_PanelCvar_q("_baralign");
+                                       HUD_Write_PanelCvar_q("_progressbar");
+                                       HUD_Write_PanelCvar_q("_progressbar_health");
+                                       HUD_Write_PanelCvar_q("_progressbar_armor");
+                                       HUD_Write_PanelCvar_q("_text");
+                                       break;
+                               case HUD_PANEL_NOTIFY:
+                                       HUD_Write_PanelCvar_q("_flip");
+                                       HUD_Write_PanelCvar_q("_fontsize");
+                                       HUD_Write_PanelCvar_q("_print");
+                                       break;
+                               case HUD_PANEL_RADAR:
+                                       HUD_Write_PanelCvar_q("_foreground_alpha");
+                                       break;
+                               case HUD_PANEL_VOTE:
+                                       HUD_Write_PanelCvar_q("_alreadyvoted_alpha");
+                                       break;
+                               case HUD_PANEL_PRESSEDKEYS:
+                                       HUD_Write_PanelCvar_q("_aspect");
+                                       break;
+                               case HUD_PANEL_INFOMESSAGES:
+                                       HUD_Write_PanelCvar_q("_flip");
+                                       break;
+                               case HUD_PANEL_PHYSICS:
+                                       HUD_Write_PanelCvar_q("_flip");
+                                       HUD_Write_PanelCvar_q("_baralign");
+                                       HUD_Write_PanelCvar_q("_progressbar");
+                                       HUD_Write_PanelCvar_q("_acceleration_mode");
+                                       break;
+                       }
+                       HUD_Write("\n");
+               }
+               HUD_Write("menu_sync\n"); // force the menu to reread the cvars, so that the dialogs are updated
+
+               print(sprintf(_("^2Successfully exported to %s! (Note: It's saved in data/data/)\n"), filename));
+               fclose(fh);
+       }
+       else
+               print(sprintf(_("^1Couldn't write to %s\n"), filename));
+}
+
+// check if move will result in panel being moved into another panel. If so, return snapped vector, otherwise return the given vector
+vector HUD_Panel_CheckMove(vector myPos, vector mySize)
+{
+       float i;
+       float myCenter_x, myCenter_y, targCenter_x, targCenter_y;
+       vector myTarget;
+       myTarget = myPos;
+
+       for (i = 0; i < HUD_PANEL_NUM; ++i) {
+               if(i == highlightedPanel || !panel_enabled)
+                       continue;
+
+               HUD_Panel_UpdatePosSizeForId(i);
+
+               panel_pos -= '1 1 0' * panel_bg_border;
+               panel_size += '2 2 0' * panel_bg_border;
+
+               if(myPos_y + mySize_y < panel_pos_y)
+                       continue;
+               if(myPos_y > panel_pos_y + panel_size_y)
+                       continue;
+
+               if(myPos_x + mySize_x < panel_pos_x)
+                       continue;
+               if(myPos_x > panel_pos_x + panel_size_x)
+                       continue;
+
+               // OK, there IS a collision.
+
+               myCenter_x = myPos_x + 0.5 * mySize_x;
+               myCenter_y = myPos_y + 0.5 * mySize_y;
+
+               targCenter_x = panel_pos_x + 0.5 * panel_size_x;
+               targCenter_y = panel_pos_y + 0.5 * panel_size_y;
+
+               if(myCenter_x < targCenter_x && myCenter_y < targCenter_y) // top left (of the target panel)
+               {
+                       if(myPos_x + mySize_x - panel_pos_x < myPos_y + mySize_y - panel_pos_y) // push it to the side
+                               myTarget_x = panel_pos_x - mySize_x;
+                       else // push it upwards
+                               myTarget_y = panel_pos_y - mySize_y;
+               }
+               else if(myCenter_x > targCenter_x && myCenter_y < targCenter_y) // top right
+               {
+                       if(panel_pos_x + panel_size_x - myPos_x < myPos_y + mySize_y - panel_pos_y) // push it to the side
+                               myTarget_x = panel_pos_x + panel_size_x;
+                       else // push it upwards
+                               myTarget_y = panel_pos_y - mySize_y;
+               }
+               else if(myCenter_x < targCenter_x && myCenter_y > targCenter_y) // bottom left
+               {
+                       if(myPos_x + mySize_x - panel_pos_x < panel_pos_y + panel_size_y - myPos_y) // push it to the side
+                               myTarget_x = panel_pos_x - mySize_x;
+                       else // push it downwards
+                               myTarget_y = panel_pos_y + panel_size_y;
+               }
+               else if(myCenter_x > targCenter_x && myCenter_y > targCenter_y) // bottom right
+               {
+                       if(panel_pos_x + panel_size_x - myPos_x < panel_pos_y + panel_size_y - myPos_y) // push it to the side
+                               myTarget_x = panel_pos_x + panel_size_x;
+                       else // push it downwards
+                               myTarget_y = panel_pos_y + panel_size_y;
+               }
+               //if(cvar("hud_configure_checkcollisions_debug"))
+                       //drawfill(panel_pos, panel_size, '1 1 0', .3, DRAWFLAG_NORMAL);
+       }
+
+       return myTarget;
+}
+
+void HUD_Panel_SetPos(vector pos)
+{
+       HUD_Panel_UpdatePosSizeForId(highlightedPanel);
+       vector mySize;
+       mySize = panel_size;
+
+       //if(cvar("hud_configure_checkcollisions_debug"))
+               //drawfill(pos, mySize, '1 1 1', .2, DRAWFLAG_NORMAL);
+
+       if(autocvar_hud_configure_grid)
+       {
+               pos_x = floor((pos_x/vid_conwidth)/hud_configure_gridSize_x + 0.5) * hud_configure_realGridSize_x;
+               pos_y = floor((pos_y/vid_conheight)/hud_configure_gridSize_y + 0.5) * hud_configure_realGridSize_y;
+       }
+
+       if(hud_configure_checkcollisions)
+               pos = HUD_Panel_CheckMove(pos, mySize);
+
+       pos_x = bound(0, pos_x, vid_conwidth - mySize_x);
+       pos_y = bound(0, pos_y, vid_conheight - mySize_y);
+
+       string s;
+       s = strcat(ftos(pos_x/vid_conwidth), " ", ftos(pos_y/vid_conheight));
+
+       HUD_Panel_GetName(highlightedPanel);
+       cvar_set(strcat("hud_panel_", panel_name, "_pos"), s);
+}
+
+// check if resize will result in panel being moved into another panel. If so, return snapped vector, otherwise return the given vector
+vector HUD_Panel_CheckResize(vector mySize, vector resizeorigin) {
+       float i;
+
+       vector targEndPos;
+
+       float dist_x, dist_y;
+       float ratio;
+       ratio = mySize_x/mySize_y;
+
+       for (i = 0; i < HUD_PANEL_NUM; ++i) {
+               if(i == highlightedPanel || !panel_enabled)
+                       continue;
+
+               HUD_Panel_UpdatePosSizeForId(i);
+
+               panel_pos -= '1 1 0' * panel_bg_border;
+               panel_size += '2 2 0' * panel_bg_border;
+
+               targEndPos = panel_pos + panel_size;
+
+               // resizeorigin is WITHIN target panel, just abort any collision testing against that particular panel to produce expected behaviour!
+               if(resizeorigin_x > panel_pos_x && resizeorigin_x < targEndPos_x && resizeorigin_y > panel_pos_y && resizeorigin_y < targEndPos_y)
+                       continue;
+
+               if (resizeCorner == 1)
+               {
+                       // check if this panel is on our way
+                       if (resizeorigin_x <= panel_pos_x)
+                               continue;
+                       if (resizeorigin_y <= panel_pos_y)
+                               continue;
+                       if (targEndPos_x <= resizeorigin_x - mySize_x)
+                               continue;
+                       if (targEndPos_y <= resizeorigin_y - mySize_y)
+                               continue;
+
+                       // there is a collision:
+                       // detect which side of the panel we are facing is actually limiting the resizing
+                       // (which side the resize direction finds for first) and reduce the size up to there
+                       //
+                       // dist is the distance between resizeorigin and the "analogous" point of the panel
+                       // in this case between resizeorigin (bottom-right point) and the bottom-right point of the panel
+                       dist_x = resizeorigin_x - targEndPos_x;
+                       dist_y = resizeorigin_y - targEndPos_y;
+                       if (dist_y <= 0 || dist_x / dist_y > ratio)
+                               mySize_x = min(mySize_x, dist_x);
+                       else
+                               mySize_y = min(mySize_y, dist_y);
+               }
+               else if (resizeCorner == 2)
+               {
+                       if (resizeorigin_x >= targEndPos_x)
+                               continue;
+                       if (resizeorigin_y <= panel_pos_y)
+                               continue;
+                       if (panel_pos_x >= resizeorigin_x + mySize_x)
+                               continue;
+                       if (targEndPos_y <= resizeorigin_y - mySize_y)
+                               continue;
+
+                       dist_x = panel_pos_x - resizeorigin_x;
+                       dist_y = resizeorigin_y - targEndPos_y;
+                       if (dist_y <= 0 || dist_x / dist_y > ratio)
+                               mySize_x = min(mySize_x, dist_x);
+                       else
+                               mySize_y = min(mySize_y, dist_y);
+               }
+               else if (resizeCorner == 3)
+               {
+                       if (resizeorigin_x <= panel_pos_x)
+                               continue;
+                       if (resizeorigin_y >= targEndPos_y)
+                               continue;
+                       if (targEndPos_x <= resizeorigin_x - mySize_x)
+                               continue;
+                       if (panel_pos_y >= resizeorigin_y + mySize_y)
+                               continue;
+
+                       dist_x = resizeorigin_x - targEndPos_x;
+                       dist_y = panel_pos_y - resizeorigin_y;
+                       if (dist_y <= 0 || dist_x / dist_y > ratio)
+                               mySize_x = min(mySize_x, dist_x);
+                       else
+                               mySize_y = min(mySize_y, dist_y);
+               }
+               else if (resizeCorner == 4)
+               {
+                       if (resizeorigin_x >= targEndPos_x)
+                               continue;
+                       if (resizeorigin_y >= targEndPos_y)
+                               continue;
+                       if (panel_pos_x >= resizeorigin_x + mySize_x)
+                               continue;
+                       if (panel_pos_y >= resizeorigin_y + mySize_y)
+                               continue;
+
+                       dist_x = panel_pos_x - resizeorigin_x;
+                       dist_y = panel_pos_y - resizeorigin_y;
+                       if (dist_y <= 0 || dist_x / dist_y > ratio)
+                               mySize_x = min(mySize_x, dist_x);
+                       else
+                               mySize_y = min(mySize_y, dist_y);
+               }
+               //if(cvar("hud_configure_checkcollisions_debug"))
+                       //drawfill(panel_pos, panel_size, '1 1 0', .3, DRAWFLAG_NORMAL);
+       }
+
+       return mySize;
+}
+
+void HUD_Panel_SetPosSize(vector mySize)
+{
+       HUD_Panel_UpdatePosSizeForId(highlightedPanel);
+       vector resizeorigin;
+       resizeorigin = panel_click_resizeorigin;
+       vector myPos;
+
+       // minimum panel size cap
+       mySize_x = max(0.025 * vid_conwidth, mySize_x);
+       mySize_y = max(0.025 * vid_conheight, mySize_y);
+
+       if(highlightedPanel == HUD_PANEL_CHAT) // some panels have their own restrictions, like the chat panel (which actually only moves the engine chat print around). Looks bad if it's too small.
+       {
+               mySize_x = max(17 * autocvar_con_chatsize, mySize_x);
+               mySize_y = max(2 * autocvar_con_chatsize + 2 * panel_bg_padding, mySize_y);
+       }
+
+       // collision testing|
+       // -----------------+
+
+       // we need to know pos at this stage, but it might still change later if we hit a screen edge/other panel (?)
+       if(resizeCorner == 1) {
+               myPos_x = resizeorigin_x - mySize_x;
+               myPos_y = resizeorigin_y - mySize_y;
+       } else if(resizeCorner == 2) {
+               myPos_x = resizeorigin_x;
+               myPos_y = resizeorigin_y - mySize_y;
+       } else if(resizeCorner == 3) {
+               myPos_x = resizeorigin_x - mySize_x;
+               myPos_y = resizeorigin_y;
+       } else { // resizeCorner == 4
+               myPos_x = resizeorigin_x;
+               myPos_y = resizeorigin_y;
+       }
+
+       // left/top screen edges
+       if(myPos_x < 0)
+               mySize_x = mySize_x + myPos_x;
+       if(myPos_y < 0)
+               mySize_y = mySize_y + myPos_y;
+
+       // bottom/right screen edges
+       if(myPos_x + mySize_x > vid_conwidth)
+               mySize_x = vid_conwidth - myPos_x;
+       if(myPos_y + mySize_y > vid_conheight)
+               mySize_y = vid_conheight - myPos_y;
+
+       //if(cvar("hud_configure_checkcollisions_debug"))
+               //drawfill(myPos, mySize, '1 1 1', .2, DRAWFLAG_NORMAL);
+
+       // before checkresize, otherwise panel can be snapped partially inside another panel or panel aspect ratio can be broken
+       if(autocvar_hud_configure_grid)
+       {
+               mySize_x = floor((mySize_x/vid_conwidth)/hud_configure_gridSize_x + 0.5) * hud_configure_realGridSize_x;
+               mySize_y = floor((mySize_y/vid_conheight)/hud_configure_gridSize_y + 0.5) * hud_configure_realGridSize_y;
+       }
+
+       if(hud_configure_checkcollisions)
+               mySize = HUD_Panel_CheckResize(mySize, resizeorigin);
+
+       // minimum panel size cap, do this once more so we NEVER EVER EVER have a panel smaller than this, JUST IN CASE above code still makes the panel eg negative (impossible to resize back without changing cvars manually then)
+       mySize_x = max(0.025 * vid_conwidth, mySize_x);
+       mySize_y = max(0.025 * vid_conheight, mySize_y);
+
+       // do another pos check, as size might have changed by now
+       if(resizeCorner == 1) {
+               myPos_x = resizeorigin_x - mySize_x;
+               myPos_y = resizeorigin_y - mySize_y;
+       } else if(resizeCorner == 2) {
+               myPos_x = resizeorigin_x;
+               myPos_y = resizeorigin_y - mySize_y;
+       } else if(resizeCorner == 3) {
+               myPos_x = resizeorigin_x - mySize_x;
+               myPos_y = resizeorigin_y;
+       } else { // resizeCorner == 4
+               myPos_x = resizeorigin_x;
+               myPos_y = resizeorigin_y;
+       }
+
+       //if(cvar("hud_configure_checkcollisions_debug"))
+               //drawfill(myPos, mySize, '0 1 0', .3, DRAWFLAG_NORMAL);
+
+       HUD_Panel_GetName(highlightedPanel);
+       string s;
+       s = strcat(ftos(mySize_x/vid_conwidth), " ", ftos(mySize_y/vid_conheight));
+       cvar_set(strcat("hud_panel_", panel_name, "_size"), s);
+
+       s = strcat(ftos(myPos_x/vid_conwidth), " ", ftos(myPos_y/vid_conheight));
+       cvar_set(strcat("hud_panel_", panel_name, "_pos"), s);
+}
+
+float pressed_key_time;
+vector highlightedPanel_initial_pos, highlightedPanel_initial_size;
+void HUD_Panel_Arrow_Action(float nPrimary)
+{
+       if (highlightedPanel == -1)
+               return;
+
+       hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && autocvar_hud_configure_checkcollisions);
+
+       float step;
+       if(autocvar_hud_configure_grid)
+       {
+               if (nPrimary == K_UPARROW || nPrimary == K_DOWNARROW)
+               {
+                       if (hudShiftState & S_SHIFT)
+                               step = hud_configure_realGridSize_y;
+                       else
+                               step = 2 * hud_configure_realGridSize_y;
+               }
+               else
+               {
+                       if (hudShiftState & S_SHIFT)
+                               step = hud_configure_realGridSize_x;
+                       else
+                               step = 2 * hud_configure_realGridSize_x;
+               }
+       }
+       else
+       {
+               if (nPrimary == K_UPARROW || nPrimary == K_DOWNARROW)
+                       step = vid_conheight;
+               else
+                       step = vid_conwidth;
+               if (hudShiftState & S_SHIFT)
+                       step = (step / 256); // more precision
+               else
+                       step = (step / 64) * (1 + 2 * (time - pressed_key_time));
+       }
+
+       HUD_Panel_UpdatePosSizeForId(highlightedPanel);
+
+       highlightedPanel_initial_pos = panel_pos;
+       highlightedPanel_initial_size = panel_size;
+
+       if (hudShiftState & S_ALT) // resize
+       {
+               highlightedAction = 1;
+               if(nPrimary == K_UPARROW)
+                       resizeCorner = 1;
+               else if(nPrimary == K_RIGHTARROW)
+                       resizeCorner = 2;
+               else if(nPrimary == K_LEFTARROW)
+                       resizeCorner = 3;
+               else // if(nPrimary == K_DOWNARROW)
+                       resizeCorner = 4;
+
+               // ctrl+arrow reduces the size, instead of increasing it
+               // Note that ctrl disables collisions check too, but it's fine
+               // since we don't collide with anything reducing the size
+               if (hudShiftState & S_CTRL) {
+                       step = -step;
+                       resizeCorner = 5 - resizeCorner;
+               }
+
+               vector mySize;
+               mySize = panel_size;
+               panel_click_resizeorigin = panel_pos;
+               if(resizeCorner == 1) {
+                       panel_click_resizeorigin += mySize;
+                       mySize_y += step;
+               } else if(resizeCorner == 2) {
+                       panel_click_resizeorigin_y += mySize_y;
+                       mySize_x += step;
+               } else if(resizeCorner == 3) {
+                       panel_click_resizeorigin_x += mySize_x;
+                       mySize_x += step;
+               } else { // resizeCorner == 4
+                       mySize_y += step;
+               }
+               HUD_Panel_SetPosSize(mySize);
+       }
+       else // move
+       {
+               highlightedAction = 2;
+               vector pos;
+               pos = panel_pos;
+               if(nPrimary == K_UPARROW)
+                       pos_y -= step;
+               else if(nPrimary == K_DOWNARROW)
+                       pos_y += step;
+               else if(nPrimary == K_LEFTARROW)
+                       pos_x -= step;
+               else // if(nPrimary == K_RIGHTARROW)
+                       pos_x += step;
+
+               HUD_Panel_SetPos(pos);
+       }
+
+       HUD_Panel_UpdatePosSizeForId(highlightedPanel);
+
+       if (highlightedPanel_initial_pos != panel_pos || highlightedPanel_initial_size != panel_size)
+       {
+               // backup!
+               panel_pos_backup = highlightedPanel_initial_pos;
+               panel_size_backup = highlightedPanel_initial_size;
+               highlightedPanel_backup = highlightedPanel;
+       }
+}
+
+const float S_MOUSE1 = 1;
+const float S_MOUSE2 = 2;
+const float S_MOUSE3 = 4;
+float mouseClicked;
+float prevMouseClicked; // previous state
+float prevMouseClickedTime; // time during previous left mouse click, to check for doubleclicks
+vector prevMouseClickedPos; // pos during previous left mouse click, to check for doubleclicks
+
+void HUD_Panel_EnableMenu();
+float tab_panels[HUD_PANEL_NUM];
+float tab_panel, tab_backward;
+vector tab_panel_pos;
+void HUD_Panel_FirstInDrawQ(float id);
+void reset_tab_panels()
+{
+       int i;
+       for(i = 0; i < HUD_PANEL_NUM; ++i)
+               tab_panels[i] = -1;
+}
+float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
+{
+       string s;
+
+       if(!autocvar__hud_configure)
+               return false;
+
+       // allow console bind to work
+       string con_keys;
+       float keys;
+       con_keys = findkeysforcommand("toggleconsole");
+       keys = tokenize(con_keys);
+
+       float hit_con_bind, i;
+       for (i = 0; i < keys; ++i)
+       {
+               if(nPrimary == stof(argv(i)))
+                       hit_con_bind = 1;
+       }
+
+       if(bInputType == 0) {
+               if(nPrimary == K_ALT) hudShiftState |= S_ALT;
+               if(nPrimary == K_CTRL) hudShiftState |= S_CTRL;
+               if(nPrimary == K_SHIFT) hudShiftState |= S_SHIFT;
+       }
+       else if(bInputType == 1) {
+               if(nPrimary == K_ALT) hudShiftState -= (hudShiftState & S_ALT);
+               if(nPrimary == K_CTRL) hudShiftState -= (hudShiftState & S_CTRL);
+               if(nPrimary == K_SHIFT) hudShiftState -= (hudShiftState & S_SHIFT);
+       }
+
+       if(nPrimary == K_CTRL)
+       {
+               if (bInputType == 1) //ctrl has been released
+               {
+                       if (tab_panel != -1)
+                       {
+                               //switch to selected panel
+                               highlightedPanel = tab_panel;
+                               highlightedAction = 0;
+                               HUD_Panel_FirstInDrawQ(highlightedPanel);
+                       }
+                       tab_panel = -1;
+                       reset_tab_panels();
+               }
+       }
+
+       if(nPrimary == K_MOUSE1)
+       {
+               if(bInputType == 0) // key pressed
+                       mouseClicked |= S_MOUSE1;
+               else if(bInputType == 1) // key released
+                       mouseClicked -= (mouseClicked & S_MOUSE1);
+       }
+       else if(nPrimary == K_MOUSE2)
+       {
+               if(bInputType == 0) // key pressed
+                       mouseClicked |= S_MOUSE2;
+               else if(bInputType == 1) // key released
+                       mouseClicked -= (mouseClicked & S_MOUSE2);
+       }
+       else if(nPrimary == K_ESCAPE)
+       {
+               if (bInputType == 1)
+                       return true;
+               menu_enabled = 1;
+               menu_enabled_time = time;
+               localcmd("menu_showhudexit\n");
+       }
+       else if(nPrimary == K_BACKSPACE && hudShiftState & S_CTRL)
+       {
+               if (bInputType == 1)
+                       return true;
+               if (!menu_enabled)
+                       cvar_set("_hud_configure", "0");
+       }
+       else if(nPrimary == K_TAB && hudShiftState & S_CTRL) // select and highlight another panel
+       {
+               if (bInputType == 1 || mouseClicked)
+                       return true;
+
+               //FIXME: if a panel is highlighted, has the same pos_x and lays in the same level
+               //of other panels then next consecutive ctrl-tab will select the highlighted panel too
+               //(it should only after every other panel of the hud)
+               //It's a minor bug anyway, we can live with it
+
+               float starting_panel;
+               float old_tab_panel = tab_panel;
+               if (tab_panel == -1) //first press of TAB
+               {
+                       if (highlightedPanel != -1)
+                               HUD_Panel_UpdatePosSizeForId(highlightedPanel)
+                       else
+                               panel_pos = '0 0 0';
+                       starting_panel = highlightedPanel; //can be -1, it means no starting panel
+                       tab_panel_pos = panel_pos; //to compute level
+               }
+               else
+               {
+                       if ( ((!tab_backward) && (hudShiftState & S_SHIFT)) || (tab_backward && !(hudShiftState & S_SHIFT)) ) //tab direction changed?
+                               reset_tab_panels();
+                       starting_panel = tab_panel;
+               }
+               tab_backward = (hudShiftState & S_SHIFT);
+
+               float k, level, start_pos_x;
+               vector candidate_pos;
+               const float LEVELS_NUM = 4;
+               const float level_height = vid_conheight / LEVELS_NUM;
+:find_tab_panel
+               level = floor(tab_panel_pos_y / level_height) * level_height; //starting level
+               candidate_pos_x = (!tab_backward) ? vid_conwidth : 0;
+               start_pos_x = tab_panel_pos_x;
+               tab_panel = -1;
+               k=0;
+               while(++k)
+               {
+                       for(i = 0; i < HUD_PANEL_NUM; ++i)
+                       {
+                               if (i == tab_panels[i] || i == starting_panel)
+                                       continue;
+                               HUD_Panel_UpdatePosSizeForId(i)
+                               if (panel_pos_y >= level && (panel_pos_y - level) < level_height)
+                               if (  ( !tab_backward && panel_pos_x >= start_pos_x && (panel_pos_x < candidate_pos_x || (panel_pos_x == candidate_pos_x && panel_pos_y <= candidate_pos_y)) )
+                                       || ( tab_backward && panel_pos_x <= start_pos_x && (panel_pos_x > candidate_pos_x || (panel_pos_x == candidate_pos_x && panel_pos_y >= candidate_pos_y)) )  )
+                               {
+                                       tab_panel = i;
+                                       tab_panel_pos = candidate_pos = panel_pos;
+                               }
+                       }
+                       if (tab_panel != -1)
+                               break;
+                       if (k == LEVELS_NUM) //tab_panel not found
+                       {
+                               reset_tab_panels();
+                               if (old_tab_panel == -2) //this prevents an infinite loop (should not happen normally)
+                               {
+                                       tab_panel = -1;
+                                       return true;
+                               }
+                               starting_panel = old_tab_panel;
+                               old_tab_panel = -2;
+                               goto find_tab_panel; //u must find tab_panel!
+                       }
+                       if (!tab_backward)
+                       {
+                               level = mod(level + level_height, vid_conheight);
+                               start_pos_x = 0;
+                               candidate_pos_x = vid_conwidth;
+                       }
+                       else
+                       {
+                               level = mod(level - level_height, vid_conheight);
+                               start_pos_x = vid_conwidth;
+                               candidate_pos_x = 0;
+                       }
+               }
+
+               tab_panels[tab_panel] = tab_panel;
+       }
+       else if(nPrimary == K_SPACE && hudShiftState & S_CTRL) // enable/disable highlighted panel or dock
+       {
+               if (bInputType == 1 || mouseClicked)
+                       return true;
+
+               if (highlightedPanel != -1)
+               {
+                       HUD_Panel_GetName(highlightedPanel);
+                       cvar_set(strcat("hud_panel_", panel_name), ftos(!(panel_enabled)));
+               }
+               else
+                       cvar_set(strcat("hud_dock"), (autocvar_hud_dock == "") ? "dock" : "");
+       }
+       else if(nPrimary == 'c' && hudShiftState & S_CTRL) // copy highlighted panel size
+       {
+               if (bInputType == 1 || mouseClicked)
+                       return true;
+
+               if (highlightedPanel != -1)
+               {
+                       HUD_Panel_UpdatePosSizeForId(highlightedPanel);
+                       panel_size_copied = panel_size;
+                       highlightedPanel_copied = highlightedPanel;
+               }
+       }
+       else if(nPrimary == 'v' && hudShiftState & S_CTRL) // past copied size on the highlighted panel
+       {
+               if (bInputType == 1 || mouseClicked)
+                       return true;
+
+               if (highlightedPanel_copied == -1 || highlightedPanel == -1)
+                       return true;
+
+               HUD_Panel_UpdatePosSizeForId(highlightedPanel);
+
+               // reduce size if it'd go beyond screen boundaries
+               vector tmp_size = panel_size_copied;
+               if (panel_pos_x + panel_size_copied_x > vid_conwidth)
+                       tmp_size_x = vid_conwidth - panel_pos_x;
+               if (panel_pos_y + panel_size_copied_y > vid_conheight)
+                       tmp_size_y = vid_conheight - panel_pos_y;
+
+               if (panel_size == tmp_size)
+                       return true;
+
+               // backup first!
+               panel_pos_backup = panel_pos;
+               panel_size_backup = panel_size;
+               highlightedPanel_backup = highlightedPanel;
+
+               s = strcat(ftos(tmp_size_x/vid_conwidth), " ", ftos(tmp_size_y/vid_conheight));
+               HUD_Panel_GetName(highlightedPanel);
+               cvar_set(strcat("hud_panel_", panel_name, "_size"), s);
+       }
+       else if(nPrimary == 'z' && hudShiftState & S_CTRL) // undo last action
+       {
+               if (bInputType == 1 || mouseClicked)
+                       return true;
+               //restore previous values
+               if (highlightedPanel_backup != -1)
+               {
+                       HUD_Panel_GetName(highlightedPanel_backup);
+                       s = strcat(ftos(panel_pos_backup_x/vid_conwidth), " ", ftos(panel_pos_backup_y/vid_conheight));
+                       cvar_set(strcat("hud_panel_", panel_name, "_pos"), s);
+                       s = strcat(ftos(panel_size_backup_x/vid_conwidth), " ", ftos(panel_size_backup_y/vid_conheight));
+                       cvar_set(strcat("hud_panel_", panel_name, "_size"), s);
+                       highlightedPanel_backup = -1;
+               }
+       }
+       else if(nPrimary == K_UPARROW || nPrimary == K_DOWNARROW || nPrimary == K_LEFTARROW || nPrimary == K_RIGHTARROW)
+       {
+               if (bInputType == 1)
+               {
+                       pressed_key_time = 0;
+                       return true;
+               }
+               else if (pressed_key_time == 0)
+                       pressed_key_time = time;
+
+               if (!mouseClicked)
+                       HUD_Panel_Arrow_Action(nPrimary); //move or resize panel
+       }
+       else if(nPrimary == K_ENTER || nPrimary == K_SPACE || nPrimary == K_KP_ENTER)
+       {
+               if (bInputType == 1)
+                       return true;
+               if (highlightedPanel != -1)
+                       HUD_Panel_EnableMenu();
+       }
+       else if(hit_con_bind)
+               return false;
+
+       return true;
+}
+
+float HUD_Panel_Check_Mouse_Pos(float allow_move)
+{
+       float i, j, border;
+
+       while(j < HUD_PANEL_NUM)
+       {
+               i = panel_order[j];
+               j += 1;
+
+               HUD_Panel_UpdatePosSizeForId(i);
+
+               border = max(8, panel_bg_border); // FORCED border so a small border size doesn't mean you can't resize
+
+               // move
+               if(allow_move && mousepos_x >= panel_pos_x && mousepos_y >= panel_pos_y && mousepos_x <= panel_pos_x + panel_size_x && mousepos_y <= panel_pos_y + panel_size_y)
+               {
+                       return 1;
+               }
+               // resize from topleft border
+               else if(mousepos_x >= panel_pos_x - border && mousepos_y >= panel_pos_y - border && mousepos_x <= panel_pos_x + 0.5 * panel_size_x && mousepos_y <= panel_pos_y + 0.5 * panel_size_y)
+               {
+                       return 2;
+               }
+               // resize from topright border
+               else if(mousepos_x >= panel_pos_x + 0.5 * panel_size_x && mousepos_y >= panel_pos_y - border && mousepos_x <= panel_pos_x + panel_size_x + border && mousepos_y <= panel_pos_y + 0.5 * panel_size_y)
+               {
+                       return 3;
+               }
+               // resize from bottomleft border
+               else if(mousepos_x >= panel_pos_x - border && mousepos_y >= panel_pos_y + 0.5 * panel_size_y && mousepos_x <= panel_pos_x + 0.5 * panel_size_x && mousepos_y <= panel_pos_y + panel_size_y + border)
+               {
+                       return 3;
+               }
+               // resize from bottomright border
+               else if(mousepos_x >= panel_pos_x + 0.5 * panel_size_x && mousepos_y >= panel_pos_y + 0.5 * panel_size_y && mousepos_x <= panel_pos_x + panel_size_x + border && mousepos_y <= panel_pos_y + panel_size_y + border)
+               {
+                       return 2;
+               }
+       }
+       return 0;
+}
+
+// move a panel to the beginning of the panel order array (which means it gets drawn last, on top of everything else)
+void HUD_Panel_FirstInDrawQ(float id)
+{
+       float i;
+       var float place = -1;
+       // find out where in the array our current id is, save into place
+       for(i = 0; i < HUD_PANEL_NUM; ++i)
+       {
+               if(panel_order[i] == id)
+               {
+                       place = i;
+                       break;
+               }
+       }
+       // place last if we didn't find a place for it yet (probably new panel, or screwed up cvar)
+       if(place == -1)
+               place = HUD_PANEL_NUM - 1;
+
+       // move all ids up by one step in the array until "place"
+       for(i = place; i > 0; --i)
+       {
+               panel_order[i] = panel_order[i-1];
+       }
+       // now save the new top id
+       panel_order[0] = id;
+       
+       // let's save them into the cvar by some strcat trickery
+       string s;
+       for(i = 0; i < HUD_PANEL_NUM; ++i)
+       {
+               s = strcat(s, ftos(panel_order[i]), " ");
+       }
+       cvar_set("_hud_panelorder", s);
+       if(hud_panelorder_prev)
+               strunzone(hud_panelorder_prev);
+       hud_panelorder_prev = strzone(autocvar__hud_panelorder); // prevent HUD_Main from doing useless update, we already updated here
+}
+
+void HUD_Panel_Highlight(float allow_move)
+{
+       float i, j, border;
+
+       while(j < HUD_PANEL_NUM)
+       {
+               i = panel_order[j];
+               j += 1;
+
+               HUD_Panel_UpdatePosSizeForId(i);
+
+               border = max(8, panel_bg_border); // FORCED border so a small border size doesn't mean you can't resize
+
+               // move
+               if(allow_move && mousepos_x >= panel_pos_x && mousepos_y >= panel_pos_y && mousepos_x <= panel_pos_x + panel_size_x && mousepos_y <= panel_pos_y + panel_size_y)
+               {
+                       highlightedPanel = i;
+                       HUD_Panel_FirstInDrawQ(i);
+                       highlightedAction = 1;
+                       panel_click_distance = mousepos - panel_pos;
+                       return;
+               }
+               // resize from topleft border
+               else if(mousepos_x >= panel_pos_x - border && mousepos_y >= panel_pos_y - border && mousepos_x <= panel_pos_x + 0.5 * panel_size_x && mousepos_y <= panel_pos_y + 0.5 * panel_size_y)
+               {
+                       highlightedPanel = i;
+                       HUD_Panel_FirstInDrawQ(i);
+                       highlightedAction = 2;
+                       resizeCorner = 1;
+                       panel_click_distance = mousepos - panel_pos;
+                       panel_click_resizeorigin = panel_pos + panel_size;
+                       return;
+               }
+               // resize from topright border
+               else if(mousepos_x >= panel_pos_x + 0.5 * panel_size_x && mousepos_y >= panel_pos_y - border && mousepos_x <= panel_pos_x + panel_size_x + border && mousepos_y <= panel_pos_y + 0.5 * panel_size_y)
+               {
+                       highlightedPanel = i;
+                       HUD_Panel_FirstInDrawQ(i);
+                       highlightedAction = 2;
+                       resizeCorner = 2;
+                       panel_click_distance_x = panel_size_x - mousepos_x + panel_pos_x;
+                       panel_click_distance_y = mousepos_y - panel_pos_y;
+                       panel_click_resizeorigin = panel_pos + eY * panel_size_y;
+                       return;
+               }
+               // resize from bottomleft border
+               else if(mousepos_x >= panel_pos_x - border && mousepos_y >= panel_pos_y + 0.5 * panel_size_y && mousepos_x <= panel_pos_x + 0.5 * panel_size_x && mousepos_y <= panel_pos_y + panel_size_y + border)
+               {
+                       highlightedPanel = i;
+                       HUD_Panel_FirstInDrawQ(i);
+                       highlightedAction = 2;
+                       resizeCorner = 3;
+                       panel_click_distance_x = mousepos_x - panel_pos_x;
+                       panel_click_distance_y = panel_size_y - mousepos_y + panel_pos_y;
+                       panel_click_resizeorigin = panel_pos + eX * panel_size_x;
+                       return;
+               }
+               // resize from bottomright border
+               else if(mousepos_x >= panel_pos_x + 0.5 * panel_size_x && mousepos_y >= panel_pos_y + 0.5 * panel_size_y && mousepos_x <= panel_pos_x + panel_size_x + border && mousepos_y <= panel_pos_y + panel_size_y + border)
+               {
+                       highlightedPanel = i;
+                       HUD_Panel_FirstInDrawQ(i);
+                       highlightedAction = 2;
+                       resizeCorner = 4;
+                       panel_click_distance = panel_size - mousepos + panel_pos;
+                       panel_click_resizeorigin = panel_pos;
+                       return;
+               }
+       }
+       highlightedPanel = -1;
+       highlightedAction = 0;
+}
+
+void HUD_Panel_EnableMenu()
+{
+       menu_enabled = 2;
+       menu_enabled_time = time;
+       HUD_Panel_GetName(highlightedPanel);
+       localcmd("menu_showhudoptions ", panel_name, "\n");
+}
+float mouse_over_panel;
+void HUD_Panel_Mouse()
+{
+       // TODO: needs better check... is there any float that contains the current state of the menu? _menu_alpha isn't apparently updated the frame the menu gets enabled
+       if (autocvar__menu_alpha == 0 && time - menu_enabled_time > 0.5)
+               menu_enabled = 0;
+
+       /*
+       print("menu_enabled: ", ftos(menu_enabled), "\n");
+       print("Highlighted: ", ftos(highlightedPanel), "\n");
+       print("Menu alpha: ", ftos(autocvar__menu_alpha), "\n");
+       */
+
+       // instantly hide the editor cursor if we open the HUDExit dialog
+       // as hud_fade_alpha doesn't decrease to 0 in this case
+       // TODO: find a way to fade the cursor out even in this case
+       if(menu_enabled == 1 || (menu_enabled == 2 && !hud_fade_alpha))
+               return;
+
+       mousepos = mousepos + getmousepos() * autocvar_menu_mouse_speed;
+
+       mousepos_x = bound(0, mousepos_x, vid_conwidth);
+       mousepos_y = bound(0, mousepos_y, vid_conheight);
+
+       if(mouseClicked)
+       {
+               if(prevMouseClicked == 0)
+               {
+                       if (tab_panel != -1)
+                       {
+                               //stop ctrl-tab selection
+                               tab_panel = -1;
+                               reset_tab_panels();
+                       }
+                       HUD_Panel_Highlight(mouseClicked & S_MOUSE1); // sets highlightedPanel, highlightedAction, panel_click_distance, panel_click_resizeorigin
+                                                                       // and calls HUD_Panel_UpdatePosSizeForId() for the highlighted panel
+                       if (highlightedPanel != -1)
+                       {
+                               highlightedPanel_initial_pos = panel_pos;
+                               highlightedPanel_initial_size = panel_size;
+                       }
+                       // doubleclick check
+                       if ((mouseClicked & S_MOUSE1) && time - prevMouseClickedTime < 0.4 && highlightedPanel != -1 && prevMouseClickedPos == mousepos)
+                       {
+                               mouseClicked = 0; // to prevent spam, I guess.
+                               HUD_Panel_EnableMenu();
+                       }
+                       else
+                       {
+                               if (mouseClicked & S_MOUSE1)
+                               {
+                                       prevMouseClickedTime = time;
+                                       prevMouseClickedPos = mousepos;
+                               }
+                               mouse_over_panel = HUD_Panel_Check_Mouse_Pos(mouseClicked & S_MOUSE1);
+                       }
+               }
+               else
+                       HUD_Panel_UpdatePosSizeForId(highlightedPanel);
+
+               if (highlightedPanel != -1)
+               {
+                       drawfill(panel_pos - '1 1 0' * panel_bg_border, panel_size + '2 2 0' * panel_bg_border, '1 1 1', .1, DRAWFLAG_NORMAL);
+                       if (highlightedPanel_initial_pos != panel_pos || highlightedPanel_initial_size != panel_size)
+                       {
+                               hud_configure_checkcollisions = (!(hudShiftState & S_CTRL) && autocvar_hud_configure_checkcollisions);
+                               // backup!
+                               panel_pos_backup = highlightedPanel_initial_pos;
+                               panel_size_backup = highlightedPanel_initial_size;
+                               highlightedPanel_backup = highlightedPanel;
+                       }
+                       else
+                               // in case the clicked panel is inside another panel and we aren't
+                               // moving it, avoid the immediate "fix" of its position/size
+                               // (often unwanted and hateful) by disabling collisions check
+                               hud_configure_checkcollisions = false;
+               }
+
+               if(highlightedAction == 1)
+                       HUD_Panel_SetPos(mousepos - panel_click_distance);
+               else if(highlightedAction == 2)
+               {
+                       vector mySize;
+                       if(resizeCorner == 1) {
+                               mySize_x = panel_click_resizeorigin_x - (mousepos_x - panel_click_distance_x);
+                               mySize_y = panel_click_resizeorigin_y - (mousepos_y - panel_click_distance_y);
+                       } else if(resizeCorner == 2) {
+                               mySize_x = mousepos_x + panel_click_distance_x - panel_click_resizeorigin_x;
+                               mySize_y = panel_click_distance_y + panel_click_resizeorigin_y - mousepos_y;
+                       } else if(resizeCorner == 3) {
+                               mySize_x = panel_click_resizeorigin_x + panel_click_distance_x - mousepos_x;
+                               mySize_y = mousepos_y + panel_click_distance_y - panel_click_resizeorigin_y;
+                       } else { // resizeCorner == 4
+                               mySize_x = mousepos_x - (panel_click_resizeorigin_x - panel_click_distance_x);
+                               mySize_y = mousepos_y - (panel_click_resizeorigin_y - panel_click_distance_y);
+                       }
+                       HUD_Panel_SetPosSize(mySize);
+               }
+       }
+       else
+       {
+               if(menu_enabled == 2)
+                       mouse_over_panel = 0;
+               else
+                       mouse_over_panel = HUD_Panel_Check_Mouse_Pos(TRUE);
+               if (mouse_over_panel && tab_panel == -1)
+                       drawfill(panel_pos - '1 1 0' * panel_bg_border, panel_size + '2 2 0' * panel_bg_border, '1 1 1', .1, DRAWFLAG_NORMAL);
+       }
+       // draw cursor after performing move/resize to have the panel pos/size updated before mouse_over_panel
+       const vector cursorsize = '32 32 0';
+
+       if(!mouse_over_panel)
+               drawpic(mousepos, strcat("gfx/menu/", autocvar_menu_skin, "/cursor.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
+       else if(mouse_over_panel == 1)
+               drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_move.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
+       else if(mouse_over_panel == 2)
+               drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_resize.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
+       else
+               drawpic(mousepos - cursorsize * 0.5, strcat("gfx/menu/", autocvar_menu_skin, "/cursor_resize2.tga"), cursorsize, '1 1 1', hud_fade_alpha, DRAWFLAG_NORMAL);
+
+       prevMouseClicked = mouseClicked;
+}
+
+const float hlBorderSize = 4;
+const string hlBorder = "gfx/hud/default/border_highlighted";
+const string hlBorder2 = "gfx/hud/default/border_highlighted2";
+void HUD_Panel_HlBorder(float myBorder, vector color, float alpha)
+{
+       drawfill(panel_pos - '1 1 0' * myBorder, panel_size + '2 2 0' * myBorder, '0 0.5 1', .5 * alpha, DRAWFLAG_NORMAL);
+       drawpic_tiled(panel_pos - '1 1 0' * myBorder, hlBorder, '8 1 0' * hlBorderSize, eX * (panel_size_x + 2 * myBorder) + eY * hlBorderSize, color, alpha, DRAWFLAG_NORMAL);
+       drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * (panel_size_y + 2 * myBorder - hlBorderSize), hlBorder, '8 1 0' * hlBorderSize, eX * (panel_size_x + 2 * myBorder) + eY * hlBorderSize, color, alpha, DRAWFLAG_NORMAL);
+       drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * hlBorderSize, hlBorder2, '1 8 0' * hlBorderSize, eY * (panel_size_y + 2 * myBorder - 2 * hlBorderSize) + eX * hlBorderSize, color, alpha, DRAWFLAG_NORMAL);
+       drawpic_tiled(panel_pos - '1 1 0' * myBorder + eY * hlBorderSize + eX * (panel_size_x + 2 * myBorder - hlBorderSize), hlBorder2, '1 8 0' * hlBorderSize, eY * (panel_size_y + 2 * myBorder - 2 * hlBorderSize) + eX * hlBorderSize, color, alpha, DRAWFLAG_NORMAL);
+}
index 1f7460a07b9f528044209661359b3892b20d76a5..af849e18c57c92dce1d1580b3342962b5b23403d 100644 (file)
@@ -122,8 +122,6 @@ float zoomin_effect;
 float warmup_stage;
 
 string getcommandkey(string text, string command);
-float hud_showbinds;
-float hud_showbinds_limit;
 
 string vote_called_vote;
 float ready_waiting;
@@ -164,3 +162,5 @@ float g_balance_grenadelauncher_bouncestop;
 float g_balance_electro_secondary_bouncefactor;
 float g_balance_electro_secondary_bouncestop;
 float g_trueaim_minrange;
+
+entity entcs_receiver[255]; // 255 is the engine limit on maxclients
index 41ecb91efa915673aff7313c425b5c02af0c5b55..d59c75ba8d81629cfc485bea7499a6fe32a9a60a 100644 (file)
@@ -325,34 +325,11 @@ float PreviewExists(string name)
        if(autocvar_cl_readpicture_force)
                return false;
 
-       file = strcat(name, ".tga");
-       f = fopen(file, FILE_READ);
-       if(f >= 0)
-       {
-               fclose(f);
-               return true;
-       }
-       file = strcat(name, ".png");
-       f = fopen(file, FILE_READ);
-       if(f >= 0)
-       {
-               fclose(f);
-               return true;
-       }
-       file = strcat(name, ".jpg");
-       f = fopen(file, FILE_READ);
-       if(f >= 0)
-       {
-               fclose(f);
-               return true;
-       }
-       file = strcat(name, ".pcx");
-       f = fopen(file, FILE_READ);
-       if(f >= 0)
-       {
-               fclose(f);
-               return true;
-       }
+       if (fexists(strcat(name, ".tga"))) return true;
+       if (fexists(strcat(name, ".png"))) return true;
+       if (fexists(strcat(name, ".jpg"))) return true;
+       if (fexists(strcat(name, ".pcx"))) return true;
+
        return false;
 }
 
@@ -375,6 +352,33 @@ string ColorTranslateRGB(string s)
                return s;
 }
 
+string Team_ColorCode(float teamid)
+{
+    if (teamid == COLOR_TEAM1)
+        return "^1";
+    else if (teamid == COLOR_TEAM2)
+        return "^4";
+    else if (teamid == COLOR_TEAM3)
+        return "^3";
+    else if (teamid == COLOR_TEAM4)
+        return "^6";
+    else
+        return "^7";
+}
+
+// decolorizes and team colors the player name when needed
+string playername(string thename, float teamid)
+{
+    string t;
+    if (teamplay)
+    {
+        t = Team_ColorCode(teamid);
+        return strcat(t, strdecolorize(thename));
+    }
+    else
+        return strdecolorize(thename);
+}
+
 float cvar_or(string cv, float v)
 {
        string s;
@@ -454,23 +458,23 @@ void drawpic_tiled(vector pos, string pic, vector sz, vector area, vector color,
 
 // drawpic wrapper to draw an image as large as possible with preserved aspect ratio into a box
 var float _drawpic_imgaspect;
-var float _drawpic_aspect;
 var vector _drawpic_imgsize;
 var vector _drawpic_sz;
-var vector _drawpic_oldsz;
+var float _drawpic_oldsz;
 var string _drawpic_picpath;
 #define drawpic_aspect(pos,pic,mySize,color,alpha,drawflag)\
        do {\
                _drawpic_imgsize = drawgetimagesize(pic);\
                _drawpic_imgaspect = _drawpic_imgsize_x/_drawpic_imgsize_y;\
-               _drawpic_oldsz = _drawpic_sz = mySize;\
-               _drawpic_aspect = _drawpic_sz_x/_drawpic_sz_y;\
-               if(_drawpic_aspect > _drawpic_imgaspect) {\
+               _drawpic_sz = mySize;\
+               if(_drawpic_sz_x/_drawpic_sz_y > _drawpic_imgaspect) {\
+                       _drawpic_oldsz = _drawpic_sz_x;\
                        _drawpic_sz_x = _drawpic_sz_y * _drawpic_imgaspect;\
-                       drawpic(pos + eX * (_drawpic_oldsz_x - _drawpic_sz_x) * 0.5, pic, _drawpic_sz, color, alpha, drawflag);\
+                       drawpic(pos + eX * (_drawpic_oldsz - _drawpic_sz_x) * 0.5, pic, _drawpic_sz, color, alpha, drawflag);\
                } else {\
+                       _drawpic_oldsz = _drawpic_sz_y;\
                        _drawpic_sz_y = _drawpic_sz_x / _drawpic_imgaspect;\
-                       drawpic(pos + eY * (_drawpic_oldsz_y - _drawpic_sz_y) * 0.5, pic, _drawpic_sz, color, alpha, drawflag);\
+                       drawpic(pos + eY * (_drawpic_oldsz - _drawpic_sz_y) * 0.5, pic, _drawpic_sz, color, alpha, drawflag);\
                }\
        } while(0)
 
@@ -509,49 +513,29 @@ void drawpic_aspect_skin_expanding_two(vector position, string pic, vector scale
        drawpic_aspect_skin_expanding(position, pic, scale, rgb, alpha, flag, fadelerp);
        drawpic_skin(position, pic, scale, rgb, alpha * fadelerp, flag);
 }
+#define SET_POS_AND_SZ_Y_ASPECT(allow_colors)\
+       float textaspect, oldsz;\
+       textaspect = stringwidth(text, allow_colors, '1 1 1' * sz_y) / sz_y;\
+       if(sz_x/sz_y > textaspect) {\
+               oldsz = sz_x;\
+               sz_x = sz_y * textaspect;\
+               pos_x += (oldsz - sz_x) * 0.5;\
+       } else {\
+               oldsz = sz_y;\
+               sz_y = sz_x / textaspect; \
+               pos_y += (oldsz - sz_y) * 0.5;\
+       }
 
 // drawstring wrapper to draw a string as large as possible with preserved aspect ratio into a box
 void drawstring_aspect(vector pos, string text, vector sz, vector color, float alpha, float drawflag) {
-       vector textsize;
-       textsize = eX * stringwidth(text, FALSE, '1 1 1' * sz_y) + eY * sz_y;
-
-       float textaspect;
-       textaspect = textsize_x/textsize_y;
-
-       vector oldsz;
-       oldsz = sz;
-       float aspect;
-       aspect = sz_x/sz_y;
-
-       if(aspect > textaspect) {
-               sz_x = sz_y * textaspect;
-               drawstring(pos + eX * (oldsz_x - sz_x) * 0.5, text, '1 1 0' * sz_y, color, alpha, drawflag);
-       } else {
-               sz_y = sz_x / textaspect; 
-               drawstring(pos + eY * (oldsz_y - sz_y) * 0.5, text, '1 1 0' * sz_y, color, alpha, drawflag);
-       }
+       SET_POS_AND_SZ_Y_ASPECT(FALSE)
+       drawstring(pos, text, '1 1 0' * sz_y, color, alpha, drawflag);
 }
 
 // drawstring wrapper to draw a colorcodedstring as large as possible with preserved aspect ratio into a box
 void drawcolorcodedstring_aspect(vector pos, string text, vector sz, float alpha, float drawflag) {
-       vector textsize;
-       textsize = eX * stringwidth(text, TRUE, '1 1 1' * sz_y) + eY * sz_y;
-
-       float textaspect;
-       textaspect = textsize_x/textsize_y;
-
-       vector oldsz;
-       oldsz = sz;
-       float aspect;
-       aspect = sz_x/sz_y;
-
-       if(aspect > textaspect) {
-               sz_x = sz_y * textaspect;
-               drawcolorcodedstring(pos + eX * (oldsz_x - sz_x) * 0.5, text, '1 1 0' * sz_y, alpha, drawflag);
-       } else {
-               sz_y = sz_x / textaspect; 
-               drawcolorcodedstring(pos + eY * (oldsz_y - sz_y) * 0.5, text, '1 1 0' * sz_y, alpha, drawflag);
-       }
+       SET_POS_AND_SZ_Y_ASPECT(TRUE)
+       drawcolorcodedstring(pos, text, '1 1 0' * sz_y, alpha, drawflag);
 }
 
 vector drawfontscale;
@@ -571,24 +555,8 @@ void drawstring_expanding(vector position, string text, vector scale, vector rgb
 
 // drawstring wrapper to draw a string as large as possible with preserved aspect ratio into a box
 void drawstring_aspect_expanding(vector pos, string text, vector sz, vector color, float alpha, float drawflag, float fadelerp) {
-       vector textsize;
-       textsize = eX * stringwidth(text, FALSE, '1 1 1' * sz_y) + eY * sz_y;
-
-       float textaspect;
-       textaspect = textsize_x/textsize_y;
-
-       vector oldsz;
-       oldsz = sz;
-       float aspect;
-       aspect = sz_x/sz_y;
-
-       if(aspect > textaspect) {
-               sz_x = sz_y * textaspect;
-               drawstring_expanding(pos + eX * (oldsz_x - sz_x) * 0.5, text, '1 1 0' * sz_y, color, alpha, drawflag, fadelerp);
-       } else {
-               sz_y = sz_x / textaspect; 
-               drawstring_expanding(pos + eY * (oldsz_y - sz_y) * 0.5, text, '1 1 0' * sz_y, color, alpha, drawflag, fadelerp);
-       }
+       SET_POS_AND_SZ_Y_ASPECT(FALSE)
+       drawstring_expanding(pos, text, '1 1 0' * sz_y, color, alpha, drawflag, fadelerp);
 }
 
 void drawcolorcodedstring_expanding(vector position, string text, vector scale, float alpha, float flag, float fadelerp)
@@ -603,24 +571,8 @@ void drawcolorcodedstring_expanding(vector position, string text, vector scale,
 }
 
 void drawcolorcodedstring_aspect_expanding(vector pos, string text, vector sz, float alpha, float drawflag, float fadelerp) {
-       vector textsize;
-       textsize = eX * stringwidth(text, TRUE, '1 1 1' * sz_y) + eY * sz_y;
-       
-       float textaspect;
-       textaspect = textsize_x/textsize_y;
-
-       vector oldsz;
-       oldsz = sz;
-       float aspect;
-       aspect = sz_x/sz_y;
-
-       if(aspect > textaspect) {
-               sz_x = sz_y * textaspect;
-               drawcolorcodedstring_expanding(pos + eX * (oldsz_x - sz_x) * 0.5, text, '1 1 0' * sz_y, alpha, drawflag, fadelerp);
-       } else {
-               sz_y = sz_x / textaspect; 
-               drawcolorcodedstring_expanding(pos + eY * (oldsz_y - sz_y) * 0.5, text, '1 1 0' * sz_y, alpha, drawflag, fadelerp);
-       }
+       SET_POS_AND_SZ_Y_ASPECT(TRUE)
+       drawcolorcodedstring_expanding(pos, text, '1 1 0' * sz_y, alpha, drawflag, fadelerp);
 }
 
 // this draws the triangles of a model DIRECTLY. Don't expect high performance, really...
@@ -802,3 +754,20 @@ void DrawCircleClippedPic(vector centre, float radius, string pic, float f, vect
                R_EndPolygon();
        }
 }
+
+const vector GETPLAYERORIGIN_ERROR = '1123581321 2357111317 3141592653'; // way out of bounds for anything on the map
+vector getplayerorigin(float pl)
+{
+       string s;
+       entity e;
+
+       s = getplayerkey(pl, "TEMPHACK_origin");
+       if(s != "")
+               return stov(s);
+
+       e = entcs_receiver[pl];
+       if(e)
+               return e.origin;
+
+       return GETPLAYERORIGIN_ERROR;
+}
index 1d6a6e393d59dd6bc450d7b2311702db573204c7..9a17dea35694f9ee005b836f603d65071a2ac7ba 100644 (file)
@@ -156,10 +156,10 @@ float _Movetype_UnstickEntity() // SV_UnstickEntity
                if(!_Movetype_TestEntityPosition('0 0 -1' * i)) goto success;
                if(!_Movetype_TestEntityPosition('0 0 1' * i)) goto success;
        }
-       dprint("Some entity is stuck\n");
+       dprint(sprintf(_("Can't unstick an entity (edict: %d, classname: %s, origin: %s)\n"), num_for_edict(self), self.classname, vtos(self.move_origin)));
        return FALSE;
 :success
-       dprint("Unstuck some entity\n");
+       dprint(sprintf(_("Sucessfully unstuck an entity (edict: %d, classname: %s, origin: %s)\n"), num_for_edict(self), self.classname, vtos(self.move_origin)));
        _Movetype_LinkEdict(TRUE);
        return TRUE;
 }
index e296a477bfbaef96accbd9074f052e6b06a01412..4219eef16447e01372629a917b91c8e853cfcc71 100644 (file)
@@ -29,6 +29,7 @@ movetypes.qh
 prandom.qh
 bgmscript.qh
 noise.qh
+teamplay.qh
 
 main.qh
 
@@ -39,6 +40,7 @@ teamplay.qc
 ctf.qc
 
 teamradar.qc
+hud_config.qc
 hud.qc
 scoreboard.qc
 mapvoting.qc
@@ -58,6 +60,8 @@ tuba.qc
 target_music.qc
 
 //vehicles/spiderbot.qc
+shownames.qh
+shownames.qc
 Main.qc
 View.qc
 interpolate.qc
index 9e0069a7f0155a51fb1428f90a86e5c8498aa7a3..8e024ead5b0c7fdeb36865a802c9378bf55ba7bf 100644 (file)
@@ -923,9 +923,7 @@ float HUD_WouldDrawScoreboard() {
                return 1;
        else if (intermission == 2)
                return 0;
-       else if (getstati(STAT_HEALTH) <= 0 && autocvar_cl_deathscoreboard && gametype != GAME_CTS)
-               return 1;
-       else if (spectatee_status == -1)
+       else if (spectatee_status != -1 && getstati(STAT_HEALTH) <= 0 && autocvar_cl_deathscoreboard && gametype != GAME_CTS)
                return 1;
        else if (scoreboard_showscores_force)
                return 1;
diff --git a/qcsrc/client/shownames.qc b/qcsrc/client/shownames.qc
new file mode 100644 (file)
index 0000000..f69c495
--- /dev/null
@@ -0,0 +1,161 @@
+// self.isactive = player is in range and coordinates/status (health and armor) are up to date
+// self.origin = player origin TODO: should maybe move this so it's the origin of the shownames tag already in SSQC for culling?
+// self.healthvalue
+// self.armorvalue
+// self.sameteam = player is on same team as local client
+//
+const float SHOWNAMES_FADESPEED = 4;
+void Draw_ShowNames()
+{
+    if(!autocvar_hud_shownames)
+        return;
+
+    if(self.sameteam || (!self.sameteam && autocvar_hud_shownames_enemies))
+    {
+        InterpolateOrigin_Do();
+
+        if(!self.sameteam)
+        {
+            traceline(self.origin, view_origin, 1, self);
+
+            /* WIP, why does trace_ent != self not work as intended here?
+            if(autocvar_hud_shownames_enemies != 2) // player has to point at enemy if so
+            {
+                traceline(view_origin, view_origin + view_forward * MAX_SHOT_DISTANCE, MOVETYPE_FLY, world);
+                print("trace_endpos: ", vtos(trace_endpos), " view_origin: ", vtos(view_origin), "\n");
+                if(trace_ent != self)
+                    return;
+            }*/
+        }
+
+        vector o, eo;
+        o = project_3d_to_2d(self.origin);
+        float overlap;
+
+        if(autocvar_hud_shownames_antioverlap)
+        {
+            // fade tag out if another tag that is closer to you overlaps
+            entity e;
+            for(e = world; (e = find(e, classname, "shownames_tag")); )
+            {
+                if(e == self)
+                    continue;
+                eo = project_3d_to_2d(e.origin);
+                if not(eo_z < 0 || eo_x < 0 || eo_y < 0 || eo_x > vid_conwidth || eo_y > vid_conheight)
+                {
+                    eo_z = 0;
+                    if(vlen((eX * o_x + eY * o_y) - eo) < autocvar_hud_shownames_antioverlap_distance && vlen(self.origin - view_origin) > vlen(e.origin - view_origin))
+                    {
+                        overlap = TRUE;
+                        break;
+                    }
+                }
+            }
+        }
+
+        if(!self.sameteam && trace_endpos != view_origin) // out of view, fade out
+            self.alpha = max(0, self.alpha - SHOWNAMES_FADESPEED * frametime);
+        else if(!self.healthvalue) // dead player, fade out slowly
+            self.alpha = max(0, self.alpha - SHOWNAMES_FADESPEED * 0.25 * frametime);
+        else if(overlap) // tag overlap detected, fade out
+            self.alpha = max(0, self.alpha - SHOWNAMES_FADESPEED * frametime);
+        else // fade in
+            self.alpha = min(1, self.alpha + SHOWNAMES_FADESPEED * frametime);
+
+        if(!self.alpha)
+            return;
+
+        float dist;
+        dist = vlen(self.origin - view_origin);
+
+        float a;
+        a = autocvar_hud_shownames_alpha;
+        a *= self.alpha;
+        if(autocvar_hud_shownames_maxdistance)
+        {
+            if(dist >= autocvar_hud_shownames_maxdistance)
+                return;
+            a *= ((autocvar_hud_shownames_maxdistance - autocvar_hud_shownames_mindistance) - max(0, dist - autocvar_hud_shownames_mindistance)) / (autocvar_hud_shownames_maxdistance - autocvar_hud_shownames_mindistance);
+        }
+
+        if(!a)
+            return;
+
+        float resize;
+        resize = 1;
+        if(autocvar_hud_shownames_resize) // limit resize so its never smaller than 0.5... gets unreadable
+            resize = 0.5 + 0.5 * ((autocvar_hud_shownames_maxdistance - autocvar_hud_shownames_mindistance) - max(0, dist - autocvar_hud_shownames_mindistance)) / (autocvar_hud_shownames_maxdistance - autocvar_hud_shownames_mindistance);
+
+        // draw the sprite image
+        if not(o_z < 0 || o_x < 0 || o_y < 0 || o_x > vid_conwidth || o_y > vid_conheight)
+        {
+            o_z = 0;
+
+            vector myPos, mySize;
+            mySize = (eX * autocvar_hud_shownames_aspect + eY) * autocvar_hud_shownames_height;
+            myPos = o - '0.5 0 0' * mySize_x - '0 1 0' * mySize_y;
+
+            // size scaling
+            mySize_x *= resize;
+            mySize_y *= resize;
+
+            myPos_x += 0.5 * (mySize_x / resize - mySize_x);
+            myPos_y += (mySize_y / resize - mySize_y);
+
+            vector iconpos, iconsize; // these determine icon position/size, if any
+            vector namepos; // this is where the origin of the string
+            float namesize; // total area where we can draw the string
+
+            iconpos = myPos;
+
+            if(autocvar_hud_shownames_status && teamplay)
+            {
+                if(self.sameteam)
+                {
+                    iconsize = eX * 2 * mySize_y + eY * mySize_y;
+                    // "ghost" backgrounds
+                    drawpic_aspect_skin(iconpos, "health", '1 1 0' * iconsize_y, '0 0 0', a * 0.5, DRAWFLAG_NORMAL);
+                    drawpic_aspect_skin(iconpos + '0.5 0 0' * iconsize_x, "armor", '1 1 0' * iconsize_y, '0 0 0', a * 0.5, DRAWFLAG_NORMAL);
+
+                    if(self.healthvalue > 0)
+                    {
+                        drawsetcliparea(0, myPos_y + iconsize_y - iconsize_y * min(1, self.healthvalue/autocvar_hud_panel_healtharmor_maxhealth), vid_conwidth, myPos_y + iconsize_y);
+                        drawpic_aspect_skin(iconpos, "health", '1 1 0' * iconsize_y, '1 1 1', a, DRAWFLAG_NORMAL);
+                    }
+
+                    if(self.armorvalue > 0)
+                    {
+                        drawsetcliparea(0, myPos_y + iconsize_y - iconsize_y * min(1, self.armorvalue/autocvar_hud_panel_healtharmor_maxarmor), vid_conwidth, myPos_y + iconsize_y);
+                        drawpic_aspect_skin(iconpos + '0.5 0 0' * iconsize_x, "armor", '1 1 0' * iconsize_y, '1 1 1', a, DRAWFLAG_NORMAL);
+                    }
+                    drawresetcliparea();
+                }
+                else if(autocvar_hud_shownames_status == 2)
+                {
+                    iconsize = eX * 2 * mySize_y + eY * mySize_y;
+                    drawpic_aspect_skin(iconpos, "health_unknown", '1 1 0' * iconsize_y, '0 0 0', a, DRAWFLAG_NORMAL);
+                    drawpic_aspect_skin(iconpos + '0.5 0 0' * iconsize_x, "armor_unknown", '1 1 0' * iconsize_y, '0 0 0', a, DRAWFLAG_NORMAL);
+                }
+            }
+
+            namepos = myPos + eX * 2 * iconsize_y + eY * 0.5 * resize * (autocvar_hud_shownames_height - autocvar_hud_shownames_fontsize);
+            namesize = mySize_x - 2 * iconsize_y;
+
+            string s;
+            s = GetPlayerName(self.the_entnum-1);
+            if((autocvar_hud_shownames_decolorize == 1 && teamplay) || autocvar_hud_shownames_decolorize == 2)
+                s = playername(s, GetPlayerColor(self.the_entnum-1));
+
+            drawfontscale = '1 1 0' * resize;
+            s = textShortenToWidth(s, namesize, '1 1 0' * autocvar_hud_shownames_fontsize, stringwidth_colors);
+
+            float width;
+            width = stringwidth(s, TRUE, '1 1 0' * autocvar_hud_shownames_fontsize);
+
+            if (width != namesize)
+                namepos_x += (namesize - width) / 2;
+            drawcolorcodedstring(namepos, s, '1 1 0' * autocvar_hud_shownames_fontsize, a, DRAWFLAG_NORMAL);
+            drawfontscale = '1 1 0';
+        }
+    }
+}
diff --git a/qcsrc/client/shownames.qh b/qcsrc/client/shownames.qh
new file mode 100644 (file)
index 0000000..a17f31d
--- /dev/null
@@ -0,0 +1,5 @@
+.float healthvalue;
+.float armorvalue;
+.float sameteam;
+.float the_entnum;
+
index 7d5031fb87321beb771bf4f72390a7fd6464e0ed..bc705153ab97fd616137fd31d27dd939589ad9fc 100644 (file)
@@ -1,6 +1,3 @@
-float teamplay;
-float myteam;
-
 float TeamByColor(float color)
 {
        switch(color)
@@ -12,6 +9,17 @@ float TeamByColor(float color)
        default: return 0;
        }
 }
+float ColorByTeam(float i)
+{
+       switch(i)
+       {
+       case 0: return COLOR_TEAM1;
+       case 1: return COLOR_TEAM2;
+       case 2: return COLOR_TEAM3;
+       case 3: return COLOR_TEAM4;
+       default: return COLOR_TEAM1;
+       }
+}
 
 float GetPlayerColorForce(float i)
 {
diff --git a/qcsrc/client/teamplay.qh b/qcsrc/client/teamplay.qh
new file mode 100644 (file)
index 0000000..8335990
--- /dev/null
@@ -0,0 +1,2 @@
+float teamplay;
+float myteam;
index cccce7680b4c352eb5af05e821ac62f04cf31fd8..852b3609243c5961072ac75f5b217ea25733cd9c 100644 (file)
@@ -5,7 +5,6 @@ vector teamradar_size2d; // 2D size
 vector teamradar_extraclip_mins, teamradar_extraclip_maxs; // for non-centered radar display
 float teamradar_size; // 2D scale factor
 float hud_panel_radar_scale; // window size = ...qu
-float hud_panel_radar_nohudhack;
 float v_flipped;
 
 float vlen2d(vector v)
@@ -188,9 +187,6 @@ void teamradar_loadcvars()
        if(!hud_panel_radar_foreground_alpha) hud_panel_radar_foreground_alpha = 0.8 * panel_fg_alpha;
        if(!hud_panel_radar_size_x) hud_panel_radar_size_x = 128;
        if(!hud_panel_radar_size_y) hud_panel_radar_size_y = hud_panel_radar_size_x;
-
-       hud_panel_radar_size_z = 0;
-       hud_panel_radar_nohudhack = 0;
 }
 
 // radar links
index 64dcaa44e1fb25f1fdb12c3c08767d1286632aad..507cff85abcdb2780ee6af7054a6500d5f9f18d6 100644 (file)
@@ -63,6 +63,7 @@ const float TE_CSQC_NOTIFY = 112;
 const float TE_CSQC_WEAPONCOMPLAIN = 113;
 const float TE_CSQC_NEX_SCOPE = 116;
 const float TE_CSQC_MINELAYER_MAXMINES = 117;
+const float TE_CSQC_HAGAR_MAXROCKETS = 118;
 
 const float RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
 const float RACE_NET_CHECKPOINT_CLEAR = 1;
@@ -113,7 +114,8 @@ const float ENT_CLIENT_HOOK = 27;
 const float ENT_CLIENT_LGBEAM = 28;
 const float ENT_CLIENT_GAUNTLET = 29;
 const float ENT_CLIENT_ACCURACY = 30;
-const float ENT_CLIENT_WARPZONE_TELEPORTED = 31;
+const float ENT_CLIENT_SHOWNAMES = 31;
+const float ENT_CLIENT_WARPZONE_TELEPORTED = 32;
 
 const float ENT_CLIENT_TURRET = 40;
 
@@ -318,6 +320,7 @@ const float STAT_NEX_CHARGEPOOL = 53;
 const float STAT_HIT_TIME = 54;
 const float STAT_TYPEHIT_TIME = 55;
 const float STAT_LAYED_MINES = 56;
+const float STAT_HAGAR_LOAD = 57;
 
 // see DP source, quakedef.h
 const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
@@ -355,6 +358,12 @@ const float STAT_PINKALIVE = 103;
 const float STAT_FROZEN = 104;
 const float STAT_REVIVE_PROGRESS = 105;
 
+const float STAT_DOM_TOTAL_PPS = 100;
+const float STAT_DOM_PPS_RED = 101;
+const float STAT_DOM_PPS_BLUE = 102;
+const float STAT_DOM_PPS_PINK = 103;
+const float STAT_DOM_PPS_YELLOW = 104;
+
 //const float STAT_SPIDERBOT_AIM     53 // compressShotOrigin
 //const float STAT_SPIDERBOT_TARGET  54 // compressShotOrigin
 
@@ -627,7 +636,7 @@ float WR_RELOAD         = 9; // (SVQC) does not need to do anything
 float WR_RESETPLAYER    = 10; // (SVQC) does not need to do anything
 float WR_IMPACTEFFECT  = 11; // (CSQC) impact effect
 float WR_SWITCHABLE    = 12; // (CSQC) impact effect
-
+float WR_PLAYERDEATH    = 13; // (SVQC) does not need to do anything
 
 float HUD_PANEL_WEAPONS                = 0;
 float HUD_PANEL_AMMO           = 1;
@@ -644,7 +653,8 @@ float HUD_PANEL_PRESSEDKEYS = 11;
 float HUD_PANEL_CHAT           = 12;
 float HUD_PANEL_ENGINEINFO     = 13;
 float HUD_PANEL_INFOMESSAGES   = 14;
-float HUD_PANEL_NUM            = 15; // always last panel id + 1, please increment when adding a new panel
+float HUD_PANEL_PHYSICS        = 15;
+float HUD_PANEL_NUM            = 16; // always last panel id + 1, please increment when adding a new panel
 
 string HUD_PANELNAME_WEAPONS           = "weapons";
 string HUD_PANELNAME_AMMO              = "ammo";
@@ -661,6 +671,7 @@ string HUD_PANELNAME_PRESSEDKEYS    = "pressedkeys";
 string HUD_PANELNAME_CHAT              = "chat";
 string HUD_PANELNAME_ENGINEINFO                = "engineinfo";
 string HUD_PANELNAME_INFOMESSAGES      = "infomessages";
+string HUD_PANELNAME_PHYSICS   = "physics";
 
 float HUD_MENU_ENABLE          = 0;
 
index 3b93c4cae9fb31e8e003b38d6f9f7cceeced7ddc..518cf74971a645dde3c412c1a1eaabee9b5ae1b8 100644 (file)
@@ -210,10 +210,8 @@ float GameCommand_Generic(string command)
        {
                if(argv(1) == "add" && argc == 3)
                {
-                       f = fopen(strcat("maps/", argv(2), ".bsp"), FILE_READ);
-                       if(f != -1)
-                               fclose(f);
-                       else {
+                       if (!fexists(strcat("maps/", argv(2), ".bsp")))
+                       {
                                print("maplist: ERROR: ", argv(2), " does not exist!\n");
                                return TRUE;
                        }
@@ -771,10 +769,8 @@ float GameCommand_Generic(string command)
                                        s = rpn_pop();
                                        if(!rpn_error)
                                        {
-                                               f = fopen(s, FILE_READ);
-                                               if(f != -1)
-                                                       fclose(f);
-                                               else {
+                                               if (!fexists(s))
+                                               {
                                                        print("rpn: ERROR: ", s, " does not exist!\n");
                                                        rpn_error = TRUE;
                                                }
@@ -783,13 +779,10 @@ float GameCommand_Generic(string command)
                                        s = rpn_get();
                                        if(!rpn_error)
                                        {
-                                               f = fopen(s, FILE_READ);
-                                               if(f != -1) {
-                                                       fclose(f);
+                                               if (fexists(s))
                                                        rpn_setf(1);
-                                               } else {
+                                               else
                                                        rpn_setf(0);
-                                               }
                                        }
                                } else if(rpncmd == "localtime") {
                                        rpn_set(strftime(TRUE, rpn_get()));
index 58f0cc852a6e07383df3dadd8ce1d4e466c5a15a..a6b0788088216c93b53f2a0dfa96aabc5ed5e820 100644 (file)
@@ -875,12 +875,8 @@ float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametype
                                if(MapInfo_Map_supportedGametypes & i)
                                        fputs(fh, sprintf("gametype %s // defaults: %s\n", MapInfo_Type_ToString(i), _MapInfo_GetDefaultEx(i)));
 
-                       fh2 = fopen(strcat("scripts/", pFilename, ".arena"), FILE_READ);
-                       if(fh2 >= 0)
-                       {
-                               fclose(fh2);
+                       if(fexists(strcat("scripts/", pFilename, ".arena")))
                                fputs(fh, "settemp_for_type all sv_q3acompat_machineshotgunswap 1\n");
-                       }
 
                        fputs(fh, "// optional: fog density red green blue alpha mindist maxdist\n");
                        fputs(fh, "// optional: settemp_for_type (all|gametypename) cvarname value\n");
index baf60b5d88156d8f03f91b1e03701eed049a1424..89cb92baf3fce6b4f08d881a208db2f106f67c63 100644 (file)
@@ -236,6 +236,16 @@ string fstrunzone(string s)
        return sc;
 }
 
+float fexists(string f)
+{
+    float fh;
+    fh = fopen(f, FILE_READ);
+    if (fh < 0)
+        return FALSE;
+    fclose(fh);
+    return TRUE;
+}
+
 // Databases (hash tables)
 #define DB_BUCKETS 8192
 void db_save(float db, string pFilename)
index a15855753217765d2396f6ab38f89e127a5060dc..49afad22d7f19bc62f552b8dcdbf3884f7e8654d 100644 (file)
@@ -34,6 +34,8 @@ float median(float a, float b, float c);
 // works for up to 10 decimals!
 string ftos_decimals(float number, float decimals);
 
+float fexists(string f);
+
 vector colormapPaletteColor(float c, float isPants);
 
 // unzone the string, and return it as tempstring. Safe to be called on string_null
@@ -219,6 +221,7 @@ float get_model_parameters(string mod, float skn); // call with string_null to c
 switch(id) {\
        case HUD_PANEL_ENGINEINFO: panel_name = HUD_PANELNAME_ENGINEINFO; break; \
        case HUD_PANEL_INFOMESSAGES: panel_name = HUD_PANELNAME_INFOMESSAGES; break; \
+       case HUD_PANEL_PHYSICS: panel_name = HUD_PANELNAME_PHYSICS; break; \
 } ENDS_WITH_CURLY_BRACE
 
 // Get name of specified panel id
@@ -237,8 +240,8 @@ switch(id) { \
        case HUD_PANEL_MODICONS: panel_name = HUD_PANELNAME_MODICONS; break; \
        case HUD_PANEL_PRESSEDKEYS: panel_name = HUD_PANELNAME_PRESSEDKEYS; break; \
        case HUD_PANEL_CHAT: panel_name = HUD_PANELNAME_CHAT; break; \
-}\
-HUD_Panel_GetName_Part2(id)
+    default: HUD_Panel_GetName_Part2(id)\
+}
 
 vector vec2(vector v);
 
index b85546569a862e7c6d163d98833bd9a168ee53be..61f5a4877d27bbf506a949372e6520d4239b40cc 100644 (file)
 #include "xonotic/dialog_hudpanel_engineinfo.c"
 #include "xonotic/dialog_hudpanel_infomessages.c"
 #include "xonotic/dialog_hudpanel_weapons.c"
+#include "xonotic/dialog_hudpanel_physics.c"
 #include "xonotic/slider_picmip.c"
index 800a12681e4eb3d8b95ba4c0206baf1691cf5f3a..da6a4013cecd772051b12c76aac0f0a74a681a1c 100644 (file)
@@ -152,7 +152,7 @@ void Dialog_configureDialog(entity me)
 
        me.fill(me);
 
-       if(me.closable)
+       if(me.closable && me.borderLines > 0)
        {
                closebutton = me.closeButton = spawnButton();
                closebutton.configureButton(closebutton, "", 0, me.closeButtonImage);
index 299ea09fd7dc690b49584b108e570824cabfdff7..07257696436525b2bbc90cfc84561731da15f1ec 100644 (file)
@@ -19,14 +19,14 @@ void XonoticHUDAmmoDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Ammunition display:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Ammunition display:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_ammo_onlycurrent", _("Show only current ammo type")));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_ammo_onlycurrent", _("Show only current ammo type")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Align icon:"));
-                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_ammo_iconalign", "0", _("Left")));
-                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_ammo_iconalign", "1", _("Right")));
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Align icon:")));
+                       me.TD(me, 1, 2.4/2, e = makeXonoticRadioButton(2, "hud_panel_ammo_iconalign", "0", _("Left")));
+                       me.TD(me, 1, 2.4/2, e = makeXonoticRadioButton(2, "hud_panel_ammo_iconalign", "1", _("Right")));
 }
 #endif
index 331b0ee9ae265e0fe29b67f27f316f00f9cedce2..ba3f0d0090ec31755414b5991dbc0ed75f808550 100644 (file)
@@ -30,6 +30,6 @@ void XonoticHUDChatDialog_fill(entity me)
                me.TD(me, 1, 2.6, e = makeXonoticSlider(5, 60, 5, "con_chattime"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "con_chatsound", _("Chat beep sound")));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "con_chatsound", _("Chat beep sound")));
 }
 #endif
index b69a5869e79993603011a0646df5bb17cfa92b7c..b3cc7b423a4eec2fabb41eb12663a5d79453fa37 100644 (file)
@@ -19,9 +19,9 @@ void XonoticHUDEngineInfoDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Engine info:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Engine info:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_engineinfo_framecounter_exponentialmovingaverage", _("Use an averaging algorithm for fps")));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_engineinfo_framecounter_exponentialmovingaverage", _("Use an averaging algorithm for fps")));
 }
 #endif
index 91da57cdfae8da55427c3dd189f5aed28b731505..5eaf1d94059cd47d99972421f5c58ae18c3d42e2 100644 (file)
@@ -19,9 +19,9 @@ void XonoticHUDHealthArmorDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_progressbar", _("Enable status bar")));
+               me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_progressbar", _("Enable status bar")));
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Status bar alignment:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Status bar alignment:")));
                        setDependent(e, "hud_panel_healtharmor_progressbar", 1, 1);
        me.TR(me);
                me.TDempty(me, 0.2);
@@ -29,19 +29,19 @@ void XonoticHUDHealthArmorDialog_fill(entity me)
                        setDependent(e, "hud_panel_healtharmor_progressbar", 1, 1);
                        me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "1", _("Right")));
                        setDependent(e, "hud_panel_healtharmor_progressbar", 1, 1);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "3", _("Inward")));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "2", _("Inward")));
                        setDependent(e, "hud_panel_healtharmor_progressbar", 1, 1);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "4", _("Outward")));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "3", _("Outward")));
                        setDependent(e, "hud_panel_healtharmor_progressbar", 1, 1);
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Icon alignment:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Icon alignment:")));
        me.TR(me);
                me.TDempty(me, 0.2);
                        me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "0", _("Left")));
                        me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "1", _("Right")));
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "3", _("Inward")));
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "4", _("Outward")));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "2", _("Inward")));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_healtharmor_iconalign", "3", _("Outward")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_flip", _("Flip health and armor positions")));
+               me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_flip", _("Flip health and armor positions")));
 }
 #endif
index 44b20294b7cc801eac215b0fd9421ab85702319c..da63a1e163af6ca130d3fe9a455f89ed631b09d8 100644 (file)
@@ -19,9 +19,9 @@ void XonoticHUDInfoMessagesDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Info messages:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Info messages:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_infomessages_flip", _("Flip align")));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_infomessages_flip", _("Flip align")));
 }
 #endif
index 1f26ab34aa92e3f909cc71a223dddc462e1d8be8..936a0fcb5983ddac9e97f65325b59872caaf47f8 100644 (file)
@@ -19,13 +19,13 @@ void XonoticHUDNotificationDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Notifications:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Notifications:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_notify_print", _("Also print notifications to the console")));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_notify_print", _("Also print notifications to the console")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_notify_flip", _("Flip notify order")));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_notify_flip", _("Flip notify order")));
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Entry lifetime:")));
diff --git a/qcsrc/menu/xonotic/dialog_hudpanel_physics.c b/qcsrc/menu/xonotic/dialog_hudpanel_physics.c
new file mode 100644 (file)
index 0000000..66c872b
--- /dev/null
@@ -0,0 +1,82 @@
+#ifdef INTERFACE
+CLASS(XonoticHUDPhysicsDialog) EXTENDS(XonoticRootDialog)
+       METHOD(XonoticHUDPhysicsDialog, fill, void(entity))
+       ATTRIB(XonoticHUDPhysicsDialog, title, string, _("Physics Panel"))
+       ATTRIB(XonoticHUDPhysicsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
+       ATTRIB(XonoticHUDPhysicsDialog, intendedWidth, float, 0.4)
+       ATTRIB(XonoticHUDPhysicsDialog, rows, float, 15)
+       ATTRIB(XonoticHUDPhysicsDialog, columns, float, 4)
+       ATTRIB(XonoticHUDPhysicsDialog, name, string, "HUDphysics")
+       ATTRIB(XonoticHUDPhysicsDialog, sliderTopspeedTime, entity, NULL)
+ENDCLASS(XonoticHUDPhysicsDialog)
+#endif
+
+#ifdef IMPLEMENTATION
+void XonoticHUDPhysicsDialog_fill(entity me)
+{
+       entity e;
+       string panelname = "physics";
+       float i;
+
+       me.TR(me);
+               me.TD(me, 1, 4, e = makeXonoticTextSlider("hud_panel_physics"));
+                       e.addValue(e, _("Panel disabled"), "0");
+                       e.addValue(e, _("Panel enabled if not observing"), "1");
+                       e.addValue(e, _("Panel always enabled"), "2");
+                       e.configureXonoticTextSliderValues(e);
+
+       DIALOG_HUDPANEL_COMMON_NOTOGGLE();
+
+       me.TR(me);
+               me.TD(me, 1, 1.4, e = makeXonoticCheckBox(0, "hud_panel_physics_progressbar", _("Status bar")));
+               me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_physics_baralign"));
+                       e.addValue(e, _("Left align")   , "0");
+                       e.addValue(e, _("Right align")  , "1");
+                       e.addValue(e, _("Inward align") , "2");
+                       e.addValue(e, _("Outward align"), "3");
+                       e.configureXonoticTextSliderValues(e);
+                       setDependent(e, "hud_panel_physics_progressbar", 1, 3);
+       me.TR(me);
+               me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_physics_flip", _("Flip speed/acceleration positions")));
+
+//speed
+       me.TR(me);
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Speed:")));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_physics_speed_vertical", _("Include vertical speed")));
+       // me.TR(me);
+               // me.TDempty(me, 0.2);
+               // me.TD(me, 1, 1.8, e = makeXonoticTextLabel(0, _("Full status bar at:")));
+                       // setDependent(e, "hud_panel_physics_progressbar", 1, 1);
+               // me.TD(me, 1, 1, e = makeXonoticInputBox(1, "hud_panel_physics_speed_max"));
+                       // setDependent(e, "hud_panel_physics_progressbar", 1, 1);
+               // me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("qu/s")));
+                       // setDependent(e, "hud_panel_physics_progressbar", 1, 1);
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Speed unit:")));
+               me.TD(me, 1, 2.6/3*2, e = makeXonoticTextSlider("hud_panel_physics_speed_unit"));
+                       e.addValue(e, _("qu/s") , "1");
+                       e.addValue(e, _("m/s")  , "2");
+                       e.addValue(e, _("km/h") , "3");
+                       e.addValue(e, _("mph")  , "4");
+                       e.addValue(e, _("knots"), "5");
+                       e.configureXonoticTextSliderValues(e);
+               me.TD(me, 1, 2.6/3, e = makeXonoticCheckBox(0, "hud_panel_physics_speed_unit_show", _("Show")));
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 3.8/2, e = makeXonoticCheckBox(0, "hud_panel_physics_topspeed", _("Top speed")));
+               me.TD(me, 1, 3.8/2, e = makeXonoticSlider(1, 10, 1, "hud_panel_physics_topspeed_time"));
+                       setDependent(e, "hud_panel_physics_topspeed", 1, 1);
+
+//acceleration
+       me.TR(me);
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Acceleration:")));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_physics_acceleration_vertical", _("Include vertical acceleration")));
+       // me.TR(me);
+               // me.TDempty(me, 0.2);
+               // me.TD(me, 1, 1.8, e = makeXonoticTextLabel(0, _("Full status bar at:")));
+                       // setDependent(e, "hud_panel_physics_progressbar", 1, 1);
+               // me.TD(me, 1, 0.6, e = makeXonoticInputBox(1, "hud_panel_physics_acceleration_max"));
+                       // setDependent(e, "hud_panel_physics_progressbar", 1, 1);
+}
+#endif
index e63e785528f0ef10de774a51eb6a364c9d41f2fc..abab5d1f0d07758cc3e00f3c1f647f5d00354bd3 100644 (file)
@@ -19,9 +19,9 @@ void XonoticHUDPowerupsDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_powerups_progressbar", _("Enable status bar")));
+               me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_powerups_progressbar", _("Enable status bar")));
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Status bar alignment:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Status bar alignment:")));
                        setDependent(e, "hud_panel_powerups_progressbar", 1, 1);
        me.TR(me);
                me.TDempty(me, 0.2);
@@ -29,19 +29,19 @@ void XonoticHUDPowerupsDialog_fill(entity me)
                        setDependent(e, "hud_panel_powerups_progressbar", 1, 1);
                        me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "1", _("Right")));
                        setDependent(e, "hud_panel_powerups_progressbar", 1, 1);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "3", _("Inward")));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "2", _("Inward")));
                        setDependent(e, "hud_panel_powerups_progressbar", 1, 1);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "4", _("Outward")));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "3", _("Outward")));
                        setDependent(e, "hud_panel_powerups_progressbar", 1, 1);
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Icon alignment:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Icon alignment:")));
        me.TR(me);
                me.TDempty(me, 0.2);
                        me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "0", _("Left")));
                        me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "1", _("Right")));
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "3", _("Inward")));
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "4", _("Outward")));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "2", _("Inward")));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(3, "hud_panel_powerups_iconalign", "3", _("Outward")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_powerups_flip", _("Flip strength and shield positions")));
+               me.TD(me, 1, 4, e = makeXonoticCheckBox(0, "hud_panel_powerups_flip", _("Flip strength and shield positions")));
 }
 #endif
index 479c2bb333956c0cfaf275017e27dfd8b690f14e..3e72acc8b0ee737558ee8319bf7b14f56e8dbecf 100644 (file)
@@ -26,7 +26,7 @@ void XonoticHUDRadarDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON_NOTOGGLE();
 
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Radar:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Radar:")));
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:")));
index ccb8d9528bed1807833c8acaa8f0d2124e34b3d2..778172aa1404f8a68ed5a6d582248021d683a193 100644 (file)
@@ -17,5 +17,14 @@ void XonoticHUDScoreDialog_fill(entity me)
        string panelname = "score";
 
        DIALOG_HUDPANEL_COMMON();
+
+       me.TR(me);
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Score:")));
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Rankings:")));
+               me.TD(me, 1, 2.6/3, e = makeXonoticRadioButton(1, "hud_panel_score_rankings", "0", _("Off")));
+               me.TD(me, 1, 2.6/3, e = makeXonoticRadioButton(1, "hud_panel_score_rankings", "1", _("And me")));
+               me.TD(me, 1, 2.6/3, e = makeXonoticRadioButton(1, "hud_panel_score_rankings", "2", _("Pure")));
 }
 #endif
index 5f2fc5dd747b63cf8d73589ecc90b377c59fae7f..c1e9626dd983618f188d83a9b952601ace69e905 100644 (file)
@@ -19,9 +19,9 @@ void XonoticHUDTimerDialog_fill(entity me)
        DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Timer:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Timer:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_timer_increment", _("Show elapsed time")));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(0, "hud_panel_timer_increment", _("Show elapsed time")));
 }
 #endif
index d3d35c22a45b19a2cd975509e43f74f5f8ee470e..0b2c0ac07836656411e488b57797bdc7dad91bc9 100644 (file)
@@ -20,6 +20,6 @@ void XonoticHUDVoteDialog_fill(entity me)
 
        me.TR(me);
                me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Alpha after voting:")));
-                       me.TD(me, 1, 2.6, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_vote_alreadyvoted_alpha"));
+               me.TD(me, 1, 2.6, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_vote_alreadyvoted_alpha"));
 }
 #endif
index 394ec332385df0807d9b86146209cbffa8ec293e..d0daa678422237378b21adc71800766c0627e481 100644 (file)
@@ -29,15 +29,17 @@ void XonoticHUDWeaponsDialog_fill(entity me)
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Fade effect:")));
-               me.TD(me, 1, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "0", ZCTX(_("EF^None"))));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
-               me.TD(me, 1, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "1", _("Slide")));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
-               me.TD(me, 1, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "2", _("Alpha")));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Fade effect:")));
+               setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
+                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_timeout_effect"))));
+                               e.addValue(e, ZCTX(_("EF^None")),  "0");
+                               e.addValue(e, _("Slide"), "1");
+                               e.addValue(e, _("Alpha"), "2");
+                               e.addValue(e, ZCTX(_("EF^Both")),  "3");
+                               e.configureXonoticTextSliderValues(e);
                        setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_timeout")), "0");
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Weapon icons:")));
+               me.TD(me, 1, 4, e = makeXonoticTextLabel(0, _("Weapon icons:")));
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Show weapon ID as:")));
@@ -46,8 +48,8 @@ void XonoticHUDWeaponsDialog_fill(entity me)
                        me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "2", _("Bind")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_weapons_accuracy", _("Show Accuracy")));
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "hud_panel_weapons_ammo", _("Show Ammo")));
+               me.TD(me, 1, 3.8/2, e = makeXonoticCheckBox(0, "hud_panel_weapons_accuracy", _("Show Accuracy")));
+               me.TD(me, 1, 3.8/2, e = makeXonoticCheckBox(0, "hud_panel_weapons_ammo", _("Show Ammo")));
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Ammo bar color:")));
@@ -57,7 +59,7 @@ void XonoticHUDWeaponsDialog_fill(entity me)
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Ammo bar alpha:")));
-                       me.TD(me, 1, 2.6, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_weapons_ammo_alpha"));
+                       me.TD(me, 1, 2.4, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_weapons_ammo_alpha"));
                        setDependent(e, "hud_panel_weapons_ammo", 1, 1);
 }
 #endif
index e449fa5d4814a77b2cd9a933c0779a4ff48b6027..540e85e4f69ef1a9867be4115dca4e11f998e9f0 100644 (file)
@@ -20,7 +20,7 @@ void XonoticHUDExitDialog_fill(entity me)
        me.TR(me);
                me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Panel background defaults:")));
        me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Background:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_bg"))));
                                e.addValue(e, _("Disable"), "0");
                                e.addValue(e, "border_default", "border_default"); // this is a file name!
index 7fa3dc66b329ce71fe66889df08def1fa20fcae7..72af4dce144b4e9c6d00e5a42f5d6ce5ec737c06 100644 (file)
@@ -49,33 +49,6 @@ void XonoticMiscSettingsTab_fill(entity me)
                me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "showdate", _("Show current date")));
        me.TR(me);
                me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "showfps", _("Show frames per second")));
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_showspeed", _("Speedometer")));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 2.8/3, e = makeXonoticRadioButton(1, "cl_showspeed_unit", "0", _("qu/s (hidden)")));
-                       setDependent(e, "cl_showspeed", 1, 1);
-               me.TD(me, 1, 2.8/3, e = makeXonoticRadioButton(1, "cl_showspeed_unit", "1", _("qu/s")));
-                       setDependent(e, "cl_showspeed", 1, 1);
-               me.TD(me, 1, 2.8/3, e = makeXonoticRadioButton(1, "cl_showspeed_unit", "2", _("m/s")));
-                       setDependent(e, "cl_showspeed", 1, 1);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 2.8/3, e = makeXonoticRadioButton(1, "cl_showspeed_unit", "3", _("km/h")));
-                       setDependent(e, "cl_showspeed", 1, 1);
-               me.TD(me, 1, 2.8/3, e = makeXonoticRadioButton(1, "cl_showspeed_unit", "4", _("mph")));
-                       setDependent(e, "cl_showspeed", 1, 1);
-               me.TD(me, 1, 2.8/3, e = makeXonoticRadioButton(1, "cl_showspeed_unit", "5", _("knots")));
-                       setDependent(e, "cl_showspeed", 1, 1);
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_showacceleration", _("Show accelerometer")));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 2.8/2, e = makeXonoticTextLabel(0, _("Accelerometer scale:")));
-                       setDependent(e, "cl_showacceleration", 1, 1);
-               me.TD(me, 1, 2.8/2, e = makeXonoticSlider(0.2, 2, 0.2, "cl_showacceleration_scale"));
-                       setDependent(e, "cl_showacceleration", 1, 1);
-       me.TR(me);
        me.TR(me);
                me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_maxfps_alwayssleep", _("Minimize input latency")));
        me.TR(me);
index bd15150a8cfb59ac1ec45e390a5b9c4a831cf801..feec5a9b92595baa6cbbdc808ae926a3ea3a2793 100644 (file)
@@ -114,6 +114,10 @@ void MainWindow_configureMainWindow(entity me)
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
 
+       i = spawnXonoticHUDPhysicsDialog();
+       i.configureDialog(i);
+       me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
+
        me.advancedDialog = i = spawnXonoticAdvancedDialog();
        i.configureDialog(i);
        me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
index 4a9255a47cbfb10162c57ddaf31c75f9ff3db250..8544276bb2a73cdc50bd580d15a5a34e28550f92 100644 (file)
@@ -464,25 +464,13 @@ string resolvemod(string m)
                return m;
 }
 
-string HUD_Panel_GetSettingName(float theSetting)
-{
-       switch(theSetting) {
-               case HUD_MENU_ENABLE: return ""; break;
-               default: return "";
-       }
-}
-
 float updateCompression()
 {
-       float fh;
        float have_dds, have_jpg, have_tga;
        float can_dds;
-       if((have_dds = ((fh = fopen("dds/particles/particlefont.dds", FILE_READ)) >= 0)))
-               fclose(fh);
-       if((have_jpg = ((fh = fopen("particles/particlefont.jpg", FILE_READ)) >= 0)))
-               fclose(fh);
-       if((have_tga = ((fh = fopen("particles/particlefont.tga", FILE_READ)) >= 0)))
-               fclose(fh);
+       have_dds = (fexists("dds/particles/particlefont.dds"));
+       have_dds = (fexists("particles/particlefont.jpg"));
+       have_dds = (fexists("particles/particlefont.tga"));
        can_dds = GL_Have_TextureCompression();
        if(have_dds && (have_jpg || have_tga))
        {
index 0d31f0150a6208b0ec1a3e33e8e67b36297b753d..5962b9648ccc74ff091132952af3956ad0681fcf 100644 (file)
@@ -22,8 +22,6 @@ string getZonedTooltipForIdentifier(string s);
 
 string resolvemod(string m);
 
-string HUD_Panel_GetSettingName(float setting);
-
 float URI_GET_DISCARD = 0;
 
 float URI_GET_UPDATENOTIFICATION = 1;
index 5110d373b8a682e657e1a5f10201c2c91303dbba..a58ccb2a54dbb3061519b37ef40c60ba92ad6609 100644 (file)
@@ -328,7 +328,7 @@ void count_alive_players()
                                totalalive += 1;
                        }
                }
-               FOR_EACH_PLAYER(self) {
+               FOR_EACH_REALCLIENT(self) {
                        self.redalive_stat = redalive;
                        self.bluealive_stat = bluealive;
                }
@@ -358,7 +358,7 @@ void count_alive_players()
                                totalalive += 1;
                        }
                }
-               FOR_EACH_PLAYER(self) {
+               FOR_EACH_REALCLIENT(self) {
                        self.redalive_stat = redalive;
                        self.bluealive_stat = bluealive;
                        self.yellowalive_stat = yellowalive;
index 4d8083fe779f7a1865af178f492fcf110aaf0bcc..70719e0d7c9f03e09f3c24c16634b251db7074b5 100644 (file)
@@ -321,6 +321,12 @@ float autocvar_g_balance_hagar_primary_radius;
 float autocvar_g_balance_hagar_primary_refire;
 float autocvar_g_balance_hagar_primary_speed;
 float autocvar_g_balance_hagar_secondary;
+float autocvar_g_balance_hagar_secondary_load;
+float autocvar_g_balance_hagar_secondary_load_speed;
+float autocvar_g_balance_hagar_secondary_load_max;
+float autocvar_g_balance_hagar_secondary_load_hold;
+float autocvar_g_balance_hagar_secondary_load_releasedeath;
+float autocvar_g_balance_hagar_secondary_load_abort;
 float autocvar_g_balance_hagar_secondary_ammo;
 float autocvar_g_balance_hagar_secondary_damage;
 float autocvar_g_balance_hagar_secondary_edgedamage;
@@ -1238,3 +1244,4 @@ float autocvar_waypoint_benchmark;
 float autocvar_welcome_message_time;
 float autocvar_sv_gameplayfix_gravityunaffectedbyticrate;
 float autocvar_g_trueaim_minrange;
+float autocvar_sv_shownames_cull_distance;
index 71e2dd401fc236cacb4ad5e5ed8e6d765aded0c6..c88ffc3ab2790aed490c16441df03992186c6765 100644 (file)
@@ -1079,6 +1079,7 @@ void PutClientInServer (void)
                        if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
                                self.weapon_load[j] = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
                }
+               self.weapon_forbidchange = FALSE;
 
                oldself = self;
                self = spot;
@@ -1136,6 +1137,7 @@ float ClientInit_SendEntity(entity to, float sf)
        WriteByte(MSG_ENTITY, autocvar_g_balance_sniperrifle_secondary); // client has to know if it should zoom or not
        WriteByte(MSG_ENTITY, serverflags); // client has to know if it should zoom or not
        WriteByte(MSG_ENTITY, autocvar_g_balance_minelayer_limit); // minelayer max mines
+       WriteByte(MSG_ENTITY, autocvar_g_balance_hagar_secondary_load_max); // hagar max loadable rockets
        WriteCoord(MSG_ENTITY, autocvar_g_trueaim_minrange);
        return TRUE;
 }
@@ -1523,6 +1525,7 @@ Called when a client connects to the server
 string ColoredTeamName(float t);
 void DecodeLevelParms (void);
 //void dom_player_join_team(entity pl);
+void set_dom_state(entity e);
 void ClientConnect (void)
 {
        float t;
@@ -1764,9 +1767,19 @@ void ClientConnect (void)
        else if(autocvar_sv_teamnagger && !(autocvar_bot_vs_human && (c3==-1 && c4==-1)) && !g_ca) // teamnagger is currently bad for ca
                send_CSQC_teamnagger();
 
+       if (g_domination)
+               set_dom_state(self);
+
        CheatInitClient();
 
        PlayerStats_AddPlayer(self);
+
+    self.shownames = spawn();
+    self.shownames.owner = self;
+    self.shownames.think = shownames_think;
+    self.shownames.nextthink = time;
+       self.shownames.customizeentityforclient = shownames_customize;
+    Net_LinkEntity(self.shownames, FALSE, 0, SendEntity_ShowNames);
 }
 
 /*
@@ -1866,6 +1879,8 @@ void ClientDisconnect (void)
        self.playerid = 0;
        ReadyCount();
 
+    remove(self.shownames);
+
        // free cvars
        GetCvars(-1);
 }
@@ -2384,6 +2399,7 @@ void SpectateCopy(entity spectatee) {
        self.weapon = spectatee.weapon;
        self.nex_charge = spectatee.nex_charge;
        self.nex_chargepool_ammo = spectatee.nex_chargepool_ammo;
+       self.hagar_load = spectatee.hagar_load;
        self.minelayer_mines = spectatee.minelayer_mines;
        self.punchangle = spectatee.punchangle;
        self.view_ofs = spectatee.view_ofs;
@@ -2715,9 +2731,6 @@ void PlayerPreThink (void)
                        return;                                 // the think tics
                }
 
-               if(frametime > 0) // don't do this in cl_movement frames, just in server ticks
-                       UpdateSelectedPlayer();
-
                //don't allow the player to turn around while game is paused!
                if(timeoutStatus == 2) {
                        self.v_angle = self.lastV_angle;
@@ -2743,7 +2756,26 @@ void PlayerPreThink (void)
                                        self.glowmod_z = -1;
                        }
                        else
+                       {
+                               // set weapon and player glowmod
                                self.glowmod = colormapPaletteColor(self.clientcolors & 0x0F, TRUE) * 2;
+
+                               if(self.weapon == WEP_NEX && autocvar_g_balance_nex_charge)
+                               {
+                                       self.weaponentity_glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit);
+                                       self.weaponentity_glowmod_y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit);
+                                       self.weaponentity_glowmod_z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit);
+
+                                       if(self.nex_charge > autocvar_g_balance_nex_charge_animlimit)
+                                       {
+                                               self.weaponentity_glowmod_x = self.weaponentity_glowmod_x + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (self.nex_charge - autocvar_g_balance_nex_charge_animlimit) / (1 - autocvar_g_balance_nex_charge_animlimit);
+                                               self.weaponentity_glowmod_y = self.weaponentity_glowmod_y + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (self.nex_charge - autocvar_g_balance_nex_charge_animlimit) / (1 - autocvar_g_balance_nex_charge_animlimit);
+                                               self.weaponentity_glowmod_z = self.weaponentity_glowmod_z + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (self.nex_charge - autocvar_g_balance_nex_charge_animlimit) / (1 - autocvar_g_balance_nex_charge_animlimit);
+                                       }
+                               }
+                               else
+                                       self.weaponentity_glowmod = self.glowmod;
+                       }
                        player_powerups();
                }
 
index a8a752269f3f2613ab5d4794234dc271c71b602f..3e507f4ab644b2bb25f1d2eced3a7a3363e4b178 100644 (file)
@@ -606,8 +606,6 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                {
                        // become fully visible
                        self.alpha = 1;
-                       // clear selected player display
-                       ClearSelectedPlayer();
                        // throw a weapon
                        SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.switchweapon);
                }
@@ -629,6 +627,7 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                frag_inflictor = inflictor;
                frag_target = self;
                MUTATOR_CALLHOOK(PlayerDies);
+               weapon_action(self.weapon, WR_PLAYERDEATH);
 
                if(self.flagcarried)
                {
@@ -736,152 +735,70 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
        }
 }
 
-float UpdateSelectedPlayer_countvalue(float v)
+// sendflags use: 1 = origin, 2 = health (0 or 1 for dead/alive on enemies), 4 = armor, 0x80 = same team (includes health)
+float SendEntity_ShowNames(entity to, float sendflags)
 {
-       return max(0, (v - 1.0) / 0.5);
+    float the_health;
+    the_health = self.health;
+
+    WriteByte(MSG_ENTITY, ENT_CLIENT_SHOWNAMES);
+    WriteByte(MSG_ENTITY, num_for_edict(self.owner));
+
+    sendflags = sendflags & 127;
+    if(teams_matter && self.owner.team == to.team)
+        sendflags |= 128;
+    else if(self.owner.health >= 1)
+        the_health = 1;
+
+    WriteByte(MSG_ENTITY, sendflags);
+    if(sendflags & 1)
+    {
+        WriteShort(MSG_ENTITY, rint(self.origin_x));
+        WriteShort(MSG_ENTITY, rint(self.origin_y));
+        WriteShort(MSG_ENTITY, rint(self.origin_z));
+    }
+    if(sendflags & 2)
+    {
+        WriteByte(MSG_ENTITY, the_health);
+    }
+    if(sendflags & 4)
+    {
+        WriteByte(MSG_ENTITY, self.armorvalue);
+    }
+    return TRUE;
 }
 
-// returns: -2 if no hit, otherwise cos of the angle
-// uses the global v_angle
-float UpdateSelectedPlayer_canSee(entity p, float mincosangle, float maxdist)
+const vector SHOWNAMES_ORIGIN_OFFSET = '0 0 48';
+void shownames_think()
 {
-       vector so, d;
-       float c;
-
-       if(p == self)
-               return -2;
-
-       if(p.deadflag)
-               return -2;
-
-       so = self.origin + self.view_ofs;
-       d = p.origin - so;
-
-       // misaimed?
-       if(dist_point_line(d, '0 0 0', v_forward) > maxdist)
-               return -2;
-
-       // now find the cos of the angle...
-       c = normalize(d) * v_forward;
-
-       if(c <= mincosangle)
-               return -2;
-
-       // not visible in any way? forget it
-       if(!checkpvs(so, p))
-               return -2;
-
-       traceline(so, p.origin, MOVE_NOMONSTERS, self);
-       if(trace_fraction < 1)
-               return -2;
-
-       return c;
-}
-
-void ClearSelectedPlayer()
-{
-       if(self.selected_player)
-       {
-               centerprint_expire(self, CENTERPRIO_POINT);
-               self.selected_player = world;
-               self.selected_player_display_needs_update = FALSE;
-       }
+    if(self.origin - SHOWNAMES_ORIGIN_OFFSET != self.owner.origin)
+    {
+        setorigin(self, self.owner.origin + SHOWNAMES_ORIGIN_OFFSET);
+        self.SendFlags |= 1;
+    }
+    if(self.health != max(0, floor(self.owner.health)) || self.armorvalue != max(0, floor(self.owner.armorvalue)))
+    {
+        self.health = max(0, floor(self.owner.health));
+        self.armorvalue = max(0, floor(self.owner.armorvalue));
+        self.SendFlags |= 2;
+    }
+    if(self.armorvalue != max(0, floor(self.owner.armorvalue)))
+    {
+        self.armorvalue = max(0, floor(self.owner.armorvalue));
+        self.SendFlags |= 4;
+    }
+    self.nextthink = time;
 }
 
-void UpdateSelectedPlayer()
+float shownames_customize()
 {
-       entity selected;
-       float selected_score;
-       selected = world;
-       selected_score = 0.95; // 18 degrees
-
-       if(!autocvar_sv_allow_shownames)
-               return;
-
-       if(clienttype(self) != CLIENTTYPE_REAL)
-               return;
-
-       if(self.cvar_cl_shownames == 0)
-               return;
-
-       if(self.cvar_cl_shownames == 1 && !teams_matter)
-               return;
-
-       makevectors(self.v_angle); // sets v_forward
-
-       // 1. cursor trace is always right
-       WarpZone_crosshair_trace(self);
-       if(trace_ent && trace_ent.classname == "player" && !trace_ent.deadflag)
-       {
-               selected = trace_ent;
-       }
-       else
-       {
-               // 2. if we don't have a cursor trace, find the player which is least
-               //    mis-aimed at
-               entity p;
-               FOR_EACH_PLAYER(p)
-               {
-                       float c;
-                       c = UpdateSelectedPlayer_canSee(p, selected_score, 100); // 100 = 2.5 meters
-                       if(c >= -1)
-                       {
-                               selected = p;
-                               selected_score = c;
-                       }
-               }
-       }
-
-       if(selected)
-       {
-               self.selected_player_display_timeout = time + self.cvar_scr_centertime;
-       }
-       else
-       {
-               if(time < self.selected_player_display_timeout)
-                       if(UpdateSelectedPlayer_canSee(self.selected_player, 0.7, 200) >= -1) // 5 meters, 45 degrees
-                               selected = self.selected_player;
-       }
-
-       if(selected)
-       {
-               if(selected == self.selected_player)
-               {
-                       float save;
-                       save = UpdateSelectedPlayer_countvalue(self.selected_player_count);
-                       self.selected_player_count = self.selected_player_count + frametime;
-                       if(save != UpdateSelectedPlayer_countvalue(self.selected_player_count))
-                       {
-                               string namestr, healthstr;
-                               namestr = playername(selected);
-                               if(teams_matter)
-                               {
-                                       healthstr = ftos(floor(selected.health));
-                                       if(self.team == selected.team)
-                                       {
-                                               namestr = strcat(namestr, " (", healthstr, "%)");
-                                               self.selected_player_display_needs_update = TRUE;
-                                       }
-                               }
-                               centerprint_atprio(self, CENTERPRIO_POINT, namestr);
-                       }
-               }
-               else
-               {
-                       ClearSelectedPlayer();
-                       self.selected_player = selected;
-                       self.selected_player_time = time;
-                       self.selected_player_count = 0;
-                       self.selected_player_display_needs_update = FALSE;
-               }
-       }
-       else
-       {
-               ClearSelectedPlayer();
-       }
+    if(self.owner.classname == "player") // only send players, no spectators!
+    if(self.owner != other) // no need to spam own coordinates
+    if(vlen(other.origin - self.origin) < autocvar_sv_shownames_cull_distance) // distance cull
+    if(self.owner.team == other.team || (self.owner.team != other.team && checkpvs(self.origin, other)))
+        return TRUE;
 
-       if(self.selected_player)
-               self.last_selected_player = self.selected_player;
+    return FALSE;
 }
 
 .float muted; // to be used by prvm_edictset server playernumber muted 1
index e605a0637cbd98b18c5420d7a744388ae829e228..cab6ec6e75c5adcb56a8d7b07b417875a2a251c6 100644 (file)
@@ -197,6 +197,7 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                self = oldself;
                if(startitem_failed)
                        return string_null;
+               wep.glowmod = own.weaponentity_glowmod;
                wep.think = thrown_wep_think;
                wep.nextthink = time + 0.5;
                return "";
@@ -232,6 +233,7 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                        }
                        s = substring(s, 5, -1);
                }
+               wep.glowmod = own.weaponentity_glowmod;
                wep.think = thrown_wep_think;
                wep.nextthink = time + 0.5;
                return s;
@@ -282,6 +284,8 @@ void W_ThrowWeapon(vector velo, vector delta, float doreduce)
        w = self.weapon;
        if (w == 0)
                return; // just in case
+       if(self.weapon_forbidchange)
+               return;
        if(MUTATOR_CALLHOOK(ForbidThrowCurrentWeapon))
                return;
        if(!autocvar_g_weapon_throwable)
@@ -344,7 +348,7 @@ void W_WeaponFrame()
        {
                if (self.weaponentity.state == WS_CLEAR)
                {
-                       setanim(self, self.anim_draw, FALSE, TRUE, TRUE);
+                       //setanim(self, self.anim_draw, FALSE, TRUE, TRUE);
                        self.weaponentity.state = WS_RAISE;
                        weapon_action(self.switchweapon, WR_SETUP);
 
@@ -407,7 +411,6 @@ void W_WeaponFrame()
                        v_forward = fo;
                        v_right = ri;
                        v_up = up;
-                       self.weaponentity_glowmod = '0 0 0'; // reset glowmod, weapon think function only *might* set it
                        weapon_action(self.weapon, WR_THINK);
                }
                if (time + self.weapon_frametime * 0.5 >= self.weapon_nextthink)
index 1ac1f78bfa199d6f73758b0b5de64395286a08de..4233e7d92d755b7651a60362f27080c192e888c7 100644 (file)
@@ -34,6 +34,10 @@ float W_WeaponRateFactor()
 
 void W_SwitchWeapon_Force(entity e, float w)
 {
+       // don't switch to another weapon if we're not allowed to
+       if(e.weapon_forbidchange)
+               return;
+
        e.cnt = e.switchweapon;
        e.switchweapon = w;
        e.selectweapon = w;
@@ -1253,6 +1257,8 @@ void weapon_thinkf(float fr, float t, void() func)
        self.weapon_think = func;
        //dprint("next ", ftos(self.weapon_nextthink), "\n");
 
+    // The shoot animation looks TERRIBLE without animation blending! Yay for moonwalking while shooting!
+    /*
        if (restartanim)
        if (t)
        if (!self.crouch) // shoot anim stands up, this looks bad
@@ -1265,6 +1271,7 @@ void weapon_thinkf(float fr, float t, void() func)
                anim_z = anim_y / (t + sys_frametime);
                setanim(self, anim, FALSE, TRUE, TRUE);
        }
+    */
 };
 
 void weapon_boblayer1(float spd, vector org)
index 4317b0cacc5c27f0f40a4f091ac0d8db2896ea1d..92872dc659ff27e09ba2b020387ba0e75ac51335 100644 (file)
@@ -210,6 +210,7 @@ void w_clear();
 void w_ready();
 // VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies)
 .float weapon_nextthink;
+.float weapon_forbidchange;
 .void() weapon_think;
 
 //float        PLAYER_WEAPONSELECTION_DELAY = );
@@ -314,6 +315,7 @@ float default_weapon_alpha;
 .float cvar_scr_centertime;
 .float cvar_cl_shownames;
 .float cvar_cl_noclipspectating;
+
 .string cvar_g_xonoticversion;
 .string cvar_cl_weaponpriority;
 .string cvar_cl_weaponpriorities[10];
@@ -365,15 +367,6 @@ float W_AmmoItemCode(float wpn);
 float W_WeaponBit(float wpn);
 string W_Name(float weaponid);
 
-void UpdateSelectedPlayer();
-void ClearSelectedPlayer();
-.entity selected_player;
-.entity last_selected_player;
-.float selected_player_time; // when this player has been selected
-.float selected_player_count; // how long this player has been directly pointed to
-.float selected_player_display_needs_update; // are regular updates necessary? (health)
-.float selected_player_display_timeout; // when the selection will time out
-
 void FixIntermissionClient(entity e);
 void FixClientCvars(entity e);
 
@@ -661,6 +654,8 @@ string deathmessage;
 .float nex_charge_rottime;
 .float nex_chargepool_ammo;
 
+.float hagar_load;
+
 float allowed_to_spawn; // boolean variable used by the clan arena code to determine if a player can spawn (after the round has ended)
 
 float serverflags;
@@ -672,3 +667,6 @@ float serverflags;
 
 .entity muzzle_flash;
 .float misc_bulletcounter;     // replaces uzi & hlac bullet counter.
+
+.entity shownames;
+void shownames_think();
index de18bfdd5c0a2e97b8ec5b1ea9c88e97ae4eca76..281a0b4a4548df2f5583c43266be37cd6c619e36 100644 (file)
@@ -21,6 +21,29 @@ Note: The only teams who can use dom control points are identified by spawnfunc_
 .entity sprite;
 .float captime;
 
+// pps: points per second
+.float dom_total_pps;
+.float dom_pps_red;
+.float dom_pps_blue;
+.float dom_pps_yellow;
+.float dom_pps_pink;
+float total_pps;
+float pps_red;
+float pps_blue;
+float pps_yellow;
+float pps_pink;
+void set_dom_state(entity e)
+{
+       // BIG ugly hack to make stat sending work
+       e.dom_total_pps = total_pps;
+       e.dom_pps_red = pps_red;
+       e.dom_pps_blue = pps_blue;
+       if(c3 >= 0)
+               e.dom_pps_yellow = pps_yellow;
+       if(c4 >= 0)
+               e.dom_pps_pink = pps_pink;
+}
+
 void() dom_controlpoint_setup;
 
 void LogDom(string mode, float team_before, entity actor)
@@ -107,25 +130,57 @@ void dompoint_captured ()
        self.delay = old_delay;
        self.team = old_team;
 
+       switch(self.team)
+       {
+               // "fix" pps when slightly under 0 because of approximation errors
+               case COLOR_TEAM1:
+                       pps_red -= (points/wait_time);
+                       if (pps_red < 0) pps_red = 0;
+                       break;
+               case COLOR_TEAM2:
+                       pps_blue -= (points/wait_time);
+                       if (pps_blue < 0) pps_blue = 0;
+                       break;
+               case COLOR_TEAM3:
+                       pps_yellow -= (points/wait_time);
+                       if (pps_yellow < 0) pps_yellow = 0;
+                       break;
+               case COLOR_TEAM4:
+                       pps_pink -= (points/wait_time);
+                       if (pps_pink < 0) pps_pink = 0;
+       }
+
        switch(self.goalentity.team)
        {
+               // "fix" pps when slightly over total_pps because of approximation errors
                case COLOR_TEAM1:
+                       pps_red += (points/wait_time);
+                       if (pps_red > total_pps) pps_red = total_pps;
                        WaypointSprite_UpdateSprites(self.sprite, "dom-red", "", "");
                        break;
                case COLOR_TEAM2:
+                       pps_blue += (points/wait_time);
+                       if (pps_blue > total_pps) pps_blue = total_pps;
                        WaypointSprite_UpdateSprites(self.sprite, "dom-blue", "", "");
                        break;
                case COLOR_TEAM3:
+                       pps_yellow += (points/wait_time);
+                       if (pps_yellow > total_pps) pps_yellow = total_pps;
                        WaypointSprite_UpdateSprites(self.sprite, "dom-yellow", "", "");
                        break;
                case COLOR_TEAM4:
+                       pps_pink += (points/wait_time);
+                       if (pps_pink > total_pps) pps_pink = total_pps;
                        WaypointSprite_UpdateSprites(self.sprite, "dom-pink", "", "");
-                       break;
        }
+
        WaypointSprite_UpdateTeamRadar(self.sprite, RADARICON_DOMPOINT, colormapPaletteColor(self.goalentity.team - 1, 0));
        WaypointSprite_Ping(self.sprite);
 
        self.captime = time;
+
+       FOR_EACH_PLAYER(head)
+               set_dom_state(head);
 };
 
 void AnimateDomPoint()
@@ -305,11 +360,23 @@ void dom_controlpoint_setup()
        if(!self.message)
                self.message = " has captured a control point";
 
-       if(!self.DOMPOINTFRAGS)
+       if(self.DOMPOINTFRAGS <= 0)
                self.DOMPOINTFRAGS = 1;
-       if(!self.wait)
+       if(self.wait <= 0)
                self.wait = 5;
 
+       float points, waittime;
+       if (autocvar_g_domination_point_rate)
+               points = autocvar_g_domination_point_rate;
+       else
+               points = self.frags;
+       if (autocvar_g_domination_point_amt)
+               waittime = autocvar_g_domination_point_amt;
+       else
+               waittime = self.wait;
+
+       total_pps += points/waittime;
+
        if(!self.t_width)
                self.t_width = 0.02; // frame animation rate
        if(!self.t_length)
@@ -641,5 +708,11 @@ void dom_init()
        precache_model("models/domination/dom_unclaimed.md3");
        precache_sound("domination/claim.wav");
        InitializeEntity(world, dom_delayedinit, INITPRIO_GAMETYPE);
+
+       addstat(STAT_DOM_TOTAL_PPS, AS_FLOAT, dom_total_pps);
+       addstat(STAT_DOM_PPS_RED, AS_FLOAT, dom_pps_red);
+       addstat(STAT_DOM_PPS_BLUE, AS_FLOAT, dom_pps_blue);
+       if(c3 >= 0) addstat(STAT_DOM_PPS_YELLOW, AS_FLOAT, dom_pps_yellow);
+       if(c4 >= 0) addstat(STAT_DOM_PPS_PINK, AS_FLOAT, dom_pps_pink);
 };
 
diff --git a/qcsrc/server/frags.txt b/qcsrc/server/frags.txt
deleted file mode 100644 (file)
index 1daf099..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-TODO: remove the .frags field, except for the following values:
-
-0 = regular player
--2 = ???, used by arena
--666 = spectator
-
-Anything else shall go through PlayerScore!
diff --git a/qcsrc/server/g_swamp.qc b/qcsrc/server/g_swamp.qc
deleted file mode 100644 (file)
index fe64e7c..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
-*              t_swamp.c
-*              Adds spawnfunc_trigger_swamp and suppoart routines for xonotic 1.2.1+
-*              Author tZork (Jakob MG) 
-*              jakob@games43.se
-*              2005 11 29
-*/
-
index bf033e4d6801531fd003a22fe7116efd2b67736d..6ee4e117964d16ff1a3e01d624dd098caa2de62e 100644 (file)
@@ -833,6 +833,8 @@ void spawnfunc_worldspawn (void)
        addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
        addstat(STAT_NEX_CHARGEPOOL, AS_FLOAT, nex_chargepool_ammo);
 
+       addstat(STAT_HAGAR_LOAD, AS_INT, hagar_load);
+
        if(g_ca || g_freezetag)
        {
                addstat(STAT_REDALIVE, AS_INT, redalive_stat);
@@ -944,19 +946,6 @@ void spawnfunc_light (void)
        remove(self);
 }
 
-float TryFile( string pFilename )
-{
-       local float lHandle;
-       dprint("TryFile(\"", pFilename, "\")\n");
-       lHandle = fopen( pFilename, FILE_READ );
-       if( lHandle != -1 ) {
-               fclose( lHandle );
-               return TRUE;
-       } else {
-               return FALSE;
-       }
-};
-
 string GetGametype()
 {
        return GametypeNameFromType(game);
@@ -1000,14 +989,12 @@ float MapHasRightSize(string map)
        if(autocvar_g_maplist_check_waypoints)
        {
                dprint("checkwp "); dprint(map);
-               fh = fopen(strcat("maps/", map, ".waypoints"), FILE_READ);
-               if(fh < 0)
+               if(!fexists(strcat("maps/", map, ".waypoints")))
                {
                        dprint(": no waypoints\n");
                        return FALSE;
                }
                dprint(": has waypoints\n");
-               fclose(fh);
        }
 
        // open map size restriction file
index d599c259cd97b0688900d7fbaa6c57ad567ab708..00ed1e47ea591de7215445180c59e9c0505567fe 100644 (file)
@@ -460,11 +460,6 @@ string formatmessage(string msg)
                        replacement = cursor_ent.netname;
                        if (!replacement || !cursor_ent)
                                replacement = "nothing";
-               } else if (escape == "p") {
-                       if (self.last_selected_player)
-                               replacement = self.last_selected_player.netname;
-                       else
-                               replacement = "(nobody)";
                } else if (escape == "s")
                        replacement = ftos(vlen(self.velocity - self.velocity_z * '0 0 1'));
                else if (escape == "S")
@@ -585,7 +580,6 @@ void GetCvars(float f)
        GetCvars_handleFloat(s, f, autoswitch, "cl_autoswitch");
        GetCvars_handleFloat(s, f, cvar_cl_playerdetailreduction, "cl_playerdetailreduction");
        GetCvars_handleFloat(s, f, cvar_scr_centertime, "scr_centertime");
-       GetCvars_handleFloat(s, f, cvar_cl_shownames, "cl_shownames");
        GetCvars_handleString(s, f, cvar_g_xonoticversion, "g_xonoticversion");
        GetCvars_handleFloat(s, f, cvar_cl_handicap, "cl_handicap");
        GetCvars_handleFloat(s, f, cvar_cl_noclipspectating, "cl_noclipspectating");
@@ -627,16 +621,6 @@ void GetCvars(float f)
        }
 }
 
-float fexists(string f)
-{
-    float fh;
-    fh = fopen(f, FILE_READ);
-    if (fh < 0)
-        return FALSE;
-    fclose(fh);
-    return TRUE;
-}
-
 void backtrace(string msg)
 {
     float dev, war;
@@ -2002,7 +1986,8 @@ float SUB_NoImpactCheck()
        // these stop the projectile from moving, so...
        if(trace_dphitcontents == 0)
        {
-               dprint("A hit happened with zero hit contents... DEBUG THIS, this should never happen for projectiles! Projectile will self-destruct.\n");
+               //dprint("A hit happened with zero hit contents... DEBUG THIS, this should never happen for projectiles! Projectile will self-destruct.\n");
+               dprint(sprintf(_("A hit from a projectile happened with no hit contents! DEBUG THIS, this should never happen for projectiles! Profectile will self-destruct. (edict: %d, classname: %s, origin: %s)\n"), num_for_edict(self), self.classname, vtos(self.origin)));
                checkclient();
        }
     if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
index 4cddbbc70fbb74608645299b7bf36724047e2c32..f56dc59f18f15979d5cdd8e5defb06826babdaf9 100644 (file)
@@ -85,6 +85,8 @@ void freezetag_Freeze(entity attacker)
        freezetag_Ice_Think();
        self = oldself;
 
+       RemoveGrapplingHook(self);
+
        // add waypoint
        WaypointSprite_Spawn("freezetag_frozen", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attached, TRUE);
        if(self.waypointsprite_attached)
index d55c803148e6b0d598c392fed11dac8cd4276d61..488dd10206bc1c4f11d9c5b51beee49c14fb50aa 100644 (file)
@@ -96,7 +96,6 @@ t_jumppads.qc
 t_teleporters.qc
 
 sv_main.qc
-sv_stats.qc
 
 g_triggers.qc
 g_models.qc
diff --git a/qcsrc/server/sv_stats.qc b/qcsrc/server/sv_stats.qc
deleted file mode 100644 (file)
index 0924cba..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-// Accuracy
-//.float shots;
-//.float hits;
-
index a80323e23a49c95f2a734d8d12060e9a3f091ed0..87475df39ebb3383a8e0c2121110a0c2efeca5fe 100644 (file)
@@ -77,7 +77,6 @@ void spawn_tdeath(vector v0, entity e, vector v)
 #define TELEPORT_FLAGS_TELEPORTER (TELEPORT_FLAG_SOUND | TELEPORT_FLAG_PARTICLES | TELEPORT_FLAG_TDEATH)
 void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angles, vector to_velocity, vector telefragmin, vector telefragmax, float tflags)
 {
-       entity oldself;
        entity telefragger;
        vector from;
 
@@ -139,14 +138,6 @@ void TeleportPlayer(entity teleporter, entity player, vector to, vector to_angle
                }
 
                player.lastteleporttime = time;
-
-               // stop player name display
-               {
-                       oldself = self;
-                       self = player;
-                       ClearSelectedPlayer();
-                       self = oldself;
-               }
        }
 }
 
index c8f83abf78b29ead3fa1fee48d1a8c88f03d89a0..bbe81a2f6d19ae2d28b4bb6108e9942151ac73ca 100644 (file)
@@ -1 +1,3 @@
-http://www.alientrap.org/devwiki/index.php?n=Xonotic.Todo (and get this Todo actually updated :P)
+http://dev.xonotic.org/projects/xonotic/issues
+
+also: Maybe actually decide upon what to do with this todo file? No one uses it :P Just use the development tracker.
\ No newline at end of file
index df0d96679890f3b824cfda07b5dbc5384f2f9ce2..7dfd4461365e42cbcf9f70817a12fcaf87f1be6f 100644 (file)
@@ -112,6 +112,154 @@ void W_Hagar_Attack2 (void)
        other = missile; MUTATOR_CALLHOOK(EditProjectile);
 }
 
+.float hagar_loadstep, hagar_loadblock, hagar_loadbeep;
+void W_Hagar_Attack2_Load_Release (void)
+{
+       // time to release the rockets we've loaded
+
+       local entity missile;
+       local float counter, shots;
+       local vector s;
+       vector forward, right, up;
+
+       if(!self.hagar_load)
+               return;
+
+       weapon_prepareattack_do(1, autocvar_g_balance_hagar_secondary_refire);
+
+       W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, autocvar_g_balance_hagar_secondary_damage);
+       pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
+
+       forward = v_forward;
+       right = v_right;
+       up = v_up;
+
+       shots = self.hagar_load;
+       missile = world;
+       while (counter < shots)
+       {
+               missile = spawn ();
+               missile.owner = missile.realowner = self;
+               missile.classname = "missile";
+               missile.bot_dodge = TRUE;
+               missile.bot_dodgerating = autocvar_g_balance_hagar_secondary_damage;
+
+               missile.touch = W_Hagar_Touch; // not bouncy
+               missile.use = W_Hagar_Explode2;
+               missile.think = adaptor_think2use_hittype_splash;
+               missile.nextthink = time + autocvar_g_balance_hagar_secondary_lifetime_min + random() * autocvar_g_balance_hagar_secondary_lifetime_rand;
+               PROJECTILE_MAKETRIGGER(missile);
+               missile.projectiledeathtype = WEP_HAGAR;
+               setorigin (missile, w_shotorg);
+               setsize(missile, '0 0 0', '0 0 0');
+               missile.movetype = MOVETYPE_FLY;
+
+               s = '0 0 0';
+               if (counter == 0)
+                       s = '0 0 0';
+               else
+               {
+                       makevectors('0 360 0' * (0.75 + (counter - 0.5) / (shots - 1)));
+                       s_y = v_forward_x;
+                       s_z = v_forward_y;
+               }
+               s = s * cvar("g_balance_hagar_secondary_spread") * g_weaponspreadfactor;
+               W_SetupProjectileVelocityEx(missile, w_shotdir + right * s_y + up * s_z, v_up, cvar("g_balance_hagar_secondary_speed"), 0, 0, 0, FALSE);
+
+               missile.angles = vectoangles (missile.velocity);
+               missile.flags = FL_PROJECTILE;
+
+               CSQCProjectile(missile, TRUE, PROJECTILE_HAGAR, TRUE);
+
+               other = missile; MUTATOR_CALLHOOK(EditProjectile);
+
+               counter = counter + 1;
+       }
+
+       weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_hagar_secondary_refire, w_ready);
+       self.hagar_loadstep = time + autocvar_g_balance_hagar_secondary_refire;
+       self.hagar_load = 0;
+}
+
+void W_Hagar_Attack2_Load (void)
+{
+       // loadable hagar secondary attack, must always run each frame
+
+       local float loaded, enough_ammo;
+       loaded = self.hagar_load >= autocvar_g_balance_hagar_secondary_load_max;
+
+       // this is different than WR_CHECKAMMO when it comes to reloading
+       if(autocvar_g_balance_hagar_reload_ammo)
+               enough_ammo = self.weapon_load[WEP_HAGAR] >= autocvar_g_balance_hagar_secondary_ammo;
+       else
+               enough_ammo = self.ammo_rockets >= autocvar_g_balance_hagar_secondary_ammo;
+
+       if(self.BUTTON_ATCK2)
+       {
+               if(self.BUTTON_ATCK && autocvar_g_balance_hagar_secondary_load_abort)
+               {
+                       if(self.hagar_load)
+                       {
+                               // if we pressed primary fire while loading, unload all rockets and abort
+                               W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo * self.hagar_load * -1, autocvar_g_balance_hagar_reload_ammo); // give back ammo
+                               self.hagar_load = 0;
+                               sound(self, CHAN_WEAPON, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
+
+                               // pause until we can load rockets again, once we re-press the alt fire button
+                               self.hagar_loadstep = time + autocvar_g_balance_hagar_secondary_load_speed;
+
+                               // require letting go of the alt fire button before we can load again
+                               self.hagar_loadblock = TRUE;
+                       }
+               }
+               else
+               {
+                       // check if we can attempt to load another rocket
+                       if(!loaded && enough_ammo)
+                       {
+                               if(!self.hagar_loadblock && self.hagar_loadstep < time)
+                               {
+                                       W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo, autocvar_g_balance_hagar_reload_ammo);
+                                       self.hagar_load += 1;
+                                       sound(self, CHAN_WEAPON2, "weapons/hagar_load.wav", VOL_BASE, ATTN_NORM);
+
+                                       self.hagar_loadstep = time + autocvar_g_balance_hagar_secondary_load_speed;
+                               }
+                       }
+                       else if(!self.hagar_loadbeep && self.hagar_load) // prevents the beep from playing each frame
+                       {
+                               // if this is the last rocket we can load, play a beep sound to notify the player
+                               sound(self, CHAN_WEAPON, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM);
+                               self.hagar_loadbeep = TRUE;
+                       }
+               }
+       }
+       else if(self.hagar_loadblock)
+       {
+               // the alt fire button has been released, so re-enable loading if blocked
+               self.hagar_loadblock = FALSE;
+       }
+
+       if(self.hagar_load)
+       {
+               self.weapon_forbidchange = TRUE;
+               if(!self.BUTTON_ATCK2 || ((loaded || !enough_ammo) && self.hagar_loadstep < time && !autocvar_g_balance_hagar_secondary_load_hold))
+                       W_Hagar_Attack2_Load_Release();
+       }
+       else
+       {
+               self.weapon_forbidchange = FALSE;
+               self.hagar_loadbeep = FALSE;
+       }
+
+       // we aren't checking ammo during an attack, so we must do it here
+       if not(weapon_action(self.weapon, WR_CHECKAMMO1) + weapon_action(self.weapon, WR_CHECKAMMO2))
+       {
+               W_SwitchToOtherWeapon(self);
+               return;
+       }
+}
+
 void spawnfunc_weapon_hagar (void)
 {
        weapon_defaultspawnfunc(WEP_HAGAR);
@@ -130,9 +278,14 @@ float w_hagar(float req)
                }
        else if (req == WR_THINK)
        {
+               local float loadable_secondary;
+               loadable_secondary = autocvar_g_balance_hagar_secondary_load && autocvar_g_balance_hagar_secondary;
+
+               if (loadable_secondary)
+                       W_Hagar_Attack2_Load(); // must always run each frame
                if(autocvar_g_balance_hagar_reload_ammo && self.clip_load < min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo)) // forced reload
                        weapon_action(self.weapon, WR_RELOAD);
-               else if (self.BUTTON_ATCK)
+               else if (self.BUTTON_ATCK && !self.hagar_load && !self.hagar_loadblock) // not while secondary is loaded or awaiting reset
                {
                        if (weapon_prepareattack(0, autocvar_g_balance_hagar_primary_refire))
                        {
@@ -140,7 +293,7 @@ float w_hagar(float req)
                                weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hagar_primary_refire, w_ready);
                        }
                }
-               else if (self.BUTTON_ATCK2 && autocvar_g_balance_hagar_secondary)
+               else if (self.BUTTON_ATCK2 && !loadable_secondary && autocvar_g_balance_hagar_secondary)
                {
                        if (weapon_prepareattack(1, autocvar_g_balance_hagar_secondary_refire))
                        {
@@ -155,12 +308,21 @@ float w_hagar(float req)
                precache_model ("models/weapons/v_hagar.md3");
                precache_model ("models/weapons/h_hagar.iqm");
                precache_sound ("weapons/hagar_fire.wav");
+               precache_sound ("weapons/hagar_load.wav");
+               precache_sound ("weapons/hagar_beep.wav");
                //precache_sound ("weapons/reload.wav"); // until weapons have individual reload sounds, precache the reload sound somewhere else
        }
        else if (req == WR_SETUP)
        {
                weapon_setup(WEP_HAGAR);
                self.current_ammo = ammo_rockets;
+               self.hagar_loadblock = FALSE;
+
+               if(self.hagar_load)
+               {
+                       W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo * self.hagar_load * -1, autocvar_g_balance_hagar_reload_ammo); // give back ammo if necessary
+                       self.hagar_load = 0;
+               }
        }
        else if (req == WR_CHECKAMMO1)
        {
@@ -174,9 +336,20 @@ float w_hagar(float req)
                ammo_amount += self.weapon_load[WEP_HAGAR] >= autocvar_g_balance_hagar_secondary_ammo;
                return ammo_amount;
        }
+       else if (req == WR_RESETPLAYER)
+       {
+               self.hagar_load = 0;
+       }
+       else if (req == WR_PLAYERDEATH)
+       {
+               // if we have any rockets loaded when we die, release them
+               if(self.hagar_load && autocvar_g_balance_hagar_secondary_load_releasedeath)
+                       W_Hagar_Attack2_Load_Release();
+       }
        else if (req == WR_RELOAD)
        {
-               W_Reload(min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, "weapons/reload.wav");
+               if not(self.hagar_load) // require releasing loaded rockets first
+                       W_Reload(min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, "weapons/reload.wav");
        }
        return TRUE;
 };
index 476d3e676810336d1aac791f3a97dfb4523bf9ca..04a1151910bf0f290a7f91eee114aeb97a8a9fc8 100644 (file)
@@ -194,20 +194,6 @@ float w_nex(float req)
                                }
                        }
                }
-
-               if(autocvar_g_balance_nex_charge)
-               {
-                       self.weaponentity_glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit);
-                       self.weaponentity_glowmod_y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit);
-                       self.weaponentity_glowmod_z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_animlimit);
-
-                       if(self.nex_charge > autocvar_g_balance_nex_charge_animlimit)
-                       {
-                               self.weaponentity_glowmod_x = self.weaponentity_glowmod_x + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (self.nex_charge - autocvar_g_balance_nex_charge_animlimit) / (1 - autocvar_g_balance_nex_charge_animlimit);
-                               self.weaponentity_glowmod_y = self.weaponentity_glowmod_y + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (self.nex_charge - autocvar_g_balance_nex_charge_animlimit) / (1 - autocvar_g_balance_nex_charge_animlimit);
-                               self.weaponentity_glowmod_z = self.weaponentity_glowmod_z + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (self.nex_charge - autocvar_g_balance_nex_charge_animlimit) / (1 - autocvar_g_balance_nex_charge_animlimit);
-                       }
-               }
        }
        else if (req == WR_PRECACHE)
        {
diff --git a/sound/weapons/hagar_beep.ogg b/sound/weapons/hagar_beep.ogg
new file mode 100644 (file)
index 0000000..52ef8e8
Binary files /dev/null and b/sound/weapons/hagar_beep.ogg differ
diff --git a/sound/weapons/hagar_load.ogg b/sound/weapons/hagar_load.ogg
new file mode 100644 (file)
index 0000000..92b88be
Binary files /dev/null and b/sound/weapons/hagar_load.ogg differ
index 6d719e6bcf91efe4d7d2a8013334d8182ff3a0bf..6189b51e955ef834020ad83c48161715bb930984 100644 (file)
Binary files a/textures/campingrifle.tga and b/textures/campingrifle.tga differ
index b7a33d947a797cdc7e6d55de19bb5bbf48489fd2..f42532995fe5576d8658a0f0bca8c53c73a2d295 100644 (file)
Binary files a/textures/campingrifle_glow.tga and b/textures/campingrifle_glow.tga differ
diff --git a/textures/campingrifle_pants.tga b/textures/campingrifle_pants.tga
deleted file mode 100644 (file)
index 633d3dd..0000000
Binary files a/textures/campingrifle_pants.tga and /dev/null differ
diff --git a/textures/campingrifle_shirt.tga b/textures/campingrifle_shirt.tga
deleted file mode 100644 (file)
index 8944408..0000000
Binary files a/textures/campingrifle_shirt.tga and /dev/null differ
index f67d64674023a51a8e6db047c93f0fa08b779952..c07f02a704ebdd8c15b71c0bbb12b791ef9de3b7 100644 (file)
Binary files a/textures/crylink.tga and b/textures/crylink.tga differ
index 97016866eb5992a6b7e1b2d36f87cc8f374b8c7d..84e2c17c7cc98c5f5f23939840a4df3786e9cff8 100644 (file)
Binary files a/textures/crylink_gloss.tga and b/textures/crylink_gloss.tga differ
index e73aaaa406235fb467079d86d7a9f8e2d2878c99..de4be8ef2e8ae4ed5b4b3d5b41e1beeb8e0c0bc3 100644 (file)
Binary files a/textures/crylink_glow.jpg and b/textures/crylink_glow.jpg differ
diff --git a/textures/crylink_pants.tga b/textures/crylink_pants.tga
deleted file mode 100644 (file)
index cc53e76..0000000
Binary files a/textures/crylink_pants.tga and /dev/null differ
index 5c5109e69421dab0d1a04b236414c17d1376ddfc..ec7857b19711eca5205c80ef96abfc47ec9a82d2 100644 (file)
Binary files a/textures/crylink_reflect.tga and b/textures/crylink_reflect.tga differ
index 1fe74b161d971d7c2077766f8408139f32be58ef..adf55c2ed500e0c2b2d7969648f5032a7fbefbee 100644 (file)
Binary files a/textures/electro.tga and b/textures/electro.tga differ
index 91736effd5bc035d29967a7d367dd015d55ce784..9c6a5bfffea7e7d9f89b5cc72f4f86bd8141d2b9 100644 (file)
Binary files a/textures/electro_glow.tga and b/textures/electro_glow.tga differ
diff --git a/textures/electro_pants.tga b/textures/electro_pants.tga
deleted file mode 100644 (file)
index b8e7084..0000000
Binary files a/textures/electro_pants.tga and /dev/null differ
index f57bc18ac28b0f515e712010b2a6452e73a1c8a7..a0600288ccf65716713df08c7271eb3dc0495dfc 100644 (file)
Binary files a/textures/electro_plasma.tga and b/textures/electro_plasma.tga differ
index f57bc18ac28b0f515e712010b2a6452e73a1c8a7..a0600288ccf65716713df08c7271eb3dc0495dfc 100644 (file)
Binary files a/textures/electro_plasma_glow.tga and b/textures/electro_plasma_glow.tga differ
diff --git a/textures/glauncher_glow.tga b/textures/glauncher_glow.tga
new file mode 100644 (file)
index 0000000..bd93673
Binary files /dev/null and b/textures/glauncher_glow.tga differ
diff --git a/textures/glauncher_pants.tga b/textures/glauncher_pants.tga
deleted file mode 100644 (file)
index 1f3957e..0000000
Binary files a/textures/glauncher_pants.tga and /dev/null differ
index f582ce66330c979bf61ef4d4c7a1da4c3c38f851..22c345637d8653a92ab11333b871e6f2852cf106 100644 (file)
Binary files a/textures/glscope.tga and b/textures/glscope.tga differ
index f582ce66330c979bf61ef4d4c7a1da4c3c38f851..22c345637d8653a92ab11333b871e6f2852cf106 100644 (file)
Binary files a/textures/glscope_glow.tga and b/textures/glscope_glow.tga differ
index 2b77dd918ec3b9e572f72ff99861a600a79e9f0a..f05fef985c82aeaa1f5a3d9bd17ecc762be51a62 100644 (file)
Binary files a/textures/hagar2.tga and b/textures/hagar2.tga differ
index 9fff206a2252d8dd5b4659f5487a9794384e55bc..cd4b3531230f93534bfb8f7d506fdc4924106560 100644 (file)
Binary files a/textures/hagar2_glow.tga and b/textures/hagar2_glow.tga differ
diff --git a/textures/hagar2_pants.tga b/textures/hagar2_pants.tga
deleted file mode 100644 (file)
index 5992dbf..0000000
Binary files a/textures/hagar2_pants.tga and /dev/null differ
index 9fe31cc24a27a8ba5288f0eda032ca86a41000fa..7b86985c81a84e55c03bae2e1c96c076f6ed8008 100644 (file)
Binary files a/textures/hlac_accessory.tga and b/textures/hlac_accessory.tga differ
diff --git a/textures/hlac_accessory_glow.tga b/textures/hlac_accessory_glow.tga
new file mode 100644 (file)
index 0000000..c322008
Binary files /dev/null and b/textures/hlac_accessory_glow.tga differ
diff --git a/textures/hlac_accessory_pants.tga b/textures/hlac_accessory_pants.tga
deleted file mode 100644 (file)
index 23516cc..0000000
Binary files a/textures/hlac_accessory_pants.tga and /dev/null differ
index c4c6882a20a117012d1f9fd353d361fc01332c1f..fa24925a7629759cbce66a558dcfd8023680eaa2 100644 (file)
Binary files a/textures/hlac_body.tga and b/textures/hlac_body.tga differ
index fffafabf98da05b4f21a9397ca8d8ccb401345b5..c9c04abf94509c488eb69a5b729c4cae1253a92b 100644 (file)
Binary files a/textures/hlac_body_glow.tga and b/textures/hlac_body_glow.tga differ
diff --git a/textures/hlac_body_pants.tga b/textures/hlac_body_pants.tga
deleted file mode 100644 (file)
index 32ee034..0000000
Binary files a/textures/hlac_body_pants.tga and /dev/null differ
index c3bddd150d9ce505f1a8c36003d1e8a6b7b0bc02..32ee034605b015e575aa0cf4e19e796606611e97 100644 (file)
Binary files a/textures/hlac_body_shirt.tga and b/textures/hlac_body_shirt.tga differ
index 5842c4f6cab26636f7028212b11e8cef81e61827..264a8cdf01c989b7de02e9a79e3dccecd6f6302f 100644 (file)
Binary files a/textures/hlac_metal.tga and b/textures/hlac_metal.tga differ
index 3a6abf5f11b7c69828033b93b9656f1129d3fa72..a20be9f640afb5be9d83e3d036f603ef208bf059 100644 (file)
Binary files a/textures/hlac_metal_glow.tga and b/textures/hlac_metal_glow.tga differ
index 5603b16e7d9504dad8a9f5e0ab593e052af6e32a..956b2417621cca92ca207961f45ce971febfc183 100644 (file)
Binary files a/textures/hlac_plasma.tga and b/textures/hlac_plasma.tga differ
diff --git a/textures/hookgun_pants.tga b/textures/hookgun_pants.tga
deleted file mode 100644 (file)
index 327822d..0000000
Binary files a/textures/hookgun_pants.tga and /dev/null differ
diff --git a/textures/hookgun_shirt.tga b/textures/hookgun_shirt.tga
new file mode 100644 (file)
index 0000000..327822d
Binary files /dev/null and b/textures/hookgun_shirt.tga differ
index d651d382f94bf9222c76d5dd2137d227f45d2e7c..c0f2bc78c6b3152f84fdb0f821975d2709e68cbb 100644 (file)
Binary files a/textures/laser.tga and b/textures/laser.tga differ
index 9e7eb103576c3d36c9137e0099e345a9779cfc60..90e32e7235de79be24681b753b5960d0a90e9bd8 100644 (file)
Binary files a/textures/laser_glow.tga and b/textures/laser_glow.tga differ
diff --git a/textures/laser_pants.tga b/textures/laser_pants.tga
deleted file mode 100644 (file)
index 4566bc0..0000000
Binary files a/textures/laser_pants.tga and /dev/null differ
index e0fa48c143fe567db868cedf29197d9db07e116d..834a987bd6b2f438e9b97442679514bd1b973ac9 100644 (file)
Binary files a/textures/minelayer.tga and b/textures/minelayer.tga differ
index 163735f7fad65e232d8964bfe35c484ac3f4ebdb..34e865f0c844f10aceff71932a68e7a3a4c72a58 100644 (file)
Binary files a/textures/minelayer_glow.tga and b/textures/minelayer_glow.tga differ
index 1fdc59a78de9ddd16d543b19f8f2ec0013ebca62..7ff7027cf2cf6c926fc969570504968f4235346e 100644 (file)
Binary files a/textures/nex.tga and b/textures/nex.tga differ
index 915001cde7f06d2c0e8ceaeda8aea27a6785fe86..aa6c3247471dae4d14a9ca79d861e9253362bf70 100644 (file)
Binary files a/textures/nex_glow.tga and b/textures/nex_glow.tga differ
diff --git a/textures/nex_pants.tga b/textures/nex_pants.tga
deleted file mode 100644 (file)
index 6fc3833..0000000
Binary files a/textures/nex_pants.tga and /dev/null differ
index 420bf15654ce5d03e916ff5afe941e250b7ae61f..9da70356511e3cd27cd2921e480c4fbf9023895c 100644 (file)
Binary files a/textures/portalgun.tga and b/textures/portalgun.tga differ
index 1719b0511bb6f0d12870ce78e63a259a163ee141..3a36355fb213352f3961c378476a14bc65fa5280 100644 (file)
Binary files a/textures/portalgun_glow.tga and b/textures/portalgun_glow.tga differ
diff --git a/textures/rl_glow.tga b/textures/rl_glow.tga
new file mode 100644 (file)
index 0000000..755f96a
Binary files /dev/null and b/textures/rl_glow.tga differ
diff --git a/textures/rl_pants.tga b/textures/rl_pants.tga
deleted file mode 100644 (file)
index 9f7cd2e..0000000
Binary files a/textures/rl_pants.tga and /dev/null differ
index e275817b59e1f38d4834b0cbcf5d1bcb774119c2..3e70ade018be67a6d44da8b3f14ab34310f26b32 100644 (file)
Binary files a/textures/seeker.tga and b/textures/seeker.tga differ
index 84acdbc3eb3aaa05e7ebd752b9e80f9617536794..79acae87d3bb57273a92d795de47000366dc8a6e 100644 (file)
Binary files a/textures/seeker_glow.tga and b/textures/seeker_glow.tga differ
diff --git a/textures/seeker_pants.tga b/textures/seeker_pants.tga
deleted file mode 100644 (file)
index 471fe0c..0000000
Binary files a/textures/seeker_pants.tga and /dev/null differ
diff --git a/textures/seeker_shirt.tga b/textures/seeker_shirt.tga
new file mode 100644 (file)
index 0000000..471fe0c
Binary files /dev/null and b/textures/seeker_shirt.tga differ
index 863f3830b5588939a962f1fbccb5c12cb27b74c7..10e3c433c8c4209d54550b575adfd9011eaf3d71 100644 (file)
Binary files a/textures/shotgun2_glow.tga and b/textures/shotgun2_glow.tga differ
index 442ced63a698906dbc6a1590aefc4e1fda8f98d4..8bc227c20c4bded11eae9a2fef0236d7ce5159b4 100644 (file)
Binary files a/textures/shotgun2_shirt.tga and b/textures/shotgun2_shirt.tga differ
index bc74918718c1cab7839fc40ff1b343eeb64b360e..36ce078d00ce2a4f8d61845e77b6be70bb32b6a2 100644 (file)
Binary files a/textures/shotgun_sight.tga and b/textures/shotgun_sight.tga differ
diff --git a/textures/shotgun_sight_glow.tga b/textures/shotgun_sight_glow.tga
new file mode 100644 (file)
index 0000000..e432842
Binary files /dev/null and b/textures/shotgun_sight_glow.tga differ
index de6d9db3154cd66f59c4050565d236c44083055e..ee180f442a6901c84d14ce91c7225b64fe3349f0 100644 (file)
Binary files a/textures/uzi_glow.tga and b/textures/uzi_glow.tga differ
diff --git a/textures/uzi_pants.tga b/textures/uzi_pants.tga
deleted file mode 100644 (file)
index 62f6659..0000000
Binary files a/textures/uzi_pants.tga and /dev/null differ
index ac4ac0403b604db926967a280ee3e4c30cce11c6..345a8e7b8458729e2f16d2b0c83da7e76d011e3c 100644 (file)
 \cl_gunalign\Position of the weapon model; requires reconnect
 
 \crosshair_per_weapon\Set a different crosshair for each weapon, good if you play without weapon models
-\crosshair_color_override\Also set the color of the crosshair depending on the weapon you are currently holding
+\crosshair_color_per_weapon\Set the color of the crosshair depending on the weapon you are currently holding
 \crosshair_size\Adjust the size of the crosshair
-\crosshair_color_alpha\Adjust the opacity of the crosshair
-\crosshair_color_red\Red color component of the crosshair color
-\crosshair_color_green\Green color component of the crosshair color
-\crosshair_color_blue\Blue color component of the crosshair color
+\crosshair_alpha\Adjust the opacity of the crosshair
+\crosshair_color\Adjust the crosshair color
 \sbar_hudselector\Use the old HUD layout
 \XonoticMultiplayerDialog/Radar, HUD & Waypoints...\Adjust the radar, HUD and waypoints
 \_cl_name\Name under which you will appear in the game
@@ -97,8 +95,6 @@
 \m_pitch\Invert mouse movement on the Y-axis
 \vid_dgamouse\Make use of DGA mouse input
 \con_closeontoggleconsole\Allow the console toggling bind to also close the console
-\sbar_showbinds\Display actions / bound keys in the strings shown during the game
-\cl_showpressedkeys\Show which movement keys the player is pressing
 
 \XonoticSettingsDialog/Video\Video settings
 \vid_width\Screen resolution
 \showtime\Show current time of day, useful on screenshots
 \showdate\Show current date, useful on screenshots
 \showfps\Show your rendered frames per second
-\cl_showspeed\Show the speed of the player
-\cl_showspeed_unit\Select the unit used by the speedometer. qu/s = in/s
-\cl_showacceleration\Show the acceleration of the player
-\cl_showacceleration_scale\Excaggerate the accelerometer by this scale multiplier
 
 \XonoticSettingsDialog/Advanced settings...\Advanced settings where you can tweak every single variable of the game
 \g_friendlyfire\Percentage of damage dealt to teammates
 \g_mirrordamage\Percentage of teamdamage that will be mirrored to you
 \g_tdm_teams_override\Override the default amount of teams in teamgames
 
-\cl_teamradar_position\-
-\cl_teamradar_size\-
-\cl_teamradar_zoommode\-
-\cl_teamradar_rotation\-
-\cl_teamradar_scale\-
-\cl_teamradar_foreground_alpha\-
-\cl_teamradar_background_alpha\Opacity value of the radar background
 \viewsize\Enable/disable the HUD background
-\sbar_alpha_bg\Opacity value of the HUD background
-\sbar_color_bg_r\Red color component of the HUD background
-\sbar_color_bg_g\Green color component of the HUD background
-\sbar_color_bg_b\Blue color component of the HUD background
-\sbar_color_bg_team\Team color saturation of the HUD background
 \cl_hidewaypoints\Show various gametype specific waypoints
 \g_waypointsprite_scale\Scale multiplier of the waypoints
 \g_waypointsprite_alpha\Control transparency of the waypoints
index 00f0470cdccd97ec9f084a6736b749b26039c3c3..38371eca775dc8933fd400c6c89dffcf131d5ddb 100644 (file)
@@ -36,6 +36,7 @@ Jakob "tZork" Markström Gröhn
 mand1nga
 Merlijn Hofstra
 remaxim
+Stephan
 
 *Engine Code Additions & QA
 Rudolf "divVerent" Polzer