]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into mirceakitsune/damage_effects
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 21 May 2011 12:14:28 +0000 (15:14 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 21 May 2011 12:14:28 +0000 (15:14 +0300)
151 files changed:
_hud_descriptions.cfg
annoy_balance.cfg [deleted file]
balanceSamual.cfg
defaultXonotic.cfg
gfx/hud/default/nametag_statusbar.tga [new file with mode: 0644]
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/nametag_statusbar.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
physicsCPMA.cfg
physicsFruit.cfg
physicsHavoc.cfg
physicsLeeStricklin-ModdedFruit.cfg
physicsLeeStricklin.cfg
physicsLeeStricklinOld.cfg
physicsLzd.cfg
physicsNexuiz10.cfg
physicsNexuiz11.cfg
physicsNexuiz151.cfg
physicsNexuiz151b.cfg
physicsNexuiz16rc1.cfg
physicsNexuiz20.cfg
physicsNexuiz25.cfg
physicsNexuiz26.cfg
physicsNoQWBunny-nexbased.cfg
physicsQ.cfg
physicsQ2.cfg
physicsQ2a.cfg
physicsQ3.cfg
physicsQBF.cfg
physicsQBFplus.cfg
physicsSamual.cfg
physicsWarsow.cfg
physicsWarsowClassicBunny.cfg
physicsWarsowDev.cfg
physicsX.cfg [new file with mode: 0644]
physicsX0.cfg [deleted file]
physicsX010.cfg [new file with mode: 0644]
physicsXPM.cfg
physicsXPMLight.cfg
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_physics.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/ent_cs.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/playerstats.qc
qcsrc/server/progs.src
qcsrc/server/sv_stats.qc [deleted file]
qcsrc/server/t_teleporters.qc
qcsrc/server/todo.txt
textures/pickups.tga [deleted file]
textures/pickups_bump.tga [deleted file]
textures/pickups_gloss.tga [deleted file]
textures/pickups_glow.tga [deleted file]
tooltips.db

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 441b604020d6636fb1d90ea0ffcf1c25889d8765..f10c2600a1647758caa2b3e04a6890210c3ceffc 100644 (file)
@@ -110,13 +110,13 @@ set g_pickup_respawntimejitter_ammo 0
 // }}}
 
 // {{{ regen/rot
-set g_balance_health_regen 0
-set g_balance_health_regenlinear 5
+set g_balance_health_regen 0.08
+set g_balance_health_regenlinear 0.5
 set g_balance_pause_health_regen 5
 set g_balance_pause_health_regen_spawn 0
 set g_balance_health_rot 0.04
-set g_balance_health_rotlinear 1
-set g_balance_pause_health_rot 0.5
+set g_balance_health_rotlinear 0.75
+set g_balance_pause_health_rot 1
 set g_balance_pause_health_rot_spawn 5
 set g_balance_health_regenstable 100
 set g_balance_health_rotstable 100
@@ -124,7 +124,7 @@ set g_balance_health_limit 999
 set g_balance_armor_regen 0
 set g_balance_armor_regenlinear 0
 set g_balance_armor_rot 0.04
-set g_balance_armor_rotlinear 1
+set g_balance_armor_rotlinear 0.75
 set g_balance_pause_armor_rot 1
 set g_balance_pause_armor_rot_spawn 5
 set g_balance_armor_regenstable 100
@@ -215,7 +215,7 @@ set g_balance_grapplehook_health 130
 // {{{ laser
 set g_balance_laser_primary_damage 25
 set g_balance_laser_primary_edgedamage 12.5
-set g_balance_laser_primary_force 175
+set g_balance_laser_primary_force 250
 set g_balance_laser_primary_radius 70
 set g_balance_laser_primary_speed 6000
 set g_balance_laser_primary_spread 0
@@ -225,8 +225,8 @@ set g_balance_laser_primary_lifetime 5
 set g_balance_laser_primary_shotangle 0
 set g_balance_laser_primary_delay 0
 set g_balance_laser_primary_gauntlet 0
-set g_balance_laser_primary_force_zscale 2 // 350 upforce
-set g_balance_laser_primary_force_velocitybias 0.3
+set g_balance_laser_primary_force_zscale 1.5
+set g_balance_laser_primary_force_velocitybias 0
 set g_balance_laser_primary_force_other_scale 1
 set g_balance_laser_secondary 0 // when 1, a secondary laser mode exists
 set g_balance_laser_secondary_damage 25
@@ -286,14 +286,14 @@ set g_balance_uzi_burst_force 20
 set g_balance_uzi_burst_ammo 3
 
 set g_balance_uzi_first 1
-set g_balance_uzi_first_damage 18
-set g_balance_uzi_first_force 20
+set g_balance_uzi_first_damage 16
+set g_balance_uzi_first_force 5
 set g_balance_uzi_first_spread 0.03
 set g_balance_uzi_first_refire 0.2
 set g_balance_uzi_first_ammo 1
 
 set g_balance_uzi_sustained_damage 14
-set g_balance_uzi_sustained_force 20
+set g_balance_uzi_sustained_force 5
 set g_balance_uzi_sustained_spread 0.04
 set g_balance_uzi_sustained_refire 0.1
 set g_balance_uzi_sustained_ammo 1
@@ -406,13 +406,13 @@ set g_balance_electro_secondary_ammo 2
 set g_balance_electro_secondary_health 5
 set g_balance_electro_secondary_damageforcescale 4
 set g_balance_electro_secondary_count 3
-set g_balance_electro_secondary_bouncefactor 0.5
-set g_balance_electro_secondary_bouncestop 0.075
+set g_balance_electro_secondary_bouncefactor 0.4
+set g_balance_electro_secondary_bouncestop 0.05
 set g_balance_electro_combo_damage 40
 set g_balance_electro_combo_edgedamage 20
 set g_balance_electro_combo_force 120
 set g_balance_electro_combo_radius 175
-set g_balance_electro_combo_comboradius 250
+set g_balance_electro_combo_comboradius 275
 set g_balance_electro_combo_speed 2000
 set g_balance_electro_reload_ammo 0 //default: 20
 set g_balance_electro_reload_time 2
@@ -528,7 +528,7 @@ set g_balance_minstanex_laser_ammo 0
 set g_balance_minstanex_reload_ammo 0 //default: 50
 set g_balance_minstanex_reload_time 2
 // }}}
-// {{{ hagar // TO BE REMOVED
+// {{{ hagar
 set g_balance_hagar_primary_damage 30
 set g_balance_hagar_primary_edgedamage 15
 set g_balance_hagar_primary_force 50
@@ -539,17 +539,17 @@ 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 1
 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_hold 1
+set g_balance_hagar_secondary_load_releasedeath 0
 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
-set g_balance_hagar_secondary_radius 65
-set g_balance_hagar_secondary_spread 0.015
+set g_balance_hagar_secondary_damage 30
+set g_balance_hagar_secondary_edgedamage 15
+set g_balance_hagar_secondary_force 50
+set g_balance_hagar_secondary_radius 70
+set g_balance_hagar_secondary_spread 0.05
 set g_balance_hagar_secondary_speed 2000
 set g_balance_hagar_secondary_lifetime_min 10
 set g_balance_hagar_secondary_lifetime_rand 0
index 99dcfd6213e189c49c9c5ef3cdf22547027d2e63..fc5f98ef95bcc669860ec7eeb82f221cab9cf1a5 100644 (file)
@@ -219,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
@@ -416,6 +416,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
@@ -1203,9 +1205,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"
@@ -1439,10 +1438,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"
@@ -1450,13 +1455,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"
@@ -1485,6 +1501,21 @@ 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 (TODO), 2 = draw names of all enemies in view"
+seta hud_shownames_status 1 "1 = draw health/armor status of teammates"
+seta hud_shownames_statusbar_height 4 "height of status bar"
+seta hud_shownames_aspect 8 "aspect ratio of total drawing area per name"
+seta hud_shownames_fontsize 12 "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"
+seta hud_shownames_offset 52 "offset (along z-axis) tag from player origin by this many units"
+
 // scoreboard
 seta scoreboard_columns default
 seta scoreboard_border_thickness 1 "scoreboard border thickness"
@@ -1504,8 +1535,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"
@@ -1516,7 +1547,7 @@ seta accuracy_color2 "0 1 0"
 // for menu server list (eventually make them have engine support?)
 seta menu_slist_showfull 1 "show servers even if they are full and have no slots to join"
 seta menu_slist_showempty 1 "show servers even if they are no empty and have no opponents to play against"
-set menu_slist_modfilter "=" // set to either: !modname or modname. modname of = means "same as we are running now".
+seta menu_slist_modfilter "" // set to either: !modname or modname. modname of = means "same as we are running now".
 
 // for menu weapon arena
 set menu_weaponarena_with_laser 0 "also enable the Laser in this weapon arena"
@@ -1788,25 +1819,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."
@@ -2027,10 +2039,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
 
@@ -2119,9 +2127,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"
@@ -2131,7 +2143,7 @@ alias sRGBcorrect_off "r_texture_sRGB_skin_diffuse 0;r_texture_sRGB_skin_gloss 0
 exec balanceXonotic.cfg
 exec ctfscoring-ai.cfg
 exec effects-normal.cfg
-exec physicsX0.cfg
+exec physicsX.cfg
 exec turrets.cfg
 
 // hud cvar descriptions
diff --git a/gfx/hud/default/nametag_statusbar.tga b/gfx/hud/default/nametag_statusbar.tga
new file mode 100644 (file)
index 0000000..1f55921
Binary files /dev/null and b/gfx/hud/default/nametag_statusbar.tga differ
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/nametag_statusbar.tga b/gfx/hud/luminos/nametag_statusbar.tga
new file mode 100644 (file)
index 0000000..1f55921
Binary files /dev/null and b/gfx/hud/luminos/nametag_statusbar.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 cbfd802bbe83ac86e6f3c8bbcdd8141e3dee8dbe..620ec882e54d1f2b1d8108df6edf2d18afe5c8f3 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate 4
 sv_waterfriction 1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw 1
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 2.5
 sv_airstrafeaccelerate 70
 sv_maxairstrafespeed 30
index 6467afad4c3b13e354e3fc8ad6069c94194cd2a2..1afb26330c643725fee6695071bb881eaaddb625 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0 // breaks strafing?
 sv_airaccel_qw 0.92
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 2.5
 sv_airstrafeaccelerate 20
 sv_maxairstrafespeed 100
index a19617d93f89be9ef474bff4f7820936bb72920e..d78346e1b604f870bf9cacce45171215285fd1bf 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0.65
 sv_airaccel_qw 0.95
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index c3329426e1370368da1a0dbea20c03d8aa19501b..21bafef57c523cbbc9d08c579c618f83ca55e5d5 100644 (file)
@@ -20,6 +20,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0 // breaks strafing?
 sv_airaccel_qw -0.8
+sv_airaccel_qw_stretchfactor 0
 
 sv_airstopaccelerate -0.95
 sv_airstrafeaccelerate 24
index 2f23ae763dbdb30e0da4f093d4fe269dce4e6bcf..3c740da33733257b50e8a46af2167714c3dcf815 100644 (file)
@@ -20,6 +20,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw -0.8
+sv_airaccel_qw_stretchfactor 0
 
 sv_airstopaccelerate 3
 sv_airstrafeaccelerate 24
index bb6133a8b79f8b08fef018af239bc84425235b07..d240d991b3f55a812ab5bce0bda2c53f9942fa7e 100644 (file)
@@ -15,6 +15,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0 // pain in the ass to tweak without screwing up the strafing
 sv_airaccel_qw -0.93 //given a negative value to combat potential cheats, was told by divVerent not to mess with it
+sv_airaccel_qw_stretchfactor 0
 
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
index 01e446e8ba32c2219d4f366c94e8b307ce88fcc9..86b4bdcf024617699c1a7c8818349378e3e5b6e7 100644 (file)
@@ -14,6 +14,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0.35
 sv_airaccel_qw 0.95
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index de2ff2591250b235a69eea7525611167386cf78d..a6673a28e248cef489dcbc8bbfacefa2d1aeef12 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw 0
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index 64ac7b019cafcc6947711454fa968d39432ebd19..60459c37474067be06d5a1aed7c23cfd57df1ff5 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw 0
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index c527b29efb3489637e6defbbfdea9d460b404f59..b099d4cf34935bea0c778605abdb4f4b89e335b6 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw 0
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index aa2f530cdf6f782bafa86b1264a3f942cf8fb108..8821b5a319082f63b7f86150ebbde7f2d1385e1f 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw 0
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index 0622e1a48134efa1e984be177e67f30e9dc137d1..ff6343f781a3d72fea86a6a92466ecd6d1f3dbfd 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw 0
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index 1d15fe1d67be61adbdbf3c50b4fe89b8d6be3a72..0834bb5aa60c439bbd03a93420835934db5468a2 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0.3
 sv_airaccel_qw 0.93
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index 5b6db6b944c423b765a301238414d854ce41bf04..8c5ab5e851342b87146a95334ddf08dbc2c762ff 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0.35
 sv_airaccel_qw 0.95
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index f7661523ea146abdb371ee77589e5401600a641e..4e104d1aa99f2d71e76acc12bf5bb4f6fff618e6 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0.35
 sv_airaccel_qw 0.95
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index 2f12a4ebceb3ac7cea0e1ed94f7d7f1aa1ac2bf4..e74b332ede27e84f582a158e35a49bf1a61acbc2 100644 (file)
@@ -21,6 +21,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw -0.9475
+sv_airaccel_qw_stretchfactor 0
 
 sv_airstopaccelerate 3
 sv_airstrafeaccelerate 24
index 509310843b5e31ebbd5c6c18e56bd6291f0448b6..1eb53ab38321b709375486f6d3a8307323275901 100644 (file)
@@ -14,6 +14,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw 1
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index dc580a51190ead71c541fc9833e70c0e0449ccf0..2e3c0af6f310e4c6e5dfa3d94bccb02688782ab7 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate -1
 sv_waterfriction 1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw 1
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index c5f21116ec9a4bff476338502dace8b7a9937a8b..2d223a2051ea58977e84391c7d8f20059b3dba38 100644 (file)
@@ -14,6 +14,7 @@ sv_wateraccelerate -1
 sv_waterfriction 1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw 1
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index a50427155e11414f2d3362960165284e1cb2344b..b3fdf41a82982855ae253933cbae7982d7906b9c 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate 4
 sv_waterfriction 1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw 1
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index 9725e8cc4a207e12d49789ea413ba09ddcc35707..390cb968ad31ed8867763a41830aa302e0d5f238 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0.8
 sv_airaccel_qw 1
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index 75c70c1818bec4bac9ef7dae8f2e361412a39e63..8c1a78f3b9f80d4b613361f8503813a95c266b07 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0.5
 sv_airaccel_qw 0.93
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index 731b1482e6ddae0e04cc904cdebe671ba55c107f..178eed0aedfa79ffc9f58dca509387eaad43bbde 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate -1
 sv_waterfriction -1
 sv_airaccel_sideways_friction 0.3
 sv_airaccel_qw 0.93
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 0
 sv_airstrafeaccelerate 0
 sv_maxairstrafespeed 0
index 068d22ce67c7387e0b4ec3574dd434df246899c7..6cae75a7977759b1510ecec9ec60fb8ae321100d 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate 10
 sv_waterfriction 1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw 1
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 2.5
 sv_airstrafeaccelerate 70
 sv_maxairstrafespeed 30
index 72ca9ffcae73a43a275813ab8865ca882290c7ab..5c0c81c8fb8408593b6e12170d366b1a9631b771 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate 10
 sv_waterfriction 1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw 1
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 2.5
 sv_airstrafeaccelerate 70
 sv_maxairstrafespeed 30
index 051775de9a900680e0ab37949b827f1d798387a7..0c30fcd9a0de82ada7acb5a922cc8097c5ab1b5d 100644 (file)
@@ -13,6 +13,7 @@ sv_wateraccelerate 10
 sv_waterfriction 1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw 1
+sv_airaccel_qw_stretchfactor 0
 sv_airstopaccelerate 2
 sv_airstrafeaccelerate 70
 sv_maxairstrafespeed 30
diff --git a/physicsX.cfg b/physicsX.cfg
new file mode 100644 (file)
index 0000000..5cc6b52
--- /dev/null
@@ -0,0 +1,42 @@
+// current Xonotic physics
+sv_gravity 800
+sv_maxspeed 360
+sv_maxairspeed 360
+
+sv_stopspeed 100
+sv_accelerate 15
+sv_airaccelerate 2
+sv_friction 8
+edgefriction 1
+sv_stepheight 26
+// Q1: 16+2
+// Nex: 32+2
+// we try: 24+2
+
+// actually, what we want is 266.6666 for 180bpm
+// but 260 takes same amount of frames and is nicer to mappers
+sv_jumpvelocity 260
+sv_wateraccelerate -1
+sv_waterfriction -1
+sv_airaccel_sideways_friction 0
+sv_airaccel_qw -0.8
+sv_airaccel_qw_stretchfactor 2
+
+sv_airstopaccelerate 3
+sv_airstrafeaccelerate 24
+sv_maxairstrafespeed 100
+sv_airstrafeaccel_qw -0.95
+sv_aircontrol 125
+sv_aircontrol_penalty 180
+sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 800
+sv_warsowbunny_turnaccel 0
+sv_warsowbunny_accel 0.1593
+sv_warsowbunny_topspeed 925
+sv_warsowbunny_backtosideratio 0.8
+sv_friction_on_land 0
+sv_doublejump 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
+sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 0
diff --git a/physicsX0.cfg b/physicsX0.cfg
deleted file mode 100644 (file)
index f1e4abc..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-// "NoQWBunny" physics based on XPM
-sv_gravity 800
-sv_maxspeed 360
-sv_maxairspeed 360
-
-sv_stopspeed 100
-sv_accelerate 15
-sv_airaccelerate 2
-sv_friction 8
-edgefriction 1
-sv_stepheight 26
-// Q1: 16+2
-// Nex: 32+2
-// we try: 24+2
-
-// actually, what we want is 266.6666 for 180bpm
-// but 260 takes same amount of frames and is nicer to mappers
-sv_jumpvelocity 260
-sv_wateraccelerate -1
-sv_waterfriction -1
-sv_airaccel_sideways_friction 0
-sv_airaccel_qw -0.8
-
-sv_airstopaccelerate 3
-sv_airstrafeaccelerate 24
-sv_maxairstrafespeed 100
-sv_airstrafeaccel_qw -0.95
-sv_aircontrol 125
-sv_aircontrol_penalty 180
-sv_aircontrol_power 2
-sv_airspeedlimit_nonqw 700
-sv_warsowbunny_turnaccel 0
-sv_warsowbunny_accel 0.1593
-sv_warsowbunny_topspeed 925
-sv_warsowbunny_backtosideratio 0.8
-sv_friction_on_land 0
-sv_doublejump 0
-sv_jumpspeedcap_min ""
-sv_jumpspeedcap_max ""
-sv_jumpspeedcap_max_disable_on_ramps 1
-g_teleport_maxspeed 0
diff --git a/physicsX010.cfg b/physicsX010.cfg
new file mode 100644 (file)
index 0000000..bda6272
--- /dev/null
@@ -0,0 +1,42 @@
+// Xonotic 0.1.0preview physics
+sv_gravity 800
+sv_maxspeed 360
+sv_maxairspeed 400
+
+sv_stopspeed 100
+sv_accelerate 15
+sv_airaccelerate 2
+sv_friction 8
+edgefriction 1
+sv_stepheight 26
+// Q1: 16+2
+// Nex: 32+2
+// we try: 24+2
+
+// actually, what we want is 266.6666 for 180bpm
+// but 260 takes same amount of frames and is nicer to mappers
+sv_jumpvelocity 260
+sv_wateraccelerate -1
+sv_waterfriction -1
+sv_airaccel_sideways_friction 0
+sv_airaccel_qw -0.8
+sv_airaccel_qw_stretchfactor 0
+
+sv_airstopaccelerate 3
+sv_airstrafeaccelerate 24
+sv_maxairstrafespeed 100
+sv_airstrafeaccel_qw -0.95
+sv_aircontrol 125
+sv_aircontrol_penalty 150
+sv_aircontrol_power 2
+sv_airspeedlimit_nonqw 800
+sv_warsowbunny_turnaccel 0
+sv_warsowbunny_accel 0.1593
+sv_warsowbunny_topspeed 925
+sv_warsowbunny_backtosideratio 0.8
+sv_friction_on_land 0
+sv_doublejump 0
+sv_jumpspeedcap_min ""
+sv_jumpspeedcap_max ""
+sv_jumpspeedcap_max_disable_on_ramps 1
+g_teleport_maxspeed 0
index e4ba14a56234aa12208ac83a5f7901b2eecbb8af..f781539485bc37246caaa6d8392d14abb8e360ef 100644 (file)
@@ -16,6 +16,7 @@ sv_wateraccelerate 4
 sv_waterfriction 1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw 0.95
+sv_airaccel_qw_stretchfactor 0
 // CPMA: 1
 sv_airstopaccelerate 2.5
 sv_airstrafeaccelerate 70
index 3e7ee55570fa21cc92fa488a4aaae9b3a99336a4..3a8b8e1503f7e2819d434becb7d55b0c826da051 100644 (file)
@@ -16,6 +16,8 @@ sv_wateraccelerate 4
 sv_waterfriction 1
 sv_airaccel_sideways_friction 0
 sv_airaccel_qw -0.9146875
+sv_airaccel_qw_stretchfactor 0
+sv_airaccel_qw_stretchfactor 0
 // CPMA: 1
 sv_airstopaccelerate 6.5625 // matches strafe-stopping speed
 sv_airstrafeaccelerate 14
index 1328147c77eed637ff7d585780a07613c616cbdf..211191bc738640f93356ea2a99622c0ab2ef592f 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,17 +654,38 @@ 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()
 {
+       float sf;
        InterpolateOrigin_Undo();
 
        self.classname = "entcs_receiver";
-       self.sv_entnum = ReadByte() - 1;
-       self.origin_x = ReadShort();
-       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;
+       sf = ReadByte();
+
+       if(sf & 1)
+               self.sv_entnum = ReadByte();
+       if(sf & 2)
+       {
+               self.origin_x = ReadShort();
+               self.origin_y = ReadShort();
+               self.origin_z = ReadShort();
+       }
+       if(sf & 4)
+       {
+               self.angles_y = ReadByte() * 360.0 / 256;
+               self.angles_x = self.angles_z = 0;
+       }
+       if(sf & 8)
+               self.healthvalue = ReadByte() * 10;
+       if(sf & 16)
+               self.armorvalue = ReadByte() * 10;
+
+       entcs_receiver[self.sv_entnum] = self;
+       self.entremove = Ent_RemoveEntCS;
 
        InterpolateOrigin_Note();
 }
@@ -694,7 +719,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 +792,6 @@ void Ent_ReadTeamScore()
        HUD_UpdateTeamPos(o);
 }
 
-void Net_Reset()
-{
-}
-
 void Ent_ClientData()
 {
        float f;
@@ -808,6 +830,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;
 }
 
@@ -908,7 +939,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;
                }
@@ -947,7 +979,8 @@ void(float bIsNewEntity) CSQC_Ent_Update =
                case ENT_CLIENT_ACCURACY: Ent_ReadAccuracy(); break;
                case ENT_CLIENT_DAMAGEEFFECT: Ent_DamageEffect(); 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;
        }
 
@@ -977,15 +1010,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");
@@ -1394,7 +1418,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);
@@ -1412,7 +1436,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;
                        }
 
                }
@@ -1420,12 +1444,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 f1352472bc64cbd2e22db7cac0c64e984721d39b..029b9460f6f7f7209727efc0019b039fbd9ff77d 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;
@@ -864,6 +861,7 @@ void CSQC_UpdateView(float w, float h)
                if(self.draw2d)
                        self.draw2d();
        self = e;
+       Draw_ShowNames_All();
 
        scoreboard_active = HUD_WouldDrawScoreboard();
 
@@ -906,7 +904,7 @@ void CSQC_UpdateView(float w, float h)
                                CSQC_common_hud();
 
                // crosshair goes VERY LAST
-               if(!scoreboard_active && !camera_active && intermission != 2) {
+               if(!scoreboard_active && !camera_active && intermission != 2 && spectatee_status != -1) {
                        string wcross_style;
                        float wcross_alpha, wcross_resolution;
                        wcross_style = autocvar_crosshair;
@@ -1605,7 +1603,6 @@ const float STAT_VEHICLESTAT_RELOAD2 = 66;
 
 }
 
-
 void CSQC_common_hud(void)
 {
        // HUD_SortFrags(); done in HUD_Draw
index 3294a896834973b9e54795fc53bd631b9717a608..262abbe44e7124bdb6eccb46a9d9db18a859e1fb 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;
@@ -212,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;
@@ -239,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;
@@ -269,6 +278,20 @@ 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_statusbar_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;
+float autocvar_hud_shownames_offset;
 string autocvar_hud_skin;
 float autocvar_loddebug;
 float autocvar_menu_mouse_speed;
index 6a5536bcda95e0035ef23dbdb72d4c50d59b2512..91256b9c5d566bb9d1d900368ceb53688992766e 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 (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 (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 >= 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);
+                       theSize_y *= 0.5;
+                       if (length_ratio > 0)
+                               theOrigin_y += theSize_y;
                        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);
-}
-
-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
+               theSize_y *= length_ratio;
 
-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;
+                       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);
                }
-       }
-       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;
-               }
-               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;
-
-                       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)
-               {
-                       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;
-}
+               theSize_x *= length_ratio;
 
-// 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)
+               vector bW;
+               width = eX * theSize_x;
+               height = eY * theSize_y;
+               if(theSize_x <= theSize_y * 2)
                {
-                       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;
@@ -2010,26 +1088,67 @@ void HUD_Ammo(void)
                                return;
                        }
                }
-               return; // nothing to display
-       }
+               return; // nothing to display
+       }
+
+       stat_items = getstati(STAT_ITEMS);
+       for (i = 0; i < AMMO_COUNT; ++i) {
+               currently_selected = stat_items & GetAmmoItemCode(i);
+               DrawAmmoItem(pos + eX * column * (ammo_size_x + offset_x) + eY * row * (ammo_size_y + offset_y), ammo_size, i, currently_selected);
+               ++row;
+               if(row >= rows)
+               {
+                       row = 0;
+                       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;
+               }
 
-       stat_items = getstati(STAT_ITEMS);
-       for (i = 0; i < AMMO_COUNT; ++i) {
-               currently_selected = stat_items & GetAmmoItemCode(i);
-               DrawAmmoItem(pos + eX * column * (ammo_size_x + offset_x) + eY * row * (ammo_size_y + offset_y), ammo_size, i, currently_selected);
-               ++row;
-               if(row >= rows)
+               if(icon_right_align)
                {
-                       row = 0;
-                       column = column + 1;
+                       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,
@@ -3616,17 +2573,144 @@ void HUD_Radar(void)
        }
        draw_teamradar_player(view_origin, view_angles, '1 1 1');
 
-       drawresetcliparea();
-};
+       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 vector fontsize = '1 1 0' * (mySize_y/entries);
+
+       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)
+       {
+               float players_per_team;
+               if (team_count)
+               {
+                       // show team scores in the first line
+                       float score_size = mySize_x / team_count;
+                       players_per_team = max(2, ceil((entries - 1) / team_count));
+                       for(i=0; i<team_count; ++i) {
+                               if (i == floor((entries - 2) / players_per_team) || (entries == 1 && i == 0))
+                                       HUD_Panel_DrawHighlight(pos + eX * score_size * i, eX * score_size + eY * fontsize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+                               drawstring_aspect(pos + eX * score_size * i, ftos(175 - 23*i), eX * score_size + eY * fontsize_y, GetTeamRGB(ColorByTeam(i)) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
+                       }
+                       first_pl = 1;
+                       pos_y += fontsize_y;
+               }
+               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, eX * mySize_x + eY * fontsize_y, 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(floor((i - first_pl) / players_per_team))) * 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 += fontsize_y;
+               }
+               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 + eX * score_size * i, eX * score_size + eY * fontsize_y, '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 += fontsize_y;
+               tm = teams.sort_next;
+       }
+       i = first_pl;
+
+       do
+       for (pl = players.sort_next; pl && i<entries; pl = pl.sort_next)
+       {
+               if ((team_count && pl.team != tm.team) || 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;
+               }
+
+               if (pl == me)
+               {
+                       if (i == first_pl)
+                               rgb = '0 1 0'; //first: green
+                       me_printed = 1;
+                       drawfill(pos, eX * mySize_x + eY * fontsize_y, 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 += fontsize_y;
+               ++i;
+       }
+       while (i<entries && team_count && (tm = tm.sort_next) && (tm.team != COLOR_SPECTATOR || (tm = tm.sort_next)));
+}
 
-// 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 +2723,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 +2763,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 +2784,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 +2884,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 +3040,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 +3066,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 +3087,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 +3578,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 +3734,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 +3880,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 +3890,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 +3936,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 +3993,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 +4004,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 +4014,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 +4031,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 +4093,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;
@@ -4879,16 +4138,14 @@ void HUD_InfoMessages(void)
        fontsize = '0.20 0.20 0' * mySize_y;
        
        float a;
-       if(spectatee_status != 0)
-               a = 1;
-       else
-               a = panel_fg_alpha;
+       a = panel_fg_alpha;
 
        string s;
        if(!autocvar__hud_configure)
        {
                if(spectatee_status && !intermission)
                {
+                       a = 1;
                        if(spectatee_status == -1)
                                s = _("^1Observing");
                        else
@@ -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)
@@ -5169,12 +4560,21 @@ void HUD_Main (void)
                hud_fade_alpha = (1 - scoreboard_fade_alpha);
 
        if(intermission == 2) // no hud during mapvote
+       {
+               if (autocvar__hud_configure) //force exit from hud config
+               {
+                       if (menu_enabled)
+                       {
+                               menu_enabled = 0;
+                               localcmd("togglemenu\n");
+                       }
+                       cvar_set("_hud_configure", "0");
+               }
                hud_fade_alpha = 0;
+       }
        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 +4589,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 +4644,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 +4693,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..28d0d16
--- /dev/null
@@ -0,0 +1,190 @@
+// 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(entity ent)
+{
+       if(!autocvar_hud_shownames)
+               return;
+
+       if(ent.sv_entnum == player_localentnum && !autocvar_chase_active)
+               return;
+
+       if(ent.sameteam || (!ent.sameteam && autocvar_hud_shownames_enemies))
+       {
+               ent.origin_z += autocvar_hud_shownames_offset;
+
+               if(!ent.sameteam)
+               {
+                       /* WIP, why does trace_ent != ent 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 != ent)
+                          return;
+                          }*/
+
+                       traceline(ent.origin, view_origin, 1, ent);
+               }
+
+               vector o, eo;
+               o = project_3d_to_2d(ent.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 == ent)
+                                       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(ent.origin - view_origin) > vlen(e.origin - view_origin))
+                                       {
+                                               overlap = TRUE;
+                                               break;
+                                       }
+                               }
+                       }
+               }
+
+               if(!ent.sameteam && trace_endpos != view_origin) // out of view, fade out
+                       ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * frametime);
+               else if(ent.healthvalue < 1) // dead player, fade out slowly
+                       ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * 0.25 * frametime);
+               else if(overlap) // tag overlap detected, fade out
+                       ent.alpha = max(0, ent.alpha - SHOWNAMES_FADESPEED * frametime);
+               else // fade in
+                       ent.alpha = min(1, ent.alpha + SHOWNAMES_FADESPEED * frametime);
+
+               if(!ent.alpha)
+                       return;
+
+               float dist;
+               dist = vlen(ent.origin - view_origin);
+
+               float a;
+               a = autocvar_hud_shownames_alpha;
+               a *= ent.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_fontsize;
+                       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 namepos; // this is where the origin of the string
+                       float namewidth;
+
+                       namepos = myPos;
+                       namewidth = mySize_x;
+
+                       if(autocvar_hud_shownames_status && teamplay)
+                       {
+                               if(ent.sameteam)
+                               {
+                                       if(ent.healthvalue > 0)
+                                       {
+                                               HUD_Panel_DrawProgressBar(namepos + '0 1 0' * autocvar_hud_shownames_fontsize * resize, eX * 0.5 * mySize_x + eY * resize * autocvar_hud_shownames_statusbar_height, "nametag_statusbar", ent.healthvalue/autocvar_hud_panel_healtharmor_maxhealth, 0, 1, '1 0 0', a, DRAWFLAG_NORMAL);
+
+                                               if(ent.armorvalue > 0)
+                                                       HUD_Panel_DrawProgressBar(namepos + '0 1 0' * autocvar_hud_shownames_fontsize * resize + eX * 0.5 * mySize_x, eX * 0.5 * mySize_x + eY * resize * autocvar_hud_shownames_statusbar_height, "nametag_statusbar", ent.armorvalue/autocvar_hud_panel_healtharmor_maxarmor, 0, 0, '0 1 0', a, DRAWFLAG_NORMAL);
+                                       }
+                               }
+                       }
+
+                       string s;
+                       s = GetPlayerName(ent.sv_entnum-1);
+                       if((autocvar_hud_shownames_decolorize == 1 && teamplay) || autocvar_hud_shownames_decolorize == 2)
+                               s = playername(s, GetPlayerColor(ent.sv_entnum-1));
+
+                       drawfontscale = '1 1 0' * resize;
+                       s = textShortenToWidth(s, namewidth, '1 1 0' * autocvar_hud_shownames_fontsize, stringwidth_colors);
+
+                       float width;
+                       width = stringwidth(s, TRUE, '1 1 0' * autocvar_hud_shownames_fontsize);
+
+                       if (width != namewidth)
+                               namepos_x += (namewidth - width) / 2;
+                       drawcolorcodedstring(namepos, s, '1 1 0' * autocvar_hud_shownames_fontsize, a, DRAWFLAG_NORMAL);
+                       drawfontscale = '1 1 0';
+               }
+       }
+}
+
+entity shownames_ent[255];
+void Draw_ShowNames_All()
+{
+       float i;
+       for(i = 0; i < maxclients; ++i)
+       {
+               vector o;
+               float t;
+               t = GetPlayerColor(i);
+               if(t == COLOR_SPECTATOR)
+                       continue;
+
+               entity e;
+               e = shownames_ent[i];
+               if(!e)
+               {
+                       e = spawn();
+                       e.classname = "shownames_tag";
+                       e.sv_entnum = i+1;
+                       shownames_ent[i] = e;
+               }
+
+               entity entcs;
+               entcs = entcs_receiver[i];
+               if(entcs)
+               {
+                       e.healthvalue = entcs.healthvalue;
+                       e.armorvalue = entcs.armorvalue;
+                       e.sameteam = 1; /* (teamplay && (t == myteam)); */
+               }
+               else
+               {
+                       e.healthvalue = 2342;
+                       e.armorvalue = 0;
+                       e.sameteam = 0;
+               }
+
+               e.origin = getplayerorigin(i);
+               if(e.origin == GETPLAYERORIGIN_ERROR)
+                       continue;
+
+               Draw_ShowNames(e);
+       }
+}
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 96757d25732a21a7c28758843d88af80fef629be..6d8591237993c863ad55f2bbf3153f1f5df5a3da 100644 (file)
@@ -114,8 +114,9 @@ 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_DAMAGEEFFECT = 32;
+const float ENT_CLIENT_SHOWNAMES = 31;
+const float ENT_CLIENT_WARPZONE_TELEPORTED = 32;
+const float ENT_CLIENT_DAMAGEEFFECT = 33;
 
 const float ENT_CLIENT_TURRET = 40;
 
@@ -358,6 +359,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
 
@@ -632,7 +639,6 @@ 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;
 float HUD_PANEL_POWERUPS       = 2;
@@ -648,7 +654,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";
@@ -665,6 +672,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 8135b999667742349f024ff923ff04b753e0b69c..dd1a484b1523317d94ec53947b4c096185921570 100644 (file)
@@ -1118,6 +1118,7 @@ float autocvar_sv_accelerate;
 var float autocvar_sv_accuracy_data_share = 1;
 string autocvar_sv_adminnick;
 float autocvar_sv_airaccel_qw;
+float autocvar_sv_airaccel_qw_stretchfactor;
 float autocvar_sv_airaccel_sideways_friction;
 float autocvar_sv_airaccelerate;
 float autocvar_sv_aircontrol;
@@ -1127,7 +1128,6 @@ float autocvar_sv_airspeedlimit_nonqw;
 float autocvar_sv_airstopaccelerate;
 float autocvar_sv_airstrafeaccel_qw;
 float autocvar_sv_airstrafeaccelerate;
-float autocvar_sv_allow_shownames;
 float autocvar_sv_autoscreenshot;
 float autocvar_sv_cheats;
 float autocvar_sv_curl_serverpackages_auto;
index 0a56c7e4595a1e7ef731436628b6967200427282..dda18b9ad51e09cde85d3a33a8a1dd3672048780 100644 (file)
@@ -333,7 +333,7 @@ entity SelectSpawnPoint (float anypoint)
                {
                        // we request a spawn for a team, and we have team
                        // spawns, but that team has no spawns?
-                       if(have_team_spawns[0])
+                       if(have_team_spawns_forteam[0])
                                // try noteam spawns
                                teamcheck = 0;
                        else
@@ -343,7 +343,7 @@ entity SelectSpawnPoint (float anypoint)
                else
                        teamcheck = self.team; // MUST be team
        }
-       else if(have_team_spawns == 0 && have_team_spawns[0])
+       else if(have_team_spawns == 0 && have_team_spawns_forteam[0])
                teamcheck = 0; // MUST be noteam
        else
                teamcheck = -1;
@@ -1527,6 +1527,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;
@@ -1702,8 +1703,7 @@ void ClientConnect (void)
                ctf_clientconnect();
        }*/
 
-       if(teams_matter || radar_showennemies)
-               attach_entcs();
+       attach_entcs();
 
        bot_relinkplayerlist();
 
@@ -1768,9 +1768,10 @@ 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();
 
-       CheatInitClient();
+       if (g_domination)
+               set_dom_state(self);
 
-       PlayerStats_AddPlayer(self);
+       CheatInitClient();
 }
 
 /*
@@ -1781,7 +1782,6 @@ Called when a client disconnects from the server
 =============
 */
 .entity chatbubbleentity;
-.entity teambubbleentity;
 void ReadyCount();
 void ClientDisconnect (void)
 {
@@ -1835,9 +1835,6 @@ void ClientDisconnect (void)
        if (self.chatbubbleentity)
                remove (self.chatbubbleentity);
 
-       if (self.teambubbleentity)
-               remove (self.teambubbleentity);
-
        if (self.killindicator)
                remove (self.killindicator);
 
@@ -1918,52 +1915,6 @@ void UpdateChatBubble()
 }
 
 
-void TeamBubbleThink()
-{
-       self.nextthink = time;
-       if (!self.owner.modelindex || self.owner.teambubbleentity != self)
-       {
-               if(self.owner) // but why can that ever be world?
-                       self.owner.teambubbleentity = world;
-               remove(self);
-               return;
-       }
-//     setorigin(self, self.owner.origin + '0 0 15' + self.owner.maxs_z * '0 0 1');  // bandwidth hog. setattachment does this now
-       if (self.owner.BUTTON_CHAT || self.owner.deadflag || self.owner.killindicator)
-               self.model = "";
-       else
-               self.model = self.mdl;
-
-};
-
-float TeamBubble_customizeentityforclient()
-{
-       return (self.owner != other && self.owner.team == other.team && other.killcount > -666);
-}
-
-void UpdateTeamBubble()
-{
-       if (!self.modelindex || !teams_matter)
-               return;
-       // spawn a teambubble entity if needed
-       if (!self.teambubbleentity && teams_matter)
-       {
-               self.teambubbleentity = spawn();
-               self.teambubbleentity.owner = self;
-               self.teambubbleentity.exteriormodeltoclient = self;
-               self.teambubbleentity.think = TeamBubbleThink;
-               self.teambubbleentity.nextthink = time;
-               setmodel(self.teambubbleentity, "models/misc/teambubble.spr"); // precision set below
-//             setorigin(self.teambubbleentity, self.origin + '0 0 15' + self.maxs_z * '0 0 1');
-               setorigin(self.teambubbleentity, '0 0 15' + self.maxs_z * '0 0 1');
-               setattachment(self.teambubbleentity, self, "");  // sticks to moving player better, also conserves bandwidth
-               self.teambubbleentity.mdl = self.teambubbleentity.model;
-               self.teambubbleentity.model = self.teambubbleentity.mdl;
-               self.teambubbleentity.customizeentityforclient = TeamBubble_customizeentityforclient;
-               self.teambubbleentity.effects = EF_LOWPRECISION;
-       }
-}
-
 // LordHavoc: this hack will be removed when proper _pants/_shirt layers are
 // added to the model skins
 /*void UpdateColorModHack()
@@ -2721,9 +2672,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;
@@ -3094,7 +3042,6 @@ void PlayerPostThink (void)
        if(self.classname == "player") {
                CheckRules_Player();
                UpdateChatBubble();
-               UpdateTeamBubble();
                if (self.impulse)
                        ImpulseCommands();
                if (intermission_running)
index 08368676d0055791a10e7d6a9c7135a5ff568ceb..e986341cd027eb11b5904f5542d5ab833e8a2ea9 100644 (file)
@@ -504,7 +504,7 @@ float AdjustAirAccelQW(float accelqw, float factor)
 //   sv_airaccel_sideways_friction 0
 //   prvm_globalset server speedclamp_mode 1
 //     (or 2)
-void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float accel, float accelqw, float sidefric, float speedlimit)
+void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float accel, float accelqw, float stretchfactor, float sidefric, float speedlimit)
 {
        float vel_straight;
        float vel_z;
@@ -516,8 +516,14 @@ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float acce
        float vel_xy_backward, vel_xy_forward;
        float speedclamp;
 
-       speedclamp = (accelqw < 0);
-       if(speedclamp)
+       if(stretchfactor > 0)
+               speedclamp = stretchfactor;
+       else if(accelqw < 0)
+               speedclamp = 1; // full clamping, no stretch
+       else
+               speedclamp = -1; // no clamping
+
+       if(accelqw < 0)
                accelqw = -accelqw;
 
        if(autocvar_sv_gameplayfix_q2airaccelerate)
@@ -560,12 +566,16 @@ void PM_Accelerate(vector wishdir, float wishspeed, float wishspeed0, float acce
        
        vel_xy = vel_straight * wishdir + vel_perpend;
        
-       if(speedclamp)
+       if(speedclamp >= 0)
        {
-               // ensure we don't get too fast or decelerate faster than we should
-               vel_xy_current = min(vlen(vel_xy), vel_xy_forward);
-               if(vel_xy_current > 0) // prevent division by zero
-                       vel_xy = normalize(vel_xy) * vel_xy_current;
+               float vel_xy_preclamp;
+               vel_xy_preclamp = vlen(vel_xy);
+               if(vel_xy_preclamp > 0) // prevent division by zero
+               {
+                       vel_xy_current += (vel_xy_forward - vel_xy_current) * speedclamp;
+                       if(vel_xy_current < vel_xy_preclamp)
+                               vel_xy = vel_xy * (vel_xy_current / vel_xy_preclamp);
+               }
        }
 
        self.velocity = vel_xy + vel_z * '0 0 1';
@@ -967,7 +977,7 @@ void SV_PlayerPhysics()
                if (wishspeed > self.stat_sv_maxspeed*maxspd_mod)
                        wishspeed = self.stat_sv_maxspeed*maxspd_mod;
                if (time >= self.teleport_time)
-                       PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
+                       PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0, 0);
        }
        else if (self.waterlevel >= WATERLEVEL_SWIMMING)
        {
@@ -990,7 +1000,7 @@ void SV_PlayerPhysics()
                self.velocity = self.velocity * (1 - frametime * autocvar_sv_friction);
 
                // water acceleration
-               PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
+               PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0, 0);
        }
        else if (time < self.ladder_time)
        {
@@ -1040,7 +1050,7 @@ void SV_PlayerPhysics()
                if (time >= self.teleport_time)
                {
                        // water acceleration
-                       PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
+                       PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0, 0);
                }
        }
        else if ((self.items & IT_JETPACK) && self.BUTTON_HOOK && (!autocvar_g_jetpack_fuel || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO))
@@ -1200,7 +1210,7 @@ void SV_PlayerPhysics()
                if (self.crouch)
                        wishspeed = wishspeed * 0.5;
                if (time >= self.teleport_time)
-                       PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0);
+                       PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0, 0);
        }
        else
        {
@@ -1271,7 +1281,7 @@ void SV_PlayerPhysics()
                        if(autocvar_sv_warsowbunny_turnaccel && accelerating && self.movement_y == 0 && self.movement_x != 0)
                                PM_AirAccelerate(wishdir, wishspeed);
                        else
-                               PM_Accelerate(wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, autocvar_sv_airaccel_sideways_friction / maxairspd, self.stat_sv_airspeedlimit_nonqw);
+                               PM_Accelerate(wishdir, wishspeed, wishspeed0, airaccel, airaccelqw, autocvar_sv_airaccel_qw_stretchfactor, autocvar_sv_airaccel_sideways_friction / maxairspd, self.stat_sv_airspeedlimit_nonqw);
 
                        if(autocvar_sv_aircontrol)
                                CPM_PM_Aircontrol(wishdir, wishspeed2);
index 690cf1271f41f69c1fa4c33bf9abf8ad5a57da19..00810d2a0e09fede1e63b6958ea22eb106221171 100644 (file)
@@ -610,8 +610,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);
                }
@@ -741,154 +739,6 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
        }
 }
 
-float UpdateSelectedPlayer_countvalue(float v)
-{
-       return max(0, (v - 1.0) / 0.5);
-}
-
-// returns: -2 if no hit, otherwise cos of the angle
-// uses the global v_angle
-float UpdateSelectedPlayer_canSee(entity p, float mincosangle, float maxdist)
-{
-       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;
-       }
-}
-
-void UpdateSelectedPlayer()
-{
-       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.selected_player)
-               self.last_selected_player = self.selected_player;
-}
-
 .float muted; // to be used by prvm_edictset server playernumber muted 1
 float Say(entity source, float teamsay, entity privatesay, string msgin, float floodcontrol)
 // message "": do not say, just test flood control
index ace69efbec371611a95e109a4e4fe90002468253..cab6ec6e75c5adcb56a8d7b07b417875a2a251c6 100644 (file)
@@ -348,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);
 
index 08b1ec3ba38aeeb4229e23ab0e7b94f1e201322d..4233e7d92d755b7651a60362f27080c192e888c7 100644 (file)
@@ -1257,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
@@ -1269,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 13447e027c3076135e211157d1719da88c22fedc..dc4d146168c88752e4dfe9511a67ec8b0919e2c0 100644 (file)
@@ -313,7 +313,6 @@ float default_weapon_alpha;
 .float cvar_cl_handicap;
 .float cvar_cl_playerdetailreduction;
 .float cvar_scr_centertime;
-.float cvar_cl_shownames;
 .string cvar_g_xonoticversion;
 .string cvar_cl_weaponpriority;
 .string cvar_cl_weaponpriorities[10];
@@ -365,15 +364,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);
 
index de18bfdd5c0a2e97b8ec5b1ea9c88e97ae4eca76..b58c0f074fd052ba8824c007d89293247d5ea686 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_REALCLIENT(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);
 };
 
index bee79d682e9e2d5d4ad31cd84a8c0231b788187c..3ffcb3b3868aa23f16e7628ab816fbb75a5a1ea7 100644 (file)
@@ -31,7 +31,7 @@ float entcs_customize()
        if(other == o)
                return FALSE;
        if(other.classname == "player")
-               if(o.team != other.team)
+               if(!teams_matter || o.team != other.team)
                        if not (radar_showennemies)
                                return FALSE;
        return TRUE;
@@ -39,29 +39,51 @@ float entcs_customize()
 
 float entcs_send(entity to, float sf)
 {
-       entity o;
-       o = self.owner;
        WriteByte(MSG_ENTITY, ENT_CLIENT_ENTCS);
-       WriteByte(MSG_ENTITY, num_for_edict(o));
-       WriteShort(MSG_ENTITY, o.origin_x);
-       WriteShort(MSG_ENTITY, o.origin_y);
-       WriteShort(MSG_ENTITY, o.origin_z);
-       WriteByte(MSG_ENTITY, o.angles_y * 256.0 / 360);
+       WriteByte(MSG_ENTITY, sf);
+       if(sf & 1)
+               WriteByte(MSG_ENTITY, num_for_edict(self.owner)-1);
+       if(sf & 2)
+       {
+               WriteShort(MSG_ENTITY, self.origin_x);
+               WriteShort(MSG_ENTITY, self.origin_y);
+               WriteShort(MSG_ENTITY, self.origin_z);
+       }
+       if(sf & 4)
+               WriteByte(MSG_ENTITY, self.angles_y * 256.0 / 360);
+       if(sf & 8)
+               WriteByte(MSG_ENTITY, self.health / 10); // FIXME use a better scale?
+       if(sf & 16)
+               WriteByte(MSG_ENTITY, self.armorvalue / 10); // FIXME use a better scale?
        return TRUE;
 };
 
 void entcs_think()
 {
-       self.nextthink = time;
+       self.nextthink = time + 0.033333333333; // increase this to like 0.15 once the client can do smoothing
 
        entity o;
        o = self.owner;
 
-       if(o.origin != self.origin || o.angles != self.angles)
+       if(o.origin != self.origin)
        {
                setorigin(self, o.origin);
+               self.SendFlags |= 2;
+       }
+       if(o.angles_y != self.angles_y)
+       {
                self.angles = o.angles;
-               self.SendFlags |= 1;
+               self.SendFlags |= 4;
+       }
+       if(o.health != self.health)
+       {
+               self.health = o.health;
+               self.SendFlags |= 8;
+       }
+       if(o.armorvalue != self.armorvalue)
+       {
+               self.armorvalue = o.armorvalue;
+               self.SendFlags |= 16;
        }
 };
 
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 0b178c8c13e9823b78ac5c3465404e2050052e70..6ee4e117964d16ff1a3e01d624dd098caa2de62e 100644 (file)
@@ -946,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);
@@ -1002,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 ef7fba5cf4bea2cc53ef22dab84a8a138d977e26..591bbf8b9fe670c9e749a0a6cf92400c67c35110 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_handleString_Fixup(s, f, cvar_cl_weaponpriority, "cl_weaponpriority", W_FixWeaponOrder_ForceComplete_AndBuildImpulseList);
@@ -624,19 +618,11 @@ void GetCvars(float f)
        {
                if (s == "cl_weaponpriority")
                        self.switchweapon = w_getbestweapon(self);
+               if (s == "cl_allow_uidtracking")
+                       PlayerStats_AddPlayer(self);
        }
 }
 
-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;
@@ -1572,7 +1558,6 @@ void precache()
 {
     // gamemode related things
     precache_model ("models/misc/chatbubble.spr");
-    precache_model ("models/misc/teambubble.spr");
     if (g_runematch)
     {
         precache_model ("models/runematch/curse.mdl");
@@ -2002,7 +1987,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 2bb5540d6b26680cd4027bcf3739a12c90812dae..b3ed92210408a1597e2c0ad62a1154fd72aef337 100644 (file)
@@ -39,6 +39,8 @@ void PlayerStats_AddPlayer(entity e)
 {
        if(playerstats_db < 0)
                return;
+       if(e.playerstats_id)
+               return;
 
        if(e.crypto_idfp != "" && e.cvar_cl_allow_uidtracking == 1)
                e.playerstats_id = strzone(e.crypto_idfp);
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 93ced82670b1a36fb15c42a8236419621d52513a..2e64eadd77f6517e29b5ea873067082962c8ecab 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;
 
@@ -136,14 +135,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
diff --git a/textures/pickups.tga b/textures/pickups.tga
deleted file mode 100644 (file)
index ee2a1f5..0000000
Binary files a/textures/pickups.tga and /dev/null differ
diff --git a/textures/pickups_bump.tga b/textures/pickups_bump.tga
deleted file mode 100644 (file)
index 90acf58..0000000
Binary files a/textures/pickups_bump.tga and /dev/null differ
diff --git a/textures/pickups_gloss.tga b/textures/pickups_gloss.tga
deleted file mode 100644 (file)
index 4f310bf..0000000
Binary files a/textures/pickups_gloss.tga and /dev/null differ
diff --git a/textures/pickups_glow.tga b/textures/pickups_glow.tga
deleted file mode 100644 (file)
index d747029..0000000
Binary files a/textures/pickups_glow.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