]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/terencehill/mapvote_fade'
authorRudolf Polzer <divverent@alientrap.org>
Mon, 17 Jan 2011 10:16:53 +0000 (11:16 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Mon, 17 Jan 2011 10:16:53 +0000 (11:16 +0100)
153 files changed:
balance25.cfg
balanceLeeStricklin.cfg
balanceSamual.cfg
balanceXonotic.cfg
balancetZork.cfg
defaultSamual.cfg
defaultXPM.cfg
defaultXonotic.cfg
fixbalance.sh [new file with mode: 0755]
gfx/hud/default/weaponcampingrifle.tga [deleted file]
gfx/hud/default/weaponsniperrifle.tga [new file with mode: 0644]
gfx/hud/luminos/weaponcampingrifle.tga [deleted file]
gfx/hud/luminos/weaponsniperrifle.tga [new file with mode: 0644]
gfx/hud/old/weaponcampingrifle.tga [deleted file]
gfx/hud/old/weaponsniperrifle.tga [new file with mode: 0644]
hook-firing_swap.cfg
qcsrc/client/Defs.qc
qcsrc/client/Main.qc
qcsrc/client/View.qc
qcsrc/client/autocvars.qh
qcsrc/client/hud.qc
qcsrc/client/main.qh
qcsrc/client/mapvoting.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/scoreboard.qc
qcsrc/common/constants.qh
qcsrc/common/util.qc
qcsrc/menu/classes.c
qcsrc/menu/draw.qc
qcsrc/menu/gamecommand.qc
qcsrc/menu/i18n-guide.txt [new file with mode: 0644]
qcsrc/menu/item.c
qcsrc/menu/item/borderimage.c
qcsrc/menu/item/button.c
qcsrc/menu/item/dialog.c
qcsrc/menu/item/gecko.c
qcsrc/menu/item/inputbox.c
qcsrc/menu/item/label.c
qcsrc/menu/item/listbox.c
qcsrc/menu/item/nexposee.c
qcsrc/menu/item/slider.c
qcsrc/menu/item/textslider.c
qcsrc/menu/mbuiltin.qh
qcsrc/menu/menu.qc
qcsrc/menu/skin-customizables.inc
qcsrc/menu/skin.qh
qcsrc/menu/xonotic/campaign.c
qcsrc/menu/xonotic/credits.c
qcsrc/menu/xonotic/cvarlist.c
qcsrc/menu/xonotic/dialog.c
qcsrc/menu/xonotic/dialog_credits.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_modicons.c
qcsrc/menu/xonotic/dialog_hudpanel_notification.c
qcsrc/menu/xonotic/dialog_hudpanel_powerups.c
qcsrc/menu/xonotic/dialog_hudpanel_pressedkeys.c
qcsrc/menu/xonotic/dialog_hudpanel_racetimer.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_multiplayer.c
qcsrc/menu/xonotic/dialog_multiplayer_create.c
qcsrc/menu/xonotic/dialog_multiplayer_create_advanced.c
qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.c
qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.c
qcsrc/menu/xonotic/dialog_multiplayer_demo.c
qcsrc/menu/xonotic/dialog_multiplayer_join.c
qcsrc/menu/xonotic/dialog_multiplayer_join_serverinfo.c
qcsrc/menu/xonotic/dialog_multiplayer_playersetup.c
qcsrc/menu/xonotic/dialog_multiplayer_playersetup_waypoint.c
qcsrc/menu/xonotic/dialog_multiplayer_playersetup_weapons.c
qcsrc/menu/xonotic/dialog_news.c
qcsrc/menu/xonotic/dialog_quit.c
qcsrc/menu/xonotic/dialog_settings.c
qcsrc/menu/xonotic/dialog_settings_audio.c
qcsrc/menu/xonotic/dialog_settings_effects.c
qcsrc/menu/xonotic/dialog_settings_input.c
qcsrc/menu/xonotic/dialog_settings_input_userbind.c
qcsrc/menu/xonotic/dialog_settings_misc.c
qcsrc/menu/xonotic/dialog_settings_misc_cvars.c
qcsrc/menu/xonotic/dialog_settings_network.c
qcsrc/menu/xonotic/dialog_settings_video.c
qcsrc/menu/xonotic/dialog_singleplayer.c
qcsrc/menu/xonotic/dialog_singleplayer_winner.c
qcsrc/menu/xonotic/dialog_teamselect.c
qcsrc/menu/xonotic/gametypelist.c [new file with mode: 0644]
qcsrc/menu/xonotic/keybinder.c
qcsrc/menu/xonotic/mainwindow.c
qcsrc/menu/xonotic/maplist.c
qcsrc/menu/xonotic/playermodel.c
qcsrc/menu/xonotic/rootdialog.c
qcsrc/menu/xonotic/serverlist.c
qcsrc/menu/xonotic/skinlist.c
qcsrc/menu/xonotic/slider_decibels.c
qcsrc/menu/xonotic/slider_picmip.c
qcsrc/menu/xonotic/slider_resolution.c
qcsrc/menu/xonotic/util.qc
qcsrc/menu/xonotic/util.qh
qcsrc/server/anticheat.qc
qcsrc/server/assault.qc
qcsrc/server/autocvars.qh
qcsrc/server/bot/aim.qc
qcsrc/server/bot/havocbot/havocbot.qc
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/func_breakable.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_world.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/base.qh
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/mutators/gamemode_keepaway.qc
qcsrc/server/playerstats.qc
qcsrc/server/playerstats.qh
qcsrc/server/scores.qc
qcsrc/server/scores.qh
qcsrc/server/scores_rules.qc
qcsrc/server/sv_main.qc
qcsrc/server/t_plats.qc
qcsrc/server/t_quake3.qc
qcsrc/server/tturrets/system/system_aimprocs.qc
qcsrc/server/tturrets/system/system_damage.qc
qcsrc/server/tturrets/system/system_main.qc
qcsrc/server/tturrets/units/unit_fusionreactor.qc
qcsrc/server/tturrets/units/unit_walker.qc
qcsrc/server/vehicles/spiderbot.qc
qcsrc/server/w_all.qc
qcsrc/server/w_campingrifle.qc [deleted file]
qcsrc/server/w_common.qc
qcsrc/server/w_crylink.qc
qcsrc/server/w_electro.qc
qcsrc/server/w_hlac.qc
qcsrc/server/w_minelayer.qc
qcsrc/server/w_nex.qc
qcsrc/server/w_shotgun.qc
qcsrc/server/w_sniperrifle.qc [new file with mode: 0644]
qcsrc/server/w_uzi.qc
qcsrc/server/waypointsprites.qc
update-cvarcount.sh
xonotic-credits.txt

index 3806e8b122650d7a676ef68ed743c46d654f81f1..361c45d616bac822990aa3d2144611c091fbf105 100644 (file)
@@ -13,7 +13,7 @@ set g_start_weapon_minstanex -1 "0 = never provide the weapon, 1 = always provid
 set g_start_weapon_porto -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_hook -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_hlac -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_start_weapon_campingrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_sniperrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_fireball -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_seeker -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
@@ -226,6 +226,7 @@ set g_balance_laser_primary_delay 0.05
 set g_balance_laser_primary_gauntlet 0
 set g_balance_laser_primary_force_zscale 1
 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 35
 set g_balance_laser_secondary_edgedamage 10
@@ -241,6 +242,7 @@ set g_balance_laser_secondary_delay 0
 set g_balance_laser_secondary_gauntlet 0
 set g_balance_laser_secondary_force_zscale 1
 set g_balance_laser_secondary_force_velocitybias 0
+set g_balance_laser_secondary_force_other_scale 1
 // }}}
 // {{{ shotgun
 set g_balance_shotgun_primary_bullets 6
@@ -267,24 +269,29 @@ set g_balance_uzi_mode 0                          // Activates varible spread for sustained & burst m
 set g_balance_uzi_spread_min 0.02
 set g_balance_uzi_spread_max 0.6
 set g_balance_uzi_spread_add 0.012
+
 set g_balance_uzi_burst 0                              // # of bullets in a burst (if set to 2 or more)
+set g_balance_uzi_burst_animtime 0.75
 set g_balance_uzi_burst_refire 0.05            // refire between burst bullets
 set g_balance_uzi_burst_refire2 0.75   // refire after burst
 set g_balance_uzi_burst_spread 0.04
 set g_balance_uzi_burst_damage 18              
 set g_balance_uzi_burst_force 50
 set g_balance_uzi_burst_ammo 3
+
 set g_balance_uzi_first 1
 set g_balance_uzi_first_damage 30
 set g_balance_uzi_first_force 50
 set g_balance_uzi_first_spread 0.015
 set g_balance_uzi_first_refire 0.2
 set g_balance_uzi_first_ammo 1
+
 set g_balance_uzi_sustained_damage 15
 set g_balance_uzi_sustained_force 27
 set g_balance_uzi_sustained_spread 0.05
 set g_balance_uzi_sustained_refire 0.1
 set g_balance_uzi_sustained_ammo 1
+
 set g_balance_uzi_speed 18000
 set g_balance_uzi_bulletconstant 115 // 13.1qu
 // }}}
@@ -328,7 +335,7 @@ set g_balance_grenadelauncher_secondary_remote_detonateprimary 0
 set g_balance_grenadelauncher_bouncefactor 0.5
 set g_balance_grenadelauncher_bouncestop 0.075
 // }}}
-// {{{ minelayer // TODO
+// {{{ minelayer
 set g_balance_minelayer_damage 35
 set g_balance_minelayer_edgedamage 30
 set g_balance_minelayer_force 250
@@ -406,6 +413,7 @@ set g_balance_crylink_primary_refire 0.4
 set g_balance_crylink_primary_animtime 0.3
 set g_balance_crylink_primary_ammo 2
 set g_balance_crylink_primary_bouncedamagefactor 0.5
+set g_balance_crylink_primary_joindelay 0
 set g_balance_crylink_primary_joinspread 0
 set g_balance_crylink_primary_jointime 0
 set g_balance_crylink_primary_joinexplode 0
@@ -433,6 +441,7 @@ set g_balance_crylink_secondary_refire 0.5
 set g_balance_crylink_secondary_animtime 0.3
 set g_balance_crylink_secondary_ammo 2
 set g_balance_crylink_secondary_bouncedamagefactor 0.5
+set g_balance_crylink_secondary_joindelay 0
 set g_balance_crylink_secondary_joinspread 0
 set g_balance_crylink_secondary_jointime 0
 set g_balance_crylink_secondary_joinexplode 0                  
@@ -600,38 +609,39 @@ set g_balance_hlac_secondary_animtime 0.3
 set g_balance_hlac_secondary_ammo 10
 set g_balance_hlac_secondary_shots 6
 // }}}
-// {{{ campingrifle
-set g_balance_campingrifle_magazinecapacity 8
-set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_on_switch 0
-set g_balance_campingrifle_bursttime 0
-set g_balance_campingrifle_primary_tracer 0
-set g_balance_campingrifle_primary_damage 60
-set g_balance_campingrifle_primary_headshotaddeddamage 100
-set g_balance_campingrifle_primary_spread 0
-set g_balance_campingrifle_primary_force 2
-set g_balance_campingrifle_primary_speed 35000
-set g_balance_campingrifle_primary_lifetime 5
-set g_balance_campingrifle_primary_refire 0.8
-set g_balance_campingrifle_primary_animtime 0.3
-set g_balance_campingrifle_primary_ammo 10
-set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu
-set g_balance_campingrifle_primary_burstcost 0
-set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
-set g_balance_campingrifle_secondary 1
-set g_balance_campingrifle_secondary_tracer 0
-set g_balance_campingrifle_secondary_damage 35
-set g_balance_campingrifle_secondary_headshotaddeddamage 15 // 50 damage only on head
-set g_balance_campingrifle_secondary_spread 0.008
-set g_balance_campingrifle_secondary_force 1
-set g_balance_campingrifle_secondary_speed 20000
-set g_balance_campingrifle_secondary_lifetime 5
-set g_balance_campingrifle_secondary_refire 0.15
-set g_balance_campingrifle_secondary_animtime 0.1
-set g_balance_campingrifle_secondary_ammo 10
-set g_balance_campingrifle_secondary_bulletconstant 130 // 18.3qu
-set g_balance_campingrifle_secondary_burstcost 0
-set g_balance_campingrifle_secondary_bullethail 0 // empty magazine on shot
+// {{{ sniperrifle
+set g_balance_sniperrifle_magazinecapacity 8
+set g_balance_sniperrifle_reloadtime 2 // matches reload anim
+set g_balance_sniperrifle_auto_reload_on_switch 0
+set g_balance_sniperrifle_bursttime 0
+set g_balance_sniperrifle_primary_tracer 0
+set g_balance_sniperrifle_primary_damage 60
+set g_balance_sniperrifle_primary_headshotaddeddamage 100
+set g_balance_sniperrifle_primary_spread 0
+set g_balance_sniperrifle_primary_force 2
+set g_balance_sniperrifle_primary_speed 35000
+set g_balance_sniperrifle_primary_lifetime 5
+set g_balance_sniperrifle_primary_refire 0.8
+set g_balance_sniperrifle_primary_animtime 0.3
+set g_balance_sniperrifle_primary_ammo 10
+set g_balance_sniperrifle_primary_bulletconstant 130 // 56.3qu
+set g_balance_sniperrifle_primary_burstcost 0
+set g_balance_sniperrifle_primary_bullethail 0 // empty magazine on shot
+set g_balance_sniperrifle_secondary 1
+set g_balance_sniperrifle_secondary_reload 0
+set g_balance_sniperrifle_secondary_tracer 0
+set g_balance_sniperrifle_secondary_damage 35
+set g_balance_sniperrifle_secondary_headshotaddeddamage 15 // 50 damage only on head
+set g_balance_sniperrifle_secondary_spread 0.008
+set g_balance_sniperrifle_secondary_force 1
+set g_balance_sniperrifle_secondary_speed 20000
+set g_balance_sniperrifle_secondary_lifetime 5
+set g_balance_sniperrifle_secondary_refire 0.15
+set g_balance_sniperrifle_secondary_animtime 0.1
+set g_balance_sniperrifle_secondary_ammo 10
+set g_balance_sniperrifle_secondary_bulletconstant 130 // 18.3qu
+set g_balance_sniperrifle_secondary_burstcost 0
+set g_balance_sniperrifle_secondary_bullethail 0 // empty magazine on shot
 // }}}
 // {{{ tuba
 set g_balance_tuba_refire 0.05
index 1bb993bac9107427a13b1c95d0a0be00f2f456b0..03f58bf366724d0e7150ef7b375537197ef6e9aa 100644 (file)
@@ -13,7 +13,7 @@ set g_start_weapon_minstanex -1 "0 = never provide the weapon, 1 = always provid
 set g_start_weapon_porto -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_hook -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_hlac 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_start_weapon_campingrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_sniperrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_fireball 0 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_seeker -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
@@ -226,6 +226,7 @@ set g_balance_laser_primary_delay 0.03
 set g_balance_laser_primary_gauntlet 0
 set g_balance_laser_primary_force_zscale 2 // 300 upforce
 set g_balance_laser_primary_force_velocitybias 0.3
+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 200 // dps
 set g_balance_laser_secondary_edgedamage 0
@@ -241,6 +242,7 @@ set g_balance_laser_secondary_delay 0
 set g_balance_laser_secondary_gauntlet 1
 set g_balance_laser_secondary_force_zscale 1.25
 set g_balance_laser_secondary_force_velocitybias 0
+set g_balance_laser_secondary_force_other_scale 1
 // }}}
 // {{{ shotgun
 set g_balance_shotgun_primary_bullets 5
@@ -267,28 +269,33 @@ set g_balance_uzi_mode 0                          // Activates varible spread for sustained & burst m
 set g_balance_uzi_spread_min 0.02
 set g_balance_uzi_spread_max 0.6
 set g_balance_uzi_spread_add 0.012
+
 set g_balance_uzi_burst 0                              // # of bullets in a burst (if set to 2 or more)
+set g_balance_uzi_burst_animtime 0.75
 set g_balance_uzi_burst_refire 0.05            // refire between burst bullets
 set g_balance_uzi_burst_refire2 0.75   // refire after burst
 set g_balance_uzi_burst_spread 0.04
 set g_balance_uzi_burst_damage 18              
 set g_balance_uzi_burst_force 50
 set g_balance_uzi_burst_ammo 3
+
 set g_balance_uzi_first 1
 set g_balance_uzi_first_damage 26
 set g_balance_uzi_first_force -30
 set g_balance_uzi_first_spread 0.01
 set g_balance_uzi_first_refire 0.2
 set g_balance_uzi_first_ammo 1
+
 set g_balance_uzi_sustained_damage 17
 set g_balance_uzi_sustained_force 27
 set g_balance_uzi_sustained_spread 0.05
 set g_balance_uzi_sustained_refire 0.1
 set g_balance_uzi_sustained_ammo 1
+
 set g_balance_uzi_speed 18000
 set g_balance_uzi_bulletconstant 300 // 13.1qu
 // }}}
-// {{{ mortar 
+// {{{ mortar
 set g_balance_grenadelauncher_primary_type 0
 set g_balance_grenadelauncher_primary_damage 65
 set g_balance_grenadelauncher_primary_edgedamage 35
@@ -328,7 +335,7 @@ set g_balance_grenadelauncher_secondary_remote_detonateprimary 0
 set g_balance_grenadelauncher_bouncefactor 0.7
 set g_balance_grenadelauncher_bouncestop 0.12
 // }}}
-// {{{ minelayer 
+// {{{ minelayer
 set g_balance_minelayer_damage 65
 set g_balance_minelayer_edgedamage 30
 set g_balance_minelayer_force 250
@@ -350,7 +357,7 @@ set g_balance_minelayer_remote_edgedamage 40
 set g_balance_minelayer_remote_radius 200
 set g_balance_minelayer_remote_force 300
 // }}}
-// {{{ electro 
+// {{{ electro
 set g_balance_electro_lightning 0
 set g_balance_electro_primary_damage 55
 set g_balance_electro_primary_edgedamage 5
@@ -406,6 +413,7 @@ set g_balance_crylink_primary_refire 0.4
 set g_balance_crylink_primary_animtime 0.30008
 set g_balance_crylink_primary_ammo 3
 set g_balance_crylink_primary_bouncedamagefactor 0.2
+set g_balance_crylink_primary_joindelay 0
 set g_balance_crylink_primary_joinspread 0
 set g_balance_crylink_primary_jointime 0
 set g_balance_crylink_primary_joinexplode 0
@@ -433,6 +441,7 @@ set g_balance_crylink_secondary_refire 0.5
 set g_balance_crylink_secondary_animtime 0.3
 set g_balance_crylink_secondary_ammo 3
 set g_balance_crylink_secondary_bouncedamagefactor 0.5
+set g_balance_crylink_secondary_joindelay 0
 set g_balance_crylink_secondary_joinspread 0
 set g_balance_crylink_secondary_jointime 0
 set g_balance_crylink_secondary_joinexplode 0                  
@@ -514,7 +523,7 @@ set g_balance_hagar_secondary_lifetime_rand 0
 set g_balance_hagar_secondary_refire 0.15
 set g_balance_hagar_secondary_ammo 2
 // }}}
-// {{{ rocketlauncher 
+// {{{ rocketlauncher
 set g_balance_rocketlauncher_damage 65
 set g_balance_rocketlauncher_edgedamage 25
 set g_balance_rocketlauncher_force 360
@@ -600,38 +609,39 @@ set g_balance_hlac_secondary_animtime 0.3
 set g_balance_hlac_secondary_ammo 11
 set g_balance_hlac_secondary_shots 6
 // }}}
-// {{{ campingrifle
-set g_balance_campingrifle_magazinecapacity 8
-set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_on_switch 0
-set g_balance_campingrifle_bursttime 0.85 // 0.35 - 0.1 + 0.35 - 0.1 + 0.35 = three secondaries
-set g_balance_campingrifle_primary_tracer 0
-set g_balance_campingrifle_primary_damage 75
-set g_balance_campingrifle_primary_headshotaddeddamage 90
-set g_balance_campingrifle_primary_spread 0
-set g_balance_campingrifle_primary_force 2
-set g_balance_campingrifle_primary_speed 35000
-set g_balance_campingrifle_primary_lifetime 5
-set g_balance_campingrifle_primary_refire 0.7
-set g_balance_campingrifle_primary_animtime 0.3
-set g_balance_campingrifle_primary_ammo 10
-set g_balance_campingrifle_primary_bulletconstant 130 // 56.3qu
-set g_balance_campingrifle_primary_burstcost 0 // require same cooldown as secondary, note it's smaller than primary refire time
-set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
-set g_balance_campingrifle_secondary 1
-set g_balance_campingrifle_secondary_tracer 0
-set g_balance_campingrifle_secondary_damage 40
-set g_balance_campingrifle_secondary_headshotaddeddamage 20
-set g_balance_campingrifle_secondary_spread 0.008
-set g_balance_campingrifle_secondary_force 1
-set g_balance_campingrifle_secondary_speed 20000
-set g_balance_campingrifle_secondary_lifetime 5
-set g_balance_campingrifle_secondary_refire 0.0006
-set g_balance_campingrifle_secondary_animtime 0.1
-set g_balance_campingrifle_secondary_ammo 10
-set g_balance_campingrifle_secondary_bulletconstant 130 // 18.3qu
-set g_balance_campingrifle_secondary_burstcost 0
-set g_balance_campingrifle_secondary_bullethail 0
+// {{{ sniperrifle
+set g_balance_sniperrifle_magazinecapacity 8
+set g_balance_sniperrifle_reloadtime 2 // matches reload anim
+set g_balance_sniperrifle_auto_reload_on_switch 0
+set g_balance_sniperrifle_bursttime 0.85 // 0.35 - 0.1 + 0.35 - 0.1 + 0.35 = three secondaries
+set g_balance_sniperrifle_primary_tracer 0
+set g_balance_sniperrifle_primary_damage 75
+set g_balance_sniperrifle_primary_headshotaddeddamage 90
+set g_balance_sniperrifle_primary_spread 0
+set g_balance_sniperrifle_primary_force 2
+set g_balance_sniperrifle_primary_speed 35000
+set g_balance_sniperrifle_primary_lifetime 5
+set g_balance_sniperrifle_primary_refire 0.7
+set g_balance_sniperrifle_primary_animtime 0.3
+set g_balance_sniperrifle_primary_ammo 10
+set g_balance_sniperrifle_primary_bulletconstant 130 // 56.3qu
+set g_balance_sniperrifle_primary_burstcost 0 // require same cooldown as secondary, note it's smaller than primary refire time
+set g_balance_sniperrifle_primary_bullethail 0 // empty magazine on shot
+set g_balance_sniperrifle_secondary 1
+set g_balance_sniperrifle_secondary_reload 0
+set g_balance_sniperrifle_secondary_tracer 0
+set g_balance_sniperrifle_secondary_damage 40
+set g_balance_sniperrifle_secondary_headshotaddeddamage 20
+set g_balance_sniperrifle_secondary_spread 0.008
+set g_balance_sniperrifle_secondary_force 1
+set g_balance_sniperrifle_secondary_speed 20000
+set g_balance_sniperrifle_secondary_lifetime 5
+set g_balance_sniperrifle_secondary_refire 0.0006
+set g_balance_sniperrifle_secondary_animtime 0.1
+set g_balance_sniperrifle_secondary_ammo 10
+set g_balance_sniperrifle_secondary_bulletconstant 130 // 18.3qu
+set g_balance_sniperrifle_secondary_burstcost 0
+set g_balance_sniperrifle_secondary_bullethail 0
 // }}}
 // {{{ tuba
 set g_balance_tuba_refire 0.05
index d7e64bb4f2412709b33d26390ebbfa666eeb9f26..4e3733a7551d38076e00f50e63a4f286813981f9 100644 (file)
@@ -13,11 +13,11 @@ set g_start_weapon_minstanex -1 "0 = never provide the weapon, 1 = always provid
 set g_start_weapon_porto -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_hook -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_hlac -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_start_weapon_campingrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_sniperrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_fireball -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_seeker -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_balance_health_start 125
+set g_balance_health_start 150
 set g_balance_armor_start 0
 set g_start_ammo_shells 15
 set g_start_ammo_nails 0
@@ -56,20 +56,20 @@ set g_balance_nix_ammoincr_fuel 2
 set g_pickup_ammo_anyway 1
 set g_pickup_weapons_anyway 1
 set g_pickup_shells 15
-set g_pickup_shells_weapon 15
-set g_pickup_shells_max 100
-set g_pickup_nails 75
-set g_pickup_nails_weapon 75
-set g_pickup_nails_max 300
+set g_pickup_shells_weapon 30
+set g_pickup_shells_max 90
+set g_pickup_nails 80
+set g_pickup_nails_weapon 160
+set g_pickup_nails_max 320
 set g_pickup_rockets 40
-set g_pickup_rockets_weapon 40
+set g_pickup_rockets_weapon 80
 set g_pickup_rockets_max 160
 set g_pickup_cells 50
-set g_pickup_cells_weapon 50
+set g_pickup_cells_weapon 100
 set g_pickup_cells_max 200
-set g_pickup_fuel 25
-set g_pickup_fuel_weapon 25
-set g_pickup_fuel_jetpack 50
+set g_pickup_fuel 50
+set g_pickup_fuel_weapon 50
+set g_pickup_fuel_jetpack 100
 set g_pickup_fuel_max 100
 set g_pickup_armorsmall 10
 set g_pickup_armorsmall_max 200
@@ -84,23 +84,23 @@ set g_pickup_armorlarge 100
 set g_pickup_armorlarge_max 200
 set g_pickup_armorlarge_anyway 1
 set g_pickup_healthsmall 10
-set g_pickup_healthsmall_max 200
+set g_pickup_healthsmall_max 250
 set g_pickup_healthsmall_anyway 1
 set g_pickup_healthmedium 25
-set g_pickup_healthmedium_max 200
+set g_pickup_healthmedium_max 250
 set g_pickup_healthmedium_anyway 1
 set g_pickup_healthlarge 50
-set g_pickup_healthlarge_max 200
+set g_pickup_healthlarge_max 250
 set g_pickup_healthlarge_anyway 1
 set g_pickup_healthmega 100
-set g_pickup_healthmega_max 200
+set g_pickup_healthmega_max 250
 set g_pickup_healthmega_anyway 1
 set g_pickup_respawntime_short 15
 set g_pickup_respawntime_medium 20
 set g_pickup_respawntime_long 30
 set g_pickup_respawntime_powerup 120
-set g_pickup_respawntime_weapon 15
-set g_pickup_respawntime_ammo 15
+set g_pickup_respawntime_weapon 10
+set g_pickup_respawntime_ammo 10
 set g_pickup_respawntimejitter_short 0
 set g_pickup_respawntimejitter_medium 0
 set g_pickup_respawntimejitter_long 0
@@ -115,18 +115,18 @@ set g_balance_health_regenlinear 5
 set g_balance_pause_health_regen 5
 set g_balance_pause_health_regen_spawn 0
 set g_balance_health_rot 0
-set g_balance_health_rotlinear 5
+set g_balance_health_rotlinear 4
 set g_balance_pause_health_rot 3
-set g_balance_pause_health_rot_spawn 1
+set g_balance_pause_health_rot_spawn 5
 set g_balance_health_regenstable 100
-set g_balance_health_rotstable 100
+set g_balance_health_rotstable 150
 set g_balance_health_limit 999
 set g_balance_armor_regen 0
 set g_balance_armor_regenlinear 0
 set g_balance_armor_rot 0
-set g_balance_armor_rotlinear 3
-set g_balance_pause_armor_rot 1
-set g_balance_pause_armor_rot_spawn 1
+set g_balance_armor_rotlinear 2
+set g_balance_pause_armor_rot 3
+set g_balance_pause_armor_rot_spawn 5
 set g_balance_armor_regenstable 100
 set g_balance_armor_rotstable 100
 set g_balance_armor_limit 999
@@ -164,7 +164,7 @@ set g_projectiles_newton_style 2
 // 4: just add the player velocity length to the absolute velocity (tZork's sniper rockets)
 set g_projectiles_newton_style_2_minfactor 0.8
 set g_projectiles_newton_style_2_maxfactor 1.5
-set g_projectiles_spread_style 0
+set g_projectiles_spread_style 7
 // possible values:
 // 0: forward + solid sphere (like Quake) - varies velocity
 // 1: forward + flattened solid sphere
@@ -175,13 +175,13 @@ set g_projectiles_spread_style 0
 // 6: forward + circle with 1-r^2 falloff
 // 7: forward + circle with (1-r)(2-r) falloff
 set g_balance_falldamage_deadminspeed 150
-set g_balance_falldamage_minspeed 1400
-set g_balance_falldamage_factor 0.15
-set g_balance_falldamage_maxdamage 25
+set g_balance_falldamage_minspeed 1000
+set g_balance_falldamage_factor 0.20
+set g_balance_falldamage_maxdamage 15
 // }}}
 
 // {{{ powerups
-set g_balance_powerup_invincible_takedamage 0.2
+set g_balance_powerup_invincible_takedamage 0.25 // only 1/4th damage is taken
 set g_balance_powerup_invincible_time 30
 set g_balance_powerup_strength_damage 3
 set g_balance_powerup_strength_force 3
@@ -213,10 +213,10 @@ set g_balance_grapplehook_health 130
 // {{{ weapon properties
 // {{{ laser
 set g_balance_laser_primary_damage 25
-set g_balance_laser_primary_edgedamage 10
-set g_balance_laser_primary_force 175
+set g_balance_laser_primary_edgedamage 12.5
+set g_balance_laser_primary_force 200
 set g_balance_laser_primary_radius 70
-set g_balance_laser_primary_speed 12000
+set g_balance_laser_primary_speed 6000
 set g_balance_laser_primary_spread 0
 set g_balance_laser_primary_refire 0.7
 set g_balance_laser_primary_animtime 0.3
@@ -226,9 +226,10 @@ set g_balance_laser_primary_delay 0.03
 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_other_scale 1
 set g_balance_laser_secondary 0 // when 1, a secondary laser mode exists
 set g_balance_laser_secondary_damage 25
-set g_balance_laser_secondary_edgedamage 10
+set g_balance_laser_secondary_edgedamage 12.5
 set g_balance_laser_secondary_force 400
 set g_balance_laser_secondary_radius 70
 set g_balance_laser_secondary_speed 12000
@@ -241,20 +242,21 @@ set g_balance_laser_secondary_delay 0
 set g_balance_laser_secondary_gauntlet 0
 set g_balance_laser_secondary_force_zscale 1.25
 set g_balance_laser_secondary_force_velocitybias 0
+set g_balance_laser_secondary_force_other_scale 1
 // }}}
 // {{{ shotgun
-set g_balance_shotgun_primary_bullets 10
-set g_balance_shotgun_primary_damage 6
+set g_balance_shotgun_primary_bullets 12
+set g_balance_shotgun_primary_damage 5
 set g_balance_shotgun_primary_force 15
 set g_balance_shotgun_primary_spread 0.11
-set g_balance_shotgun_primary_refire 0.5
+set g_balance_shotgun_primary_refire 0.75
 set g_balance_shotgun_primary_animtime 0.2
 set g_balance_shotgun_primary_ammo 1
 set g_balance_shotgun_primary_speed 8000
 set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu
 set g_balance_shotgun_secondary 1
 set g_balance_shotgun_secondary_melee_delay 0.35 // match the anim
-set g_balance_shotgun_secondary_melee_range 60
+set g_balance_shotgun_secondary_melee_range 85
 set g_balance_shotgun_secondary_melee_swing 50
 set g_balance_shotgun_secondary_melee_time 0.1
 set g_balance_shotgun_secondary_damage 115
@@ -263,36 +265,41 @@ set g_balance_shotgun_secondary_refire 1.1
 set g_balance_shotgun_secondary_animtime 1
 // }}}
 // {{{ uzi
-set g_balance_uzi_mode 0                               // Activates varible spread for sustained & burst mode secondary
+set g_balance_uzi_mode 1                               // Activates varible spread for sustained & burst mode secondary
 set g_balance_uzi_spread_min 0.02
-set g_balance_uzi_spread_max 0.6
+set g_balance_uzi_spread_max 0.1
 set g_balance_uzi_spread_add 0.012
-set g_balance_uzi_burst 0                              // # of bullets in a burst (if set to 2 or more)
-set g_balance_uzi_burst_refire 0.05            // refire between burst bullets
+
+set g_balance_uzi_burst 3                              // # of bullets in a burst (if set to 2 or more)
+set g_balance_uzi_burst_animtime 0.75
+set g_balance_uzi_burst_refire 0.075           // refire between burst bullets
 set g_balance_uzi_burst_refire2 0.75   // refire after burst
 set g_balance_uzi_burst_spread 0.04
-set g_balance_uzi_burst_damage 18              
-set g_balance_uzi_burst_force 50
+set g_balance_uzi_burst_damage 25              
+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_spread 0.03
 set g_balance_uzi_first_refire 0.2
 set g_balance_uzi_first_ammo 1
-set g_balance_uzi_sustained_damage 10
-set g_balance_uzi_sustained_force 10
-set g_balance_uzi_sustained_spread 0.08
+
+set g_balance_uzi_sustained_damage 14
+set g_balance_uzi_sustained_force 20
+set g_balance_uzi_sustained_spread 0.04
 set g_balance_uzi_sustained_refire 0.1
 set g_balance_uzi_sustained_ammo 1
+
 set g_balance_uzi_speed 18000
 set g_balance_uzi_bulletconstant 115 // 13.1qu
 // }}}
 // {{{ mortar
 set g_balance_grenadelauncher_primary_type 0
 set g_balance_grenadelauncher_primary_damage 50
-set g_balance_grenadelauncher_primary_edgedamage 38
-set g_balance_grenadelauncher_primary_force 400
+set g_balance_grenadelauncher_primary_edgedamage 25
+set g_balance_grenadelauncher_primary_force 300
 set g_balance_grenadelauncher_primary_radius 140
 set g_balance_grenadelauncher_primary_speed 2000
 set g_balance_grenadelauncher_primary_speed_up 220
@@ -309,8 +316,8 @@ set g_balance_grenadelauncher_primary_remote_minbouncecnt 0
 
 set g_balance_grenadelauncher_secondary_type 1
 set g_balance_grenadelauncher_secondary_damage 60
-set g_balance_grenadelauncher_secondary_edgedamage 38
-set g_balance_grenadelauncher_secondary_force 400
+set g_balance_grenadelauncher_secondary_edgedamage 30
+set g_balance_grenadelauncher_secondary_force 300
 set g_balance_grenadelauncher_secondary_radius 140
 set g_balance_grenadelauncher_secondary_speed 1400
 set g_balance_grenadelauncher_secondary_speed_up 150
@@ -328,9 +335,9 @@ set g_balance_grenadelauncher_secondary_remote_detonateprimary 0
 set g_balance_grenadelauncher_bouncefactor 0.5
 set g_balance_grenadelauncher_bouncestop 0.075
 // }}}
-// {{{ minelayer // TODO
-set g_balance_minelayer_damage 35
-set g_balance_minelayer_edgedamage 30
+// {{{ minelayer
+set g_balance_minelayer_damage 40
+set g_balance_minelayer_edgedamage 20
 set g_balance_minelayer_force 250
 set g_balance_minelayer_radius 175
 set g_balance_minelayer_proximityradius 150
@@ -350,32 +357,32 @@ set g_balance_minelayer_remote_edgedamage 40
 set g_balance_minelayer_remote_radius 200
 set g_balance_minelayer_remote_force 300
 // }}}
-// {{{ electro // TODO
-set g_balance_electro_lightning 1
-set g_balance_electro_primary_damage 90
-set g_balance_electro_primary_edgedamage 0
-set g_balance_electro_primary_force 425
-set g_balance_electro_primary_force_up 125
-set g_balance_electro_primary_radius 850
-set g_balance_electro_primary_comboradius 75
-set g_balance_electro_primary_speed 0
+// {{{ electro
+set g_balance_electro_lightning 0
+set g_balance_electro_primary_damage 55
+set g_balance_electro_primary_edgedamage 27.5
+set g_balance_electro_primary_force 200
+set g_balance_electro_primary_force_up 0
+set g_balance_electro_primary_radius 100
+set g_balance_electro_primary_comboradius 150
+set g_balance_electro_primary_speed 2500
 set g_balance_electro_primary_spread 0
-set g_balance_electro_primary_lifetime 0
+set g_balance_electro_primary_lifetime 30
 set g_balance_electro_primary_refire 0.6
-set g_balance_electro_primary_animtime 0.03
-set g_balance_electro_primary_ammo 7
-set g_balance_electro_primary_range 800
+set g_balance_electro_primary_animtime 0.1
+set g_balance_electro_primary_ammo 4
+set g_balance_electro_primary_range 0
 set g_balance_electro_primary_falloff_mindist 255 // 0.3 * radius
 set g_balance_electro_primary_falloff_maxdist 850
 set g_balance_electro_primary_falloff_halflifedist 425
-set g_balance_electro_secondary_damage 25
-set g_balance_electro_secondary_edgedamage 0
-set g_balance_electro_secondary_force 100
-set g_balance_electro_secondary_radius 100
+set g_balance_electro_secondary_damage 45
+set g_balance_electro_secondary_edgedamage 22.5
+set g_balance_electro_secondary_force 200
+set g_balance_electro_secondary_radius 150
 set g_balance_electro_secondary_speed 900
 set g_balance_electro_secondary_speed_up 200
 set g_balance_electro_secondary_speed_z 0
-set g_balance_electro_secondary_spread 0.08
+set g_balance_electro_secondary_spread 0.05
 set g_balance_electro_secondary_lifetime 2.5
 set g_balance_electro_secondary_refire 0.2
 set g_balance_electro_secondary_refire2 1
@@ -386,33 +393,34 @@ 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_combo_damage 50
-set g_balance_electro_combo_edgedamage 0
+set g_balance_electro_combo_damage 40
+set g_balance_electro_combo_edgedamage 20
 set g_balance_electro_combo_force 200
 set g_balance_electro_combo_radius 250
 set g_balance_electro_combo_comboradius 0
-set g_balance_electro_combo_speed 400
+set g_balance_electro_combo_speed 2000
 // }}}
 // {{{ crylink 
 set g_balance_crylink_primary_damage 10
-set g_balance_crylink_primary_edgedamage 0
+set g_balance_crylink_primary_edgedamage 5
 set g_balance_crylink_primary_force -55
-set g_balance_crylink_primary_radius 50
-set g_balance_crylink_primary_speed 3000
-set g_balance_crylink_primary_spread 0.05
-set g_balance_crylink_primary_shots 4
+set g_balance_crylink_primary_radius 80
+set g_balance_crylink_primary_speed 1800
+set g_balance_crylink_primary_spread 0.075
+set g_balance_crylink_primary_shots 7
 set g_balance_crylink_primary_bounces 1
-set g_balance_crylink_primary_refire 0.4
+set g_balance_crylink_primary_refire 0.5
 set g_balance_crylink_primary_animtime 0.3
-set g_balance_crylink_primary_ammo 2
+set g_balance_crylink_primary_ammo 4
 set g_balance_crylink_primary_bouncedamagefactor 0.5
-set g_balance_crylink_primary_joinspread 0
+set g_balance_crylink_primary_joindelay 0
+set g_balance_crylink_primary_joinspread 0.4
 set g_balance_crylink_primary_jointime 0
 set g_balance_crylink_primary_joinexplode 0
-set g_balance_crylink_primary_joinexplode_damage 0
+set g_balance_crylink_primary_joinexplode_damage 50
 set g_balance_crylink_primary_joinexplode_edgedamage 0
-set g_balance_crylink_primary_joinexplode_radius 0
-set g_balance_crylink_primary_joinexplode_force 0
+set g_balance_crylink_primary_joinexplode_radius 200
+set g_balance_crylink_primary_joinexplode_force 300
 set g_balance_crylink_primary_linkexplode 1
 
 set g_balance_crylink_primary_middle_lifetime 5 // range: 35000 full, fades to 70000
@@ -421,11 +429,11 @@ set g_balance_crylink_primary_other_lifetime 5
 set g_balance_crylink_primary_other_fadetime 5
 
 set g_balance_crylink_secondary 1
-set g_balance_crylink_secondary_damage 8
-set g_balance_crylink_secondary_edgedamage 0
+set g_balance_crylink_secondary_damage 5
+set g_balance_crylink_secondary_edgedamage 2.5
 set g_balance_crylink_secondary_force -40
-set g_balance_crylink_secondary_radius 10
-set g_balance_crylink_secondary_speed 9000
+set g_balance_crylink_secondary_radius 30
+set g_balance_crylink_secondary_speed 1700
 set g_balance_crylink_secondary_spread 0.03
 set g_balance_crylink_secondary_shots 3
 set g_balance_crylink_secondary_bounces 0
@@ -433,6 +441,7 @@ set g_balance_crylink_secondary_refire 0.2
 set g_balance_crylink_secondary_animtime 0.2
 set g_balance_crylink_secondary_ammo 2
 set g_balance_crylink_secondary_bouncedamagefactor 0.5
+set g_balance_crylink_secondary_joindelay 0
 set g_balance_crylink_secondary_joinspread 0
 set g_balance_crylink_secondary_jointime 0
 set g_balance_crylink_secondary_joinexplode 0                  
@@ -478,14 +487,14 @@ set g_balance_nex_secondary_damagefalloff_forcehalflife 0
 set g_balance_nex_charge 1
 set g_balance_nex_charge_mindmg 40
 set g_balance_nex_charge_start 0
-set g_balance_nex_charge_rate 0.1
+set g_balance_nex_charge_rate 0.2
 set g_balance_nex_charge_limit 0.5
 set g_balance_nex_charge_rot_rate 0
 set g_balance_nex_charge_rot_pause 0 // Dont rot down untill this long after release of charge button
 set g_balance_nex_charge_shot_multiplier 0.25
-set g_balance_nex_charge_velocity_rate 0.2
+set g_balance_nex_charge_velocity_rate 0.3
 set g_balance_nex_charge_minspeed 400
-set g_balance_nex_charge_maxspeed 1000
+set g_balance_nex_charge_maxspeed 800
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
@@ -494,7 +503,7 @@ set g_balance_minstanex_ammo 10
 // }}}
 // {{{ hagar
 set g_balance_hagar_primary_damage 30
-set g_balance_hagar_primary_edgedamage 0
+set g_balance_hagar_primary_edgedamage 15
 set g_balance_hagar_primary_force 50
 set g_balance_hagar_primary_radius 70
 set g_balance_hagar_primary_spread 0.08
@@ -503,8 +512,8 @@ set g_balance_hagar_primary_lifetime 0.12
 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_damage 37
-set g_balance_hagar_secondary_edgedamage 15
+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
@@ -517,7 +526,7 @@ set g_balance_hagar_secondary_ammo 1
 // {{{ rocketlauncher
 set g_balance_rocketlauncher_damage 80
 set g_balance_rocketlauncher_edgedamage 40
-set g_balance_rocketlauncher_force 600
+set g_balance_rocketlauncher_force 400
 set g_balance_rocketlauncher_radius 100
 set g_balance_rocketlauncher_speed 1600
 set g_balance_rocketlauncher_speedaccel 1600
@@ -535,9 +544,9 @@ set g_balance_rocketlauncher_guidegoal 512 // goal distance for (non-laser) guid
 set g_balance_rocketlauncher_guidedelay 0.15 // delay before guiding kicks in
 set g_balance_rocketlauncher_guidestop 0 // stop guiding when firing again
 set g_balance_rocketlauncher_remote_damage 70
-set g_balance_rocketlauncher_remote_edgedamage 30
+set g_balance_rocketlauncher_remote_edgedamage 35
 set g_balance_rocketlauncher_remote_radius 100
-set g_balance_rocketlauncher_remote_force 500
+set g_balance_rocketlauncher_remote_force 400
 // }}}
 // {{{ porto
 set g_balance_porto_primary_refire 1.5
@@ -573,14 +582,14 @@ set g_balance_hlac_primary_spread_max 0.25
 set g_balance_hlac_primary_spread_add 0.0045
 set g_balance_hlac_primary_spread_crouchmod 0.25
 
-set g_balance_hlac_primary_damage 23
+set g_balance_hlac_primary_damage 20
 set g_balance_hlac_primary_edgedamage 10
 set g_balance_hlac_primary_force 100
 set g_balance_hlac_primary_radius 70
-set g_balance_hlac_primary_speed 9000
+set g_balance_hlac_primary_speed 12000
 set g_balance_hlac_primary_lifetime 5
 
-set g_balance_hlac_primary_refire 0.1
+set g_balance_hlac_primary_refire 0.15
 set g_balance_hlac_primary_animtime 0.4
 set g_balance_hlac_primary_ammo 1
 
@@ -588,7 +597,7 @@ set g_balance_hlac_secondary 1
 set g_balance_hlac_secondary_spread 0.15
 set g_balance_hlac_secondary_spread_crouchmod 0.5
 
-set g_balance_hlac_secondary_damage 23
+set g_balance_hlac_secondary_damage 20
 set g_balance_hlac_secondary_edgedamage 10
 set g_balance_hlac_secondary_force 100
 set g_balance_hlac_secondary_radius 70
@@ -600,38 +609,39 @@ set g_balance_hlac_secondary_animtime 0.3
 set g_balance_hlac_secondary_ammo 10
 set g_balance_hlac_secondary_shots 6
 // }}}
-// {{{ campingrifle
-set g_balance_campingrifle_magazinecapacity 8 // make it pretty much useless in close combat
-set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_on_switch 0
-set g_balance_campingrifle_bursttime 0
-set g_balance_campingrifle_primary_tracer 1
-set g_balance_campingrifle_primary_damage 65
-set g_balance_campingrifle_primary_headshotaddeddamage 75
-set g_balance_campingrifle_primary_spread 0
-set g_balance_campingrifle_primary_force 2
-set g_balance_campingrifle_primary_speed 40000
-set g_balance_campingrifle_primary_lifetime 5
-set g_balance_campingrifle_primary_refire 0.75
-set g_balance_campingrifle_primary_animtime 0.3
-set g_balance_campingrifle_primary_ammo 10
-set g_balance_campingrifle_primary_bulletconstant 110 // 62.2qu
-set g_balance_campingrifle_primary_burstcost 0
-set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
-set g_balance_campingrifle_secondary 1
-set g_balance_campingrifle_secondary_tracer 0
-set g_balance_campingrifle_secondary_damage 50
-set g_balance_campingrifle_secondary_headshotaddeddamage 50 // 50 damage only on head
-set g_balance_campingrifle_secondary_spread 0
-set g_balance_campingrifle_secondary_force 2
-set g_balance_campingrifle_secondary_speed 20000
-set g_balance_campingrifle_secondary_lifetime 5
-set g_balance_campingrifle_secondary_refire 0.1
-set g_balance_campingrifle_secondary_animtime 0.1
-set g_balance_campingrifle_secondary_ammo 10
-set g_balance_campingrifle_secondary_bulletconstant 110 // 15.5qu
-set g_balance_campingrifle_secondary_burstcost 0
-set g_balance_campingrifle_secondary_bullethail 0 // empty magazine on shot
+// {{{ sniperrifle
+set g_balance_sniperrifle_magazinecapacity 8 // make it pretty much useless in close combat
+set g_balance_sniperrifle_reloadtime 2 // matches reload anim
+set g_balance_sniperrifle_auto_reload_on_switch 0
+set g_balance_sniperrifle_bursttime 0
+set g_balance_sniperrifle_primary_tracer 1
+set g_balance_sniperrifle_primary_damage 50
+set g_balance_sniperrifle_primary_headshotaddeddamage 70
+set g_balance_sniperrifle_primary_spread 0
+set g_balance_sniperrifle_primary_force 100
+set g_balance_sniperrifle_primary_speed 40000
+set g_balance_sniperrifle_primary_lifetime 5
+set g_balance_sniperrifle_primary_refire 1
+set g_balance_sniperrifle_primary_animtime 0.5
+set g_balance_sniperrifle_primary_ammo 10
+set g_balance_sniperrifle_primary_bulletconstant 110 // 62.2qu
+set g_balance_sniperrifle_primary_burstcost 0
+set g_balance_sniperrifle_primary_bullethail 0 // empty magazine on shot
+set g_balance_sniperrifle_secondary 1
+set g_balance_sniperrifle_secondary_reload 0
+set g_balance_sniperrifle_secondary_tracer 0
+set g_balance_sniperrifle_secondary_damage 25
+set g_balance_sniperrifle_secondary_headshotaddeddamage 35
+set g_balance_sniperrifle_secondary_spread 0.01
+set g_balance_sniperrifle_secondary_force 50
+set g_balance_sniperrifle_secondary_speed 20000
+set g_balance_sniperrifle_secondary_lifetime 5
+set g_balance_sniperrifle_secondary_refire 0.6
+set g_balance_sniperrifle_secondary_animtime 0.3
+set g_balance_sniperrifle_secondary_ammo 10
+set g_balance_sniperrifle_secondary_bulletconstant 110 // 15.5qu
+set g_balance_sniperrifle_secondary_burstcost 0
+set g_balance_sniperrifle_secondary_bullethail 0 // empty magazine on shot
 // }}}
 // {{{ tuba
 set g_balance_tuba_refire 0.05
@@ -683,19 +693,19 @@ set g_balance_fireball_secondary_speed_z 0
 set g_balance_fireball_secondary_spread 0
 // }}}
 // {{{ seeker
-set g_balance_seeker_flac_ammo 0.5
+set g_balance_seeker_flac_ammo 1
 set g_balance_seeker_flac_animtime 0.1
-set g_balance_seeker_flac_damage 15
+set g_balance_seeker_flac_damage 20
 set g_balance_seeker_flac_edgedamage 10
 set g_balance_seeker_flac_force 50
-set g_balance_seeker_flac_lifetime 0.1
-set g_balance_seeker_flac_lifetime_rand 0.05
-set g_balance_seeker_flac_radius 100
-set g_balance_seeker_flac_refire 0.1
+set g_balance_seeker_flac_lifetime 30
+set g_balance_seeker_flac_lifetime_rand 0
+set g_balance_seeker_flac_radius 70
+set g_balance_seeker_flac_refire 0.2
 set g_balance_seeker_flac_speed 3000
-set g_balance_seeker_flac_speed_up 1000
+set g_balance_seeker_flac_speed_up 0
 set g_balance_seeker_flac_speed_z 0
-set g_balance_seeker_flac_spread 0.4
+set g_balance_seeker_flac_spread 0.05
 set g_balance_seeker_missile_accel 3000
 set g_balance_seeker_missile_ammo 2
 set g_balance_seeker_missile_animtime 0.3
index 72283286f3831fc29beff6cad238f71069b9da31..be945fa6703c6b65d53a43540604cb2084f62b49 100644 (file)
@@ -13,7 +13,7 @@ set g_start_weapon_minstanex -1 "0 = never provide the weapon, 1 = always provid
 set g_start_weapon_porto -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_hook -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_hlac -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_start_weapon_campingrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_sniperrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_fireball -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_seeker -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
@@ -145,7 +145,7 @@ set g_balance_fuel_limit 999
 
 // {{{ misc
 set g_balance_selfdamagepercent 0.65
-set g_balance_weaponswitchdelay 0.1
+set g_balance_weaponswitchdelay 0.15
 set g_weaponspeedfactor 1 "weapon projectile speed multiplier"
 set g_weaponratefactor 1 "weapon fire rate multiplier"
 set g_weapondamagefactor 1 "weapon damage multiplier"
@@ -181,7 +181,7 @@ set g_balance_falldamage_maxdamage 15
 // }}}
 
 // {{{ powerups
-set g_balance_powerup_invincible_takedamage 0.3
+set g_balance_powerup_invincible_takedamage 0.6
 set g_balance_powerup_invincible_time 30
 set g_balance_powerup_strength_damage 3
 set g_balance_powerup_strength_force 4
@@ -219,13 +219,14 @@ set g_balance_laser_primary_radius 60
 set g_balance_laser_primary_speed 5000
 set g_balance_laser_primary_spread 0
 set g_balance_laser_primary_refire 0.6
-set g_balance_laser_primary_animtime 0.6
+set g_balance_laser_primary_animtime 0.4
 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 // 300 upforce
 set g_balance_laser_primary_force_velocitybias 0.3
+set g_balance_laser_primary_force_other_scale 2.5 // force 375 when pushing others around
 set g_balance_laser_secondary 0 // when 1, a secondary laser mode exists
 set g_balance_laser_secondary_damage 200 // dps
 set g_balance_laser_secondary_edgedamage 0
@@ -241,6 +242,7 @@ set g_balance_laser_secondary_delay 0
 set g_balance_laser_secondary_gauntlet 1
 set g_balance_laser_secondary_force_zscale 1.25
 set g_balance_laser_secondary_force_velocitybias 0
+set g_balance_laser_secondary_force_other_scale 0
 // }}}
 // {{{ shotgun
 set g_balance_shotgun_primary_bullets 18
@@ -248,7 +250,7 @@ set g_balance_shotgun_primary_damage 4
 set g_balance_shotgun_primary_force 20
 set g_balance_shotgun_primary_spread 0.18
 set g_balance_shotgun_primary_refire 1
-set g_balance_shotgun_primary_animtime 0.4
+set g_balance_shotgun_primary_animtime 0.3
 set g_balance_shotgun_primary_ammo 1
 set g_balance_shotgun_primary_speed 12000
 set g_balance_shotgun_primary_bulletconstant 75 // 3.8qu
@@ -269,15 +271,16 @@ set g_balance_uzi_spread_max 0.6
 set g_balance_uzi_spread_add 0.008
 
 set g_balance_uzi_burst 3                              // # of bullets in a burst (if set to 2 or more)
+set g_balance_uzi_burst_animtime 0.45
 set g_balance_uzi_burst_refire 0.05            // refire between burst bullets
 set g_balance_uzi_burst_refire2 0.45   // refire after burst
-set g_balance_uzi_burst_spread 0.05
-set g_balance_uzi_burst_damage 20       // 100 dps, delivered in 0.15s 
+set g_balance_uzi_burst_spread 0.07
+set g_balance_uzi_burst_damage 25
 set g_balance_uzi_burst_force 50
 set g_balance_uzi_burst_ammo 3
 
 set g_balance_uzi_first 1
-set g_balance_uzi_first_damage 20       // 100 dps
+set g_balance_uzi_first_damage 22
 set g_balance_uzi_first_force 50
 set g_balance_uzi_first_spread 0.03
 set g_balance_uzi_first_refire 0.2
@@ -285,7 +288,7 @@ set g_balance_uzi_first_ammo 2
 
 set g_balance_uzi_sustained_damage 12   // 120 dps
 set g_balance_uzi_sustained_force 12
-set g_balance_uzi_sustained_spread 0.08
+set g_balance_uzi_sustained_spread 0.06
 set g_balance_uzi_sustained_refire 0.1
 set g_balance_uzi_sustained_ammo 1
 
@@ -305,7 +308,7 @@ set g_balance_grenadelauncher_primary_spread 0
 set g_balance_grenadelauncher_primary_lifetime 5
 set g_balance_grenadelauncher_primary_lifetime2 0.65
 set g_balance_grenadelauncher_primary_refire 0.8
-set g_balance_grenadelauncher_primary_animtime 0.4
+set g_balance_grenadelauncher_primary_animtime 0.3
 set g_balance_grenadelauncher_primary_ammo 2
 set g_balance_grenadelauncher_primary_health 80
 set g_balance_grenadelauncher_primary_damageforcescale 0
@@ -323,7 +326,7 @@ set g_balance_grenadelauncher_secondary_spread 0
 set g_balance_grenadelauncher_secondary_lifetime 3
 set g_balance_grenadelauncher_secondary_lifetime2 0.65
 set g_balance_grenadelauncher_secondary_refire 0.8
-set g_balance_grenadelauncher_secondary_animtime 0.4
+set g_balance_grenadelauncher_secondary_animtime 0.3
 set g_balance_grenadelauncher_secondary_ammo 2
 set g_balance_grenadelauncher_secondary_health 40
 set g_balance_grenadelauncher_secondary_damageforcescale 0
@@ -341,7 +344,7 @@ set g_balance_minelayer_proximityradius 150
 set g_balance_minelayer_speed 750
 set g_balance_minelayer_lifetime 60
 set g_balance_minelayer_refire 1.5
-set g_balance_minelayer_animtime 0.4
+set g_balance_minelayer_animtime 0.3
 set g_balance_minelayer_ammo 5
 set g_balance_minelayer_health 15
 set g_balance_minelayer_limit 4 // 0 disables the limit
@@ -356,17 +359,17 @@ set g_balance_minelayer_remote_force 300
 // }}}
 // {{{ electro
 set g_balance_electro_lightning 1
-set g_balance_electro_primary_damage 92
+set g_balance_electro_primary_damage 100
 set g_balance_electro_primary_edgedamage 0
 set g_balance_electro_primary_force 425
 set g_balance_electro_primary_force_up 125
 set g_balance_electro_primary_radius 850
-set g_balance_electro_primary_comboradius 75
+set g_balance_electro_primary_comboradius 150
 set g_balance_electro_primary_speed 0
 set g_balance_electro_primary_spread 0
 set g_balance_electro_primary_lifetime 0
 set g_balance_electro_primary_refire 0.4
-set g_balance_electro_primary_animtime 0.03333333
+set g_balance_electro_primary_animtime 0.2
 set g_balance_electro_primary_ammo 5
 set g_balance_electro_primary_range 800
 set g_balance_electro_primary_falloff_mindist 0
@@ -407,9 +410,10 @@ set g_balance_crylink_primary_spread 0.05
 set g_balance_crylink_primary_shots 7
 set g_balance_crylink_primary_bounces 2
 set g_balance_crylink_primary_refire 0.8
-set g_balance_crylink_primary_animtime 0.4
+set g_balance_crylink_primary_animtime 0.3
 set g_balance_crylink_primary_ammo 2
 set g_balance_crylink_primary_bouncedamagefactor 0.2
+set g_balance_crylink_primary_joindelay 0
 set g_balance_crylink_primary_joinspread 0.2
 set g_balance_crylink_primary_jointime 0.1
 set g_balance_crylink_primary_joinexplode 0
@@ -425,20 +429,21 @@ set g_balance_crylink_primary_other_lifetime 2 // range: 800 full, fades to 1300
 set g_balance_crylink_primary_other_fadetime 0.25
 
 set g_balance_crylink_secondary 1
-set g_balance_crylink_secondary_damage 3
-set g_balance_crylink_secondary_edgedamage 0
-set g_balance_crylink_secondary_force -20
-set g_balance_crylink_secondary_radius 5
-set g_balance_crylink_secondary_speed 1700
-set g_balance_crylink_secondary_spread 0.03
-set g_balance_crylink_secondary_shots 3
-set g_balance_crylink_secondary_bounces 0
-set g_balance_crylink_secondary_refire 0.15
-set g_balance_crylink_secondary_animtime 0.15
-set g_balance_crylink_secondary_ammo 1
-set g_balance_crylink_secondary_bouncedamagefactor 0.5
-set g_balance_crylink_secondary_joinspread 0
-set g_balance_crylink_secondary_jointime 0
+set g_balance_crylink_secondary_damage 8
+set g_balance_crylink_secondary_edgedamage 3
+set g_balance_crylink_secondary_force 20
+set g_balance_crylink_secondary_radius 20
+set g_balance_crylink_secondary_speed 1500
+set g_balance_crylink_secondary_spread 0.1
+set g_balance_crylink_secondary_shots 6
+set g_balance_crylink_secondary_bounces 2
+set g_balance_crylink_secondary_refire 0.8
+set g_balance_crylink_secondary_animtime 0.3
+set g_balance_crylink_secondary_ammo 2
+set g_balance_crylink_secondary_bouncedamagefactor 0.2
+set g_balance_crylink_secondary_joindelay 0
+set g_balance_crylink_secondary_joinspread 0.2
+set g_balance_crylink_secondary_jointime 0.1
 set g_balance_crylink_secondary_joinexplode 0                  
 set g_balance_crylink_secondary_joinexplode_damage 0   
 set g_balance_crylink_secondary_joinexplode_edgedamage 0
@@ -449,13 +454,13 @@ set g_balance_crylink_secondary_linkexplode 1
 set g_balance_crylink_secondary_middle_lifetime 5 // range: 10000 full, fades to 10000
 set g_balance_crylink_secondary_middle_fadetime 5
 set g_balance_crylink_secondary_line_lifetime 2 // range: 4000 full, fades to 8000
-set g_balance_crylink_secondary_line_fadetime 2
+set g_balance_crylink_secondary_line_fadetime 0.25
 // }}}
 // {{{ nex
 set g_balance_nex_primary_damage 90
 set g_balance_nex_primary_force 500
 set g_balance_nex_primary_refire 1
-set g_balance_nex_primary_animtime 0.4
+set g_balance_nex_primary_animtime 0.3
 set g_balance_nex_primary_ammo 5
 set g_balance_nex_primary_damagefalloff_mindist 0
 set g_balance_nex_primary_damagefalloff_maxdist 0
@@ -466,14 +471,14 @@ set g_balance_nex_secondary 1
 set g_balance_nex_secondary_charge 1
 set g_balance_nex_secondary_charge_rate 0.4
 set g_balance_nex_secondary_chargepool 1
-set g_balance_nex_secondary_chargepool_regen 0.15
-set g_balance_nex_secondary_chargepool_pause_regen 1
-set g_balance_nex_secondary_chargepool_pause_health_regen 1
+set g_balance_nex_secondary_chargepool_regen 0.25
+set g_balance_nex_secondary_chargepool_pause_regen 2
+set g_balance_nex_secondary_chargepool_pause_health_regen 0.5
 set g_balance_nex_secondary_damage 0
 set g_balance_nex_secondary_force 0
 set g_balance_nex_secondary_refire 0
 set g_balance_nex_secondary_animtime 0
-set g_balance_nex_secondary_ammo 0.2 // full charge pool is 1, so it depletes in 5 secs
+set g_balance_nex_secondary_ammo 0.4 // full charge pool is 1, so it depletes in 2.5 secs
 set g_balance_nex_secondary_damagefalloff_mindist 0
 set g_balance_nex_secondary_damagefalloff_maxdist 0
 set g_balance_nex_secondary_damagefalloff_halflife 0
@@ -485,7 +490,7 @@ set g_balance_nex_charge_start 0.5
 set g_balance_nex_charge_rate 0.5
 set g_balance_nex_charge_limit 0.5
 set g_balance_nex_charge_rot_rate 0.1
-set g_balance_nex_charge_rot_pause 1 // Dont rot down until this long after release of charge button
+set g_balance_nex_charge_rot_pause 0.5 // Dont rot down until this long after release of charge button
 set g_balance_nex_charge_shot_multiplier 0
 set g_balance_nex_charge_velocity_rate 0
 set g_balance_nex_charge_minspeed 600
@@ -493,14 +498,14 @@ set g_balance_nex_charge_maxspeed 1000
 // }}}
 // {{{ minstanex
 set g_balance_minstanex_refire 1
-set g_balance_minstanex_animtime 0.75
+set g_balance_minstanex_animtime 0.50
 set g_balance_minstanex_ammo 10
 // }}}
 // {{{ hagar
 set g_balance_hagar_primary_damage 14
 set g_balance_hagar_primary_edgedamage 6
 set g_balance_hagar_primary_force 70
-set g_balance_hagar_primary_radius 115
+set g_balance_hagar_primary_radius 110
 set g_balance_hagar_primary_spread 0.1
 set g_balance_hagar_primary_speed 1800
 set g_balance_hagar_primary_lifetime 5
@@ -528,7 +533,7 @@ set g_balance_rocketlauncher_speedaccel 1400
 set g_balance_rocketlauncher_speedstart 800
 set g_balance_rocketlauncher_lifetime 5
 set g_balance_rocketlauncher_refire 1
-set g_balance_rocketlauncher_animtime 0.4
+set g_balance_rocketlauncher_animtime 0.3
 set g_balance_rocketlauncher_ammo 3
 set g_balance_rocketlauncher_health 0
 set g_balance_rocketlauncher_damageforcescale 0
@@ -545,7 +550,7 @@ set g_balance_rocketlauncher_remote_force 350
 // }}}
 // {{{ porto
 set g_balance_porto_primary_refire 1.5
-set g_balance_porto_primary_animtime 0.3
+set g_balance_porto_primary_animtime 0.2
 set g_balance_porto_primary_speed 2000
 set g_balance_porto_primary_lifetime 5
 set g_balance_portal_health 200 // these get recharged whenever the portal is used
@@ -554,7 +559,7 @@ set g_balance_portal_lifetime 15 // these get recharged whenever the portal is u
 // {{{ hook
 set g_balance_hook_primary_fuel 5 // hook monkeys set 0
 set g_balance_hook_primary_refire 0 // hook monkeys set 0
-set g_balance_hook_primary_animtime 0.3 // good shoot anim
+set g_balance_hook_primary_animtime 0.2 // good shoot anim
 set g_balance_hook_primary_hooked_time_max 0 // infinite
 set g_balance_hook_primary_hooked_time_free 2 // 2s being hooked are free
 set g_balance_hook_primary_hooked_fuel 5 // fuel per second hooked
@@ -567,7 +572,7 @@ set g_balance_hook_secondary_lifetime 5 // infinite
 set g_balance_hook_secondary_speed 0 // not much throwing
 set g_balance_hook_secondary_gravity 5 // fast falling
 set g_balance_hook_secondary_refire 3 // don't drop too many bombs...
-set g_balance_hook_secondary_animtime 0.3 // good shoot anim
+set g_balance_hook_secondary_animtime 0.2 // good shoot anim
 set g_balance_hook_secondary_power 3 // effect behaves like a square function
 set g_balance_hook_secondary_duration 1.5 // effect runs for three seconds
 // }}}
@@ -585,7 +590,7 @@ set g_balance_hlac_primary_speed 9000
 set g_balance_hlac_primary_lifetime 5
 
 set g_balance_hlac_primary_refire 0.1
-set g_balance_hlac_primary_animtime 0.3
+set g_balance_hlac_primary_animtime 0.2
 set g_balance_hlac_primary_ammo 1
 
 set g_balance_hlac_secondary 1
@@ -600,42 +605,43 @@ set g_balance_hlac_secondary_speed 9000
 set g_balance_hlac_secondary_lifetime 5
 
 set g_balance_hlac_secondary_refire 0.8
-set g_balance_hlac_secondary_animtime 0.6
+set g_balance_hlac_secondary_animtime 0.4
 set g_balance_hlac_secondary_ammo 4
 set g_balance_hlac_secondary_shots 6
 // }}}
-// {{{ campingrifle
-set g_balance_campingrifle_magazinecapacity 8 // make it pretty much useless in close combat
-set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_on_switch 0
-set g_balance_campingrifle_bursttime 0
-set g_balance_campingrifle_primary_tracer 1
-set g_balance_campingrifle_primary_damage 60
-set g_balance_campingrifle_primary_headshotaddeddamage 100
-set g_balance_campingrifle_primary_spread 0
-set g_balance_campingrifle_primary_force 2
-set g_balance_campingrifle_primary_speed 40000
-set g_balance_campingrifle_primary_lifetime 5
-set g_balance_campingrifle_primary_refire 1.5
-set g_balance_campingrifle_primary_animtime 1.4
-set g_balance_campingrifle_primary_ammo 10
-set g_balance_campingrifle_primary_bulletconstant 110 // 62.2qu
-set g_balance_campingrifle_primary_burstcost 0
-set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
-set g_balance_campingrifle_secondary 1
-set g_balance_campingrifle_secondary_tracer 0
-set g_balance_campingrifle_secondary_damage 42
-set g_balance_campingrifle_secondary_headshotaddeddamage 70
-set g_balance_campingrifle_secondary_spread 0
-set g_balance_campingrifle_secondary_force 2
-set g_balance_campingrifle_secondary_speed 20000
-set g_balance_campingrifle_secondary_lifetime 5
-set g_balance_campingrifle_secondary_refire 1.5
-set g_balance_campingrifle_secondary_animtime 1.4
-set g_balance_campingrifle_secondary_ammo 10
-set g_balance_campingrifle_secondary_bulletconstant 110 // 15.5qu
-set g_balance_campingrifle_secondary_burstcost 0
-set g_balance_campingrifle_secondary_bullethail 0 // empty magazine on shot
+// {{{ sniperrifle
+set g_balance_sniperrifle_magazinecapacity 8 // make it pretty much useless in close combat
+set g_balance_sniperrifle_reloadtime 2 // matches reload anim
+set g_balance_sniperrifle_auto_reload_on_switch 0
+set g_balance_sniperrifle_bursttime 0
+set g_balance_sniperrifle_primary_tracer 1
+set g_balance_sniperrifle_primary_damage 60
+set g_balance_sniperrifle_primary_headshotaddeddamage 60
+set g_balance_sniperrifle_primary_spread 0
+set g_balance_sniperrifle_primary_force 2
+set g_balance_sniperrifle_primary_speed 40000
+set g_balance_sniperrifle_primary_lifetime 5
+set g_balance_sniperrifle_primary_refire 1.5
+set g_balance_sniperrifle_primary_animtime 1.4
+set g_balance_sniperrifle_primary_ammo 10
+set g_balance_sniperrifle_primary_bulletconstant 110 // 62.2qu
+set g_balance_sniperrifle_primary_burstcost 0
+set g_balance_sniperrifle_primary_bullethail 0 // empty magazine on shot
+set g_balance_sniperrifle_secondary 1
+set g_balance_sniperrifle_secondary_reload 1
+set g_balance_sniperrifle_secondary_tracer 0
+set g_balance_sniperrifle_secondary_damage 42
+set g_balance_sniperrifle_secondary_headshotaddeddamage 42
+set g_balance_sniperrifle_secondary_spread 0
+set g_balance_sniperrifle_secondary_force 2
+set g_balance_sniperrifle_secondary_speed 20000
+set g_balance_sniperrifle_secondary_lifetime 5
+set g_balance_sniperrifle_secondary_refire 1.5
+set g_balance_sniperrifle_secondary_animtime 1.4
+set g_balance_sniperrifle_secondary_ammo 10
+set g_balance_sniperrifle_secondary_bulletconstant 110 // 15.5qu
+set g_balance_sniperrifle_secondary_burstcost 0
+set g_balance_sniperrifle_secondary_bullethail 0 // empty magazine on shot
 // }}}
 // {{{ tuba
 set g_balance_tuba_refire 0.05
@@ -650,7 +656,7 @@ set g_balance_tuba_force 40
 // }}}
 // {{{ fireball
 set g_balance_fireball_primary_ammo 40
-set g_balance_fireball_primary_animtime 0.15
+set g_balance_fireball_primary_animtime 0.2
 set g_balance_fireball_primary_bfgdamage 100
 set g_balance_fireball_primary_bfgforce 0
 set g_balance_fireball_primary_bfgradius 1000
@@ -670,7 +676,7 @@ set g_balance_fireball_primary_refire2 0
 set g_balance_fireball_primary_speed 650
 set g_balance_fireball_primary_spread 0
 set g_balance_fireball_secondary_ammo 5
-set g_balance_fireball_secondary_animtime 0.3
+set g_balance_fireball_secondary_animtime 0.2
 set g_balance_fireball_secondary_damage 40
 set g_balance_fireball_secondary_damageforcescale 4
 set g_balance_fireball_secondary_damagetime 5
@@ -702,7 +708,7 @@ set g_balance_seeker_flac_speed_z 0
 set g_balance_seeker_flac_spread 0.4
 set g_balance_seeker_missile_accel 1400
 set g_balance_seeker_missile_ammo 2
-set g_balance_seeker_missile_animtime 0.3
+set g_balance_seeker_missile_animtime 0.2
 set g_balance_seeker_missile_count 8
 set g_balance_seeker_missile_damage 15
 set g_balance_seeker_missile_damageforcescale 4
@@ -728,7 +734,7 @@ set g_balance_seeker_missile_speed_max 1400
 set g_balance_seeker_missile_spread 0
 set g_balance_seeker_missile_turnrate 0.65
 set g_balance_seeker_tag_ammo 1
-set g_balance_seeker_tag_animtime 0.3
+set g_balance_seeker_tag_animtime 0.2
 set g_balance_seeker_tag_damageforcescale 4
 set g_balance_seeker_tag_health 5
 set g_balance_seeker_tag_lifetime 15
index bff56f2338ad346fa758ec12c549681cde7c50af..87612d234899abf1d94ac1aa441f6e52de5eeb57 100644 (file)
@@ -13,7 +13,7 @@ set g_start_weapon_minstanex -1 "0 = never provide the weapon, 1 = always provid
 set g_start_weapon_porto -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_hook -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_hlac -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
-set g_start_weapon_campingrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
+set g_start_weapon_sniperrifle -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_tuba -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_fireball -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
 set g_start_weapon_seeker -1 "0 = never provide the weapon, 1 = always provide the weapon, -1 = game mode default, -2 = provide the weapon in ca and lms"
@@ -55,67 +55,52 @@ set g_balance_nix_ammoincr_fuel 2
 // {{{ pickup items
 set g_pickup_ammo_anyway 1
 set g_pickup_weapons_anyway 1
-
 set g_pickup_shells 20
 set g_pickup_shells_weapon 10
 set g_pickup_shells_max 50
-
 set g_pickup_nails 60
 set g_pickup_nails_weapon 60
 set g_pickup_nails_max 300
-
 set g_pickup_rockets 25
 set g_pickup_rockets_weapon 15
 set g_pickup_rockets_max 150
-
 set g_pickup_cells 30
 set g_pickup_cells_weapon 20
 set g_pickup_cells_max 300
-
 set g_pickup_fuel 25
 set g_pickup_fuel_weapon 15
 set g_pickup_fuel_jetpack 50
 set g_pickup_fuel_max 999
-
 set g_pickup_armorsmall 5
 set g_pickup_armorsmall_max 999
 set g_pickup_armorsmall_anyway 0
-
 set g_pickup_armormedium 25
 set g_pickup_armormedium_max 100
 set g_pickup_armormedium_anyway 0
-
 set g_pickup_armorbig 50
 set g_pickup_armorbig_max 150
 set g_pickup_armorbig_anyway 0
-
 set g_pickup_armorlarge 100
 set g_pickup_armorlarge_max 999
 set g_pickup_armorlarge_anyway 0
-
 set g_pickup_healthsmall 5
 set g_pickup_healthsmall_max 999
 set g_pickup_healthsmall_anyway 0
-
 set g_pickup_healthmedium 25
 set g_pickup_healthmedium_max 100
 set g_pickup_healthmedium_anyway 0
-
 set g_pickup_healthlarge 50
 set g_pickup_healthlarge_max 150
 set g_pickup_healthlarge_anyway 0
-
 set g_pickup_healthmega 100
 set g_pickup_healthmega_max 999
 set g_pickup_healthmega_anyway 0
-
 set g_pickup_respawntime_short 15
 set g_pickup_respawntime_medium 20
 set g_pickup_respawntime_long 30
 set g_pickup_respawntime_powerup 120
 set g_pickup_respawntime_weapon 20
 set g_pickup_respawntime_ammo 15
-
 set g_pickup_respawntimejitter_short 0
 set g_pickup_respawntimejitter_medium 0
 set g_pickup_respawntimejitter_long 0
@@ -241,6 +226,7 @@ set g_balance_laser_primary_delay 0
 set g_balance_laser_primary_gauntlet 0
 set g_balance_laser_primary_force_zscale 1.2
 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 35
 set g_balance_laser_secondary_edgedamage 10
@@ -256,6 +242,7 @@ set g_balance_laser_secondary_delay 0
 set g_balance_laser_secondary_gauntlet 0
 set g_balance_laser_secondary_force_zscale 1
 set g_balance_laser_secondary_force_velocitybias 0
+set g_balance_laser_secondary_force_other_scale 1
 // }}}
 // {{{ shotgun
 set g_balance_shotgun_primary_bullets 10
@@ -277,7 +264,6 @@ set g_balance_shotgun_secondary_force 150
 set g_balance_shotgun_secondary_refire 1.1
 set g_balance_shotgun_secondary_animtime 1
 // }}}
-
 // {{{ uzi
 set g_balance_uzi_mode 1                               // Activates varible spread for sustained & burst mode secondary
 set g_balance_uzi_spread_min 0.02
@@ -285,6 +271,7 @@ set g_balance_uzi_spread_max 0.6
 set g_balance_uzi_spread_add 0.008
 
 set g_balance_uzi_burst 3                              // # of bullets in a burst (if set to 2 or more)
+set g_balance_uzi_burst_animtime 0.4
 set g_balance_uzi_burst_refire 0.05            // refire between burst bullets
 set g_balance_uzi_burst_refire2 0.4    // refire after burst
 set g_balance_uzi_burst_spread 0.03
@@ -348,7 +335,7 @@ set g_balance_grenadelauncher_secondary_remote_detonateprimary 0
 set g_balance_grenadelauncher_bouncefactor 0.5
 set g_balance_grenadelauncher_bouncestop 0.075
 // }}}
-// {{{ minelayer // TODO
+// {{{ minelayer
 set g_balance_minelayer_damage 35
 set g_balance_minelayer_edgedamage 30
 set g_balance_minelayer_force 250
@@ -388,7 +375,6 @@ set g_balance_electro_primary_range 0
 set g_balance_electro_primary_falloff_mindist 255 // 0.3 * radius
 set g_balance_electro_primary_falloff_maxdist 850
 set g_balance_electro_primary_falloff_halflifedist 425
-
 set g_balance_electro_secondary_damage 25
 set g_balance_electro_secondary_edgedamage 0
 set g_balance_electro_secondary_force 50
@@ -407,7 +393,6 @@ set g_balance_electro_secondary_damageforcescale 2
 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_combo_damage 80
 set g_balance_electro_combo_edgedamage 10
 set g_balance_electro_combo_force 150
@@ -428,6 +413,7 @@ set g_balance_crylink_primary_refire 1
 set g_balance_crylink_primary_animtime 0.4
 set g_balance_crylink_primary_ammo 2
 set g_balance_crylink_primary_bouncedamagefactor 0.2
+set g_balance_crylink_primary_joindelay 0
 set g_balance_crylink_primary_joinspread 0.1
 set g_balance_crylink_primary_jointime 0
 set g_balance_crylink_primary_joinexplode 1                            //if != 0 do a extra damage pass when projectiles join
@@ -436,6 +422,7 @@ set g_balance_crylink_primary_joinexplode_edgedamage 20
 set g_balance_crylink_primary_joinexplode_radius 200
 set g_balance_crylink_primary_joinexplode_force 400
 set g_balance_crylink_primary_linkexplode 0
+
 set g_balance_crylink_primary_middle_lifetime 5 
 set g_balance_crylink_primary_middle_fadetime 0.25
 set g_balance_crylink_primary_other_lifetime 2 // range: 800 full, fades to 1300
@@ -454,6 +441,7 @@ set g_balance_crylink_secondary_refire 0.15
 set g_balance_crylink_secondary_animtime 0.15
 set g_balance_crylink_secondary_ammo 1
 set g_balance_crylink_secondary_bouncedamagefactor 0.5
+set g_balance_crylink_secondary_joindelay 0
 set g_balance_crylink_secondary_joinspread 0
 set g_balance_crylink_secondary_jointime 0
 set g_balance_crylink_secondary_joinexplode 0                  
@@ -535,7 +523,7 @@ set g_balance_hagar_secondary_lifetime_rand 0
 set g_balance_hagar_secondary_refire 0.15
 set g_balance_hagar_secondary_ammo 1
 // }}}
-// {{{ rocketlauncher // TODO
+// {{{ rocketlauncher
 set g_balance_rocketlauncher_damage 120
 set g_balance_rocketlauncher_edgedamage 25
 set g_balance_rocketlauncher_force 350
@@ -615,43 +603,45 @@ set g_balance_hlac_secondary_force 100
 set g_balance_hlac_secondary_radius 50
 set g_balance_hlac_secondary_speed 15000
 set g_balance_hlac_secondary_lifetime 3
+
 set g_balance_hlac_secondary_refire 1
 set g_balance_hlac_secondary_animtime 0.7
 set g_balance_hlac_secondary_ammo 10
 set g_balance_hlac_secondary_shots 6
 // }}}
-// {{{ campingrifle
-set g_balance_campingrifle_magazinecapacity 8 // make it pretty much useless in close combat
-set g_balance_campingrifle_reloadtime 2 // matches reload anim
-set g_balance_campingrifle_auto_reload_on_switch 0
-set g_balance_campingrifle_bursttime 0
-set g_balance_campingrifle_primary_tracer 1
-set g_balance_campingrifle_primary_damage 40
-set g_balance_campingrifle_primary_headshotaddeddamage 100
-set g_balance_campingrifle_primary_spread 0
-set g_balance_campingrifle_primary_force 2
-set g_balance_campingrifle_primary_speed 40000
-set g_balance_campingrifle_primary_lifetime 5
-set g_balance_campingrifle_primary_refire 0.65
-set g_balance_campingrifle_primary_animtime 0.6
-set g_balance_campingrifle_primary_ammo 10
-set g_balance_campingrifle_primary_bulletconstant 110 // 62.2qu
-set g_balance_campingrifle_primary_burstcost 0
-set g_balance_campingrifle_primary_bullethail 0 // empty magazine on shot
-set g_balance_campingrifle_secondary 1
-set g_balance_campingrifle_secondary_tracer 0
-set g_balance_campingrifle_secondary_damage 50
-set g_balance_campingrifle_secondary_headshotaddeddamage 50 // 50 damage only on head
-set g_balance_campingrifle_secondary_spread 0
-set g_balance_campingrifle_secondary_force 2
-set g_balance_campingrifle_secondary_speed 20000
-set g_balance_campingrifle_secondary_lifetime 5
-set g_balance_campingrifle_secondary_refire 1.5
-set g_balance_campingrifle_secondary_animtime 0.6
-set g_balance_campingrifle_secondary_ammo 10
-set g_balance_campingrifle_secondary_bulletconstant 110 // 15.5qu
-set g_balance_campingrifle_secondary_burstcost 0
-set g_balance_campingrifle_secondary_bullethail 0 // empty magazine on shot
+// {{{ sniperrifle
+set g_balance_sniperrifle_magazinecapacity 8 // make it pretty much useless in close combat
+set g_balance_sniperrifle_reloadtime 2 // matches reload anim
+set g_balance_sniperrifle_auto_reload_on_switch 0
+set g_balance_sniperrifle_bursttime 0
+set g_balance_sniperrifle_primary_tracer 1
+set g_balance_sniperrifle_primary_damage 40
+set g_balance_sniperrifle_primary_headshotaddeddamage 100
+set g_balance_sniperrifle_primary_spread 0
+set g_balance_sniperrifle_primary_force 2
+set g_balance_sniperrifle_primary_speed 40000
+set g_balance_sniperrifle_primary_lifetime 5
+set g_balance_sniperrifle_primary_refire 0.65
+set g_balance_sniperrifle_primary_animtime 0.6
+set g_balance_sniperrifle_primary_ammo 10
+set g_balance_sniperrifle_primary_bulletconstant 110 // 62.2qu
+set g_balance_sniperrifle_primary_burstcost 0
+set g_balance_sniperrifle_primary_bullethail 0 // empty magazine on shot
+set g_balance_sniperrifle_secondary 1
+set g_balance_sniperrifle_secondary_reload 0
+set g_balance_sniperrifle_secondary_tracer 0
+set g_balance_sniperrifle_secondary_damage 50
+set g_balance_sniperrifle_secondary_headshotaddeddamage 50 // 50 damage only on head
+set g_balance_sniperrifle_secondary_spread 0
+set g_balance_sniperrifle_secondary_force 2
+set g_balance_sniperrifle_secondary_speed 20000
+set g_balance_sniperrifle_secondary_lifetime 5
+set g_balance_sniperrifle_secondary_refire 1.5
+set g_balance_sniperrifle_secondary_animtime 0.6
+set g_balance_sniperrifle_secondary_ammo 10
+set g_balance_sniperrifle_secondary_bulletconstant 110 // 15.5qu
+set g_balance_sniperrifle_secondary_burstcost 0
+set g_balance_sniperrifle_secondary_bullethail 0 // empty magazine on shot
 // }}}
 // {{{ tuba
 set g_balance_tuba_refire 0.05
@@ -716,7 +706,6 @@ set g_balance_seeker_flac_speed 5000
 set g_balance_seeker_flac_speed_up 500
 set g_balance_seeker_flac_speed_z 0
 set g_balance_seeker_flac_spread 0.25
-
 set g_balance_seeker_missile_accel 1400
 set g_balance_seeker_missile_ammo 2
 set g_balance_seeker_missile_animtime 0.3
@@ -744,7 +733,6 @@ set g_balance_seeker_missile_speed_z 0
 set g_balance_seeker_missile_speed_max 1400
 set g_balance_seeker_missile_spread 0
 set g_balance_seeker_missile_turnrate 0.65
-
 set g_balance_seeker_tag_ammo 1
 set g_balance_seeker_tag_animtime 0.3
 set g_balance_seeker_tag_damageforcescale 4
index c0dce41e134e5c73fad86305edbac252e5486451..4aacf09f1cff3d7c049302aacfc546330896f0d8 100644 (file)
@@ -15,7 +15,7 @@ set g_weaponreplace_porto ""
 set g_weaponreplace_minstanex ""
 set g_weaponreplace_hook ""
 set g_weaponreplace_hlac 0 // Maybe will be enabled later after I figure out what I want to do with it
-set g_weaponreplace_campingrifle ""
+set g_weaponreplace_sniperrifle ""
 set g_weaponreplace_tuba "" 
 set g_weaponreplace_fireball 0 // Same with this
 set g_weaponreplace_seeker 0 // Same with this
index 35d5da985993d7ad40c8d974ebf7620ba60ac08b..b8a5ce7a17658bd11f6a50107cde738c5d8aaaf7 100644 (file)
@@ -7,6 +7,7 @@ exec defaultXonotic.cfg
 
 // players
 sv_fbskin_green // visible playermodel forced on everyone
+set teamplay_mode 2 // friendly fire and self damage
 
 //================
 // impure changes
@@ -25,8 +26,6 @@ set g_shootfromcenter 1 // hit where you point at with the crosshair (almost so,
 // match rules
 set timelimit_overtimes 1 // overtimes on, draw matches are less interesting! :)
 set g_forced_respawn 1 // no delaying/cheating a match by not spawning
-set g_mirrordamage 0 // hurting teammates does not hurt you...
-set g_friendlyfire 1 // ...it hurts them.
 
 // info
 set sv_fragmessage_information_stats 0 // don't reveal how much health/armor the attacker had
index 4155fa94320be12356efb127081259b612310edf..eaf8aa27af54a6f824f5fde48611387ffce9f52a 100644 (file)
@@ -169,10 +169,10 @@ seta crosshair_seeker ""  "crosshair to display when wielding the TAG Seeker"
 seta crosshair_seeker_color "1 0.35 0.35"      "crosshair color to display when wielding the TAG seeker"
 seta crosshair_seeker_alpha 0.9        "crosshair alpha value to display when wielding the TAG seeker"
 seta crosshair_seeker_size 0.8 "crosshair size when wielding the TAG seeker"
-seta crosshair_campingrifle "" "crosshair to display when wielding the campingrifle"
-seta crosshair_campingrifle_color "0.85 0.5 0.25"      "crosshair color to display when wielding the campingrifle"
-seta crosshair_campingrifle_alpha 1    "crosshair alpha value to display when wielding the campingrifle"
-seta crosshair_campingrifle_size 0.65  "crosshair size when wielding the campingrifle"
+seta crosshair_sniperrifle ""  "crosshair to display when wielding the sniperrifle"
+seta crosshair_sniperrifle_color "0.85 0.5 0.25"       "crosshair color to display when wielding the sniperrifle"
+seta crosshair_sniperrifle_alpha 1     "crosshair alpha value to display when wielding the sniperrifle"
+seta crosshair_sniperrifle_size 0.65   "crosshair size when wielding the sniperrifle"
 seta crosshair_tuba "" "crosshair to display when wielding the tuba"
 seta crosshair_tuba_color "0.85 0.5 0.25"      "crosshair color to display when wielding the tuba"
 seta crosshair_tuba_alpha 1    "crosshair alpha value to display when wielding the tuba"
@@ -186,7 +186,7 @@ seta crosshair_fireball_size 1      "crosshair size when wielding the fireball"
 seta crosshair_ring_size 2     "bullet counter ring size for Rifle, velocity ring for Nex"
 seta crosshair_ring_alpha 0.2  "ring alpha"
 
-seta crosshair_ring_campingrifle_alpha 0.15
+seta crosshair_ring_sniperrifle_alpha 0.15
 
 seta crosshair_ring_nex_outer_alpha 0.15
 seta crosshair_ring_nex_inner_alpha 0.15
@@ -401,16 +401,16 @@ seta bot_suffix ""        "Suffix behind the bot names"
 seta skill_auto 0      "when 1, \"skill\" gets adjusted to match the best player on the map"
 // general bot AI cvars
 set bot_ai_thinkinterval 0.05
-set bot_ai_strategyinterval 3 "How often a new objective is chosen"
-set bot_ai_enemydetectioninterval 0.5 "How often bots pick a new target"
+set bot_ai_strategyinterval 5 "How often a new objective is chosen"
+set bot_ai_enemydetectioninterval 3 "How often bots pick a new target"
 set bot_ai_enemydetectionradius 10000 "How far bots can see enemies"
-set bot_ai_dodgeupdateinterval 0.1 "How often scan for items to dodge. Currently not in use."
-set bot_ai_chooseweaponinterval 0.3 "How often the best weapon according to the situation will be chosen"
-set bot_ai_dangerdetectioninterval 0.1 "How often scan for waypoints with dangers near"
+set bot_ai_dodgeupdateinterval 0.2 "How often scan for items to dodge. Currently not in use."
+set bot_ai_chooseweaponinterval 0.5 "How often the best weapon according to the situation will be chosen"
+set bot_ai_dangerdetectioninterval 0.25 "How often scan for waypoints with dangers near"
 set bot_ai_dangerdetectionupdates 64 "How many waypoints will be considered for danger detection"
 set bot_ai_aimskill_blendrate 2        "How much correction will be applied to the aiming angle"
 set bot_ai_aimskill_fixedrate 15
-set bot_ai_aimskill_firetolerance_distdegrees 180
+set bot_ai_aimskill_firetolerance_distdegrees 100
 set bot_ai_aimskill_firetolerance_mindegrees 2 "Minimum angle tolerance. Used on large distances"
 set bot_ai_aimskill_firetolerance_maxdegrees 60 "Maximum firing angle. Used on close range"
 set bot_ai_aimskill_mouse 1 "How much of the aiming filters are applied"
@@ -419,17 +419,17 @@ set bot_ai_keyboard_treshold 0.57
 set bot_ai_aimskill_offset 0.3 "Amount of error induced to the bots aim"
 set bot_ai_aimskill_think 1 "Aiming velocity. Use values below 1 for slower aiming"
 set bot_ai_custom_weapon_priority_distances "300 850"  "Define close and far distances in any order. Based on the distance to the enemy bots will choose different weapons"
-set bot_ai_custom_weapon_priority_far   "minstanex nex campingrifle electro rocketlauncher grenadelauncher hagar hlac crylink laser uzi fireball seeker shotgun tuba minelayer"        "Desired weapons for far distances ordered by priority"
-set bot_ai_custom_weapon_priority_mid   "minstanex rocketlauncher nex fireball seeker grenadelauncher electro uzi campingrifle crylink hlac hagar shotgun laser tuba minelayer"        "Desired weapons for middle distances ordered by priority"
-set bot_ai_custom_weapon_priority_close "minstanex shotgun nex uzi hlac tuba seeker hagar crylink grenadelauncher electro campingrifle rocketlauncher laser fireball minelayer"        "Desired weapons for close distances ordered by priority"
+set bot_ai_custom_weapon_priority_far   "minstanex nex sniperrifle electro rocketlauncher grenadelauncher hagar hlac crylink laser uzi fireball seeker shotgun tuba minelayer" "Desired weapons for far distances ordered by priority"
+set bot_ai_custom_weapon_priority_mid   "minstanex rocketlauncher nex fireball seeker grenadelauncher electro uzi sniperrifle crylink hlac hagar shotgun laser tuba minelayer" "Desired weapons for middle distances ordered by priority"
+set bot_ai_custom_weapon_priority_close "minstanex shotgun nex uzi hlac tuba seeker hagar crylink grenadelauncher electro sniperrifle rocketlauncher laser fireball minelayer" "Desired weapons for close distances ordered by priority"
 set bot_ai_weapon_combo 1      "Enable bots to do weapon combos"
-set bot_ai_weapon_combo_threshold 0.3  "Try to make a combo N seconds after the last attack"
+set bot_ai_weapon_combo_threshold 0.4  "Try to make a combo N seconds after the last attack"
 set bot_ai_friends_aware_pickup_radius "500"   "Bots will not pickup items if a team mate is this distance near the item"
 set bot_ai_ignoregoal_timeout 3        "Ignore goals making bots to get stuck in front of a wall for N seconds"
 set bot_ai_bunnyhop_skilloffset 7      "Bots with skill equal or greater than this value will perform the  \"bunnyhop\" technique"
-set bot_ai_bunnyhop_startdistance 250 "Run to goals located further than this distance"
-set bot_ai_bunnyhop_stopdistance 220 "Stop jumping after reaching this distance to the goal"
-set bot_ai_bunnyhop_firstjumpdelay 0.5 "Start running to the goal only if it was seen for more than N seconds"
+set bot_ai_bunnyhop_startdistance 100 "Run to goals located further than this distance"
+set bot_ai_bunnyhop_stopdistance 125 "Stop jumping after reaching this distance to the goal"
+set bot_ai_bunnyhop_firstjumpdelay 0.2 "Start running to the goal only if it was seen for more than N seconds"
 set bot_god 0 "god mode for bots"
 set bot_ai_navigation_jetpack 0 "Enable bots to navigat maps using the jetpack"
 set bot_ai_navigation_jetpack_mindistance 3500 "Bots will try fly to objects located farther than this distance"
@@ -461,6 +461,7 @@ locs_enable 0
 pausable 0
 seta g_spawnshieldtime 1.000000 "number of seconds you are invincible after you spawned, this shield is lost after you fire"
 seta g_antilag 2       "AntiLag (0 = no AntiLag, 1 = verified client side hit scan, 2 = server side hit scan in the past, 3 = unverified client side hit scan)"
+set g_trueaim_minrange 44 "TrueAim minimum range (TrueAim adjusts shots so they hit the crosshair point even though the gun is not at the screen center)"
 set g_antilag_nudge 0 "don't touch"
 set g_antilag_bullets 1 "Bullets AntiLag (0 = no AntiLag, 1 = server side hit scan in the past) - DO NOT TOUCH (severely changes weapon balance)"
 set g_shootfromclient 1 "let client decide if it has the gun left or right; if set to 2, center handedness is allowed, and defaulted to, too; see also cl_gunalign"
@@ -565,7 +566,8 @@ set g_freezetag 0 "Freeze Tag: Freeze the opposing team(s) to win, unfreeze team
 seta g_freezetag_warmup 5 "Time players get to run around before the round starts"
 seta g_freezetag_point_limit -1        "Freeze Tag point limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
 seta g_freezetag_point_leadlimit -1    "Freeze Tag point lead limit overriding the mapinfo specified one (use 0 to play without limit, and -1 to use the mapinfo's limit)"
-seta g_freezetag_revive_time 2.5 "Time it takes to revive a frozen teammate"
+seta g_freezetag_revive_speed 0.4 "Speed for reviving a frozen teammate"
+seta g_freezetag_revive_clearspeed 1.6 "Speed at which reviving progress gets lost when out of range"
 seta g_freezetag_revive_extra_size 100 "Distance in qu that you can stand from a frozen teammate to keep reviving him"
 seta g_freezetag_frozen_force 0.6 "How much to multiply the force on a frozen player with"
 
@@ -638,10 +640,13 @@ seta timelimit_suddendeath 5 "number of minutes suddendeath mode lasts after all
 set g_tdm 0 "Team Deathmatch: the team who kills their opponents most often wins"
 
 seta teamplay_mode 4 "default teamplay setting in team games. 1 = no friendly fire, self damage. 2 = friendly fire and self damage enabled. 3 = no friendly fire, but self damage enabled. 4 = obey the following four cvars"
-seta g_mirrordamage 0.300000   "for teamplay 4: mirror damage factor"
-seta g_friendlyfire 0.100000   "for teamplay 4: fiendly fire factor"
-seta g_teamdamage_threshold 50 "for teamplay 4: threshold over which to apply mirror damage"
-seta g_teamdamage_resetspeed 30        "for teamplay 4: how fast player's teamdamage count decreases"
+seta g_mirrordamage 0.700000   "for teamplay 4: mirror damage factor"
+seta g_mirrordamage_virtual 1  "for teamplay 4: do not actually apply mirror damage, just show graphics effect for it"
+seta g_friendlyfire 0.500000   "for teamplay 4: fiendly fire factor"
+seta g_friendlyfire_virtual 1  "for teamplay 4: do not actually apply friendly fire, just show graphics effect for it"
+seta g_friendlyfire_virtual_force 1    "for teamplay 4: apply force even though damage was made virtual only"
+seta g_teamdamage_threshold 40 "for teamplay 4: threshold over which to apply mirror damage"
+seta g_teamdamage_resetspeed 20        "for teamplay 4: how fast player's teamdamage count decreases"
 
 set deathmatch_force_teamplay 0        "Always play TDM instead of DM"
 seta g_balance_teams 0 "automatically balance out players entering instead of asking them for their preferred team"
@@ -1271,23 +1276,25 @@ set g_keyhunt_teams 0
 
 // keepaway
 set g_keepaway 0 "game mode which focuses around a ball, look at g_keepaway_win_mode for further details"
-set g_keepaway_bckillscore 1 "enable scoring points (y/n) for ball carrier kills"
-set g_keepaway_pointlimit      -1      "total amount of points you can get, -1 for unlimited"
-set g_keepaway_pointleadlimit  -1      "mercy rule, -1 for unlimited"
-set g_keepaway_ballcarrier_alpha 0.6 "alpha when the player is the ballcarrier"
-set g_keepaway_ballcarrier_highspeed 1.5 "speed multiplier done to the person holding the ball"
-set g_keepaway_ballcarrier_damage      1.5     "damage multiplier while having powerup"
-set g_keepaway_ballcarrier_force       1.5     "force multiplier while having powerup"
-set g_keepaway_ballcarrier_selfdamage  1       "self damage multiplier while having powerup"
-set g_keepaway_ballcarrier_selfforce   1.5     "self force multiplier while having powerup"
-set g_keepaway_noncarrier_warn 0       "warn players when they kill without holding the ball"
-set g_keepaway_noncarrier_damage       0.5     "damage done to other players if both you and they don't have the ball"
-set g_keepaway_noncarrier_force        0.5     "force done to other players if both you and they don't have the ball"
+set g_keepaway_score_bckill 1 "enable scoring points (y/n) for ball carrier kills (value is how many points to award)"
+set g_keepaway_score_killac 1 "amount of points to give when you kill someone while you have the ball"
+set g_keepaway_score_timeinterval 1 "amount of time it takes between intervals for timepoints to be added to the score"
+set g_keepaway_score_timepoints 0 "points to add to score per timeinterval, 0 for no points"
+set g_keepaway_ballcarrier_effects 8 "Add together the numbers you want: EF_ADDITIVE (32) / EF_NODEPTHTEST (8192) / EF_DIMLIGHT (8)"
+set g_keepaway_ballcarrier_highspeed 1 "speed multiplier done to the person holding the ball (recommended when used with some mutators)"
+set g_keepaway_ballcarrier_damage      1       "damage multiplier while holding the ball"
+set g_keepaway_ballcarrier_force       1       "force multiplier while holding the ball"
+set g_keepaway_ballcarrier_selfdamage  1       "self damage multiplier while holding the ball"
+set g_keepaway_ballcarrier_selfforce   1       "self force multiplier while holding the ball"
+set g_keepaway_noncarrier_warn 1       "warn players when they kill without holding the ball"
+set g_keepaway_noncarrier_damage       1       "damage done to other players if both you and they don't have the ball"
+set g_keepaway_noncarrier_force        1       "force done to other players if both you and they don't have the ball"
 set g_keepaway_noncarrier_selfdamage   1       "self damage if you don't have the ball"
 set g_keepaway_noncarrier_selfforce    1       "self force if you don't have the ball"
+set g_keepawayball_effects 0 "Add together the numbers you want: EF_ADDITIVE (32) / EF_NODEPTHTEST (8192) / EF_DIMLIGHT (8)"
 set g_keepawayball_trail_color 254     "particle trail color from player/ball"
-set g_keepawayball_damageforcescale    2 "Scale of force which is applied to the ball by weapons/explosions/etc"
-set g_keepawayball_respawntime 15      "if no one picks up the ball, how long to wait until the ball respawns"
+set g_keepawayball_damageforcescale    3 "Scale of force which is applied to the ball by weapons/explosions/etc"
+set g_keepawayball_respawntime 10      "if no one picks up the ball, how long to wait until the ball respawns"
 seta g_keepaway_teams_override 0
 set g_keepaway_teams 0
 
@@ -1358,6 +1365,7 @@ seta slowmo 1
 seta menu_skin "luminos"
 set menu_slowmo 1
 seta menu_sounds 0 "enables menu sound effects. 1 enables click sounds, 2 also enables hover sounds"
+set menu_picmip_bypass 0 "bypass texture quality enforcement based on system resources, not recommended and may cause crashes!"
 
 r_textbrightness 0.2
 r_textcontrast 0.8
@@ -1420,13 +1428,13 @@ seta hud_showbinds_limit 2      "maximum number of bound keys to show for a command.
 
 seta hud_colorflash_alpha 0.5 "starting alpha of the color flash"
 
-seta hud_damage 1 "an improved version of gl_polyblend, draw an image instead when hurt"
-seta hud_damage_gentle_alpha_multiplier 0.25 "how much to multiply alpha of flash when using the cl_gentle version, it's much more opaque than the non-gentle version"
+seta hud_damage 0.55 "an improved version of gl_polyblend, draw an image instead when hurt"
+seta hud_damage_gentle_alpha_multiplier 0.10 "how much to multiply alpha of flash when using the cl_gentle version, it's much more opaque than the non-gentle version"
 seta hud_damage_gentle_color "1 0.7 1" "color of flash for cl_gentle version"
 seta hud_damage_color "1 0 0" "color of flash"
 seta hud_damage_factor 0.025 "(damage * factor) = how much to add to the alpha value"
-seta hud_damage_fade_rate 1 "how much to subtract from the alpha value each second"
-seta hud_damage_maxalpha 2 "how much to limit the alpha value to"
+seta hud_damage_fade_rate 0.75 "how much to subtract from the alpha value each second"
+seta hud_damage_maxalpha 1.5 "how much to limit the alpha value to"
 seta hud_damage_pain_threshold 0.1 "how much alpha to ignore (must be bigger than the hud_damage_factor so that e.g. rot is ignored)"
 seta hud_damage_pain_threshold_lower 1.25 "how much we lower pain_threshold with when nearing 0 health (if pain_threshold gets negative then we always draw a flash at alpha = fabs(pain_threshold)"
 seta hud_damage_pain_threshold_lower_health 50 "at which health we start lowering pain_threshold"
@@ -1589,9 +1597,6 @@ set capturelimit 0
 seta hud_fontsize 11
 seta scr_centersize 12
 seta hud_width 560
-// alias hud_font "loadfont user1 ${1},gfx/fallback ${2-}; loadfont user2 ${1}-big ${2-}; scoreboard_columns_set"
-alias sbar_font "set _requested_sbar_font \"${*}\""
-sbar_font gfx/vera-sans 8 12 16 24 32
 
 // these entities are not referenced by anything directly, they just represent
 // teams and are found by find() when needed
@@ -1603,12 +1608,12 @@ set g_jump_grunt 0      "Do you make a grunting noise every time you jump? Is it the
 
 alias allready "sv_cmd allready"
 
-seta cl_weaponpriority "minstanex rocketlauncher nex minelayer grenadelauncher fireball hlac hagar seeker crylink campingrifle uzi electro tuba shotgun laser hook porto" "weapon priority list"
+seta cl_weaponpriority "minstanex rocketlauncher nex minelayer grenadelauncher fireball hlac hagar seeker crylink sniperrifle uzi electro tuba shotgun laser hook porto" "weapon priority list"
 seta cl_weaponpriority_useforcycling 0 "when set, weapon cycling by the mouse wheel makes use of the weapon priority list (the special value 2 uses the weapon ID list for cycling)"
 seta cl_weaponpriority0 "rocketlauncher grenadelauncher hagar seeker fireball" "use impulse 200 for prev gun from this list, 210 for best gun, 220 for next gun.  Default value: explosives"
 seta cl_weaponpriority1 "minstanex nex crylink hlac electro laser"             "use impulse 201 for prev gun from this list, 211 for best gun, 221 for next gun.  Default value: energy"
-seta cl_weaponpriority2 "minstanex nex campingrifle"                           "use impulse 202 for prev gun from this list, 212 for best gun, 222 for next gun.  Default value: hitscan exact"
-seta cl_weaponpriority3 "minstanex nex campingrifle uzi shotgun"               "use impulse 203 for prev gun from this list, 213 for best gun, 223 for next gun.  Default value: hitscan all"
+seta cl_weaponpriority2 "minstanex nex sniperrifle"                           "use impulse 202 for prev gun from this list, 212 for best gun, 222 for next gun.  Default value: hitscan exact"
+seta cl_weaponpriority3 "minstanex nex sniperrifle uzi shotgun"               "use impulse 203 for prev gun from this list, 213 for best gun, 223 for next gun.  Default value: hitscan all"
 seta cl_weaponpriority4 "minelayer grenadelauncher hlac hagar crylink seeker shotgun"    "use impulse 204 for prev gun from this list, 214 for best gun, 224 for next gun.  Default value: spam weapons"
 seta cl_weaponpriority5 "laser hook porto"                                     "use impulse 205 for prev gun from this list, 215 for best gun, 225 for next gun.  Default value: weapons for moving"
 seta cl_weaponpriority6 "" "use impulse 206 for prev gun from this list, 216 for best gun, 226 for next gun"
@@ -1815,6 +1820,7 @@ alias cl_hook_gamestart_rc
 alias cl_hook_gamestart_nexball
 alias cl_hook_gamestart_cts
 alias cl_hook_gamestart_ka
+alias cl_hook_gamestart_freezetag
 alias cl_hook_gameend
 alias cl_hook_activeweapon
 
@@ -1836,6 +1842,7 @@ alias sv_hook_gamestart_rc
 alias sv_hook_gamestart_nexball
 alias sv_hook_gamestart_cts
 alias sv_hook_gamestart_ka
+alias sv_hook_gamestart_freezetag
 alias sv_hook_gamerestart
 alias sv_hook_gameend
 
@@ -1958,7 +1965,7 @@ set g_weaponreplace_porto ""
 set g_weaponreplace_minstanex ""
 set g_weaponreplace_hook ""
 set g_weaponreplace_hlac ""
-set g_weaponreplace_campingrifle ""
+set g_weaponreplace_sniperrifle ""
 set g_weaponreplace_tuba ""
 set g_weaponreplace_fireball ""
 set g_weaponreplace_seeker ""
@@ -1983,12 +1990,15 @@ scr_conscroll_y -0.3
 
 scr_loadingscreen_background 0
 scr_loadingscreen_barcolor "0 0.5 1"
-scr_loadingscreen_barheight 20
+scr_loadingscreen_barheight 12
 scr_loadingscreen_count 1
 scr_conforcewhiledisconnected 0
+scr_infobar_height 12
 
 // DP cannot properly detect this, so rather turn off the detection
 r_texture_dds_load_dxt1_noalpha 1
+r_texture_dds_load_swdecode 1 // SW decode to quarter res if we want to load DDS but don't support the extension for it
+r_texture_dds_load_logfailure 0 // this engine feature SUCKS
 
 // particles optimization
 r_drawparticles_nearclip_min 8
@@ -2020,7 +2030,7 @@ utf8_enable 1
 // safe font defaults
 r_font_hinting 1
 r_font_disable_freetype 0
-r_font_size_snapping 2
+r_font_size_snapping 4
 
 // database management
 set sv_db_saveasdump 0 "write server.db in dump format (loads slower, easier to read/parse)"
@@ -2061,6 +2071,7 @@ set g_weapon_charge_colormod_blue_full -1
 
 // player statistics server URI
 set g_playerstats_uri ""
+set g_playerstats_debug 0 "when 1, player stats are dumped to the console too"
 
 // create this cvar in case the engine did not
 set snd_soundradius 1200
@@ -2076,7 +2087,7 @@ exec ctfscoring-ai.cfg
 exec effects-normal.cfg
 exec physicsX0.cfg
 exec turrets.cfg
-exec font-nimbussansl.cfg
+exec font-xolonium.cfg
 
 // hud cvar descriptions
 exec _hud_descriptions.cfg
diff --git a/fixbalance.sh b/fixbalance.sh
new file mode 100755 (executable)
index 0000000..cfc6cc0
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+main=balanceXonotic.cfg
+for X in balance*.cfg; do
+       case "$X" in
+               "$main")
+                       ;;
+               *)
+                       perl ../../misc/tools/cfgapply.pl "$main" "$X" > "$X.new" && mv "$X.new" "$X"
+                       ;;
+       esac
+done
+git diff
diff --git a/gfx/hud/default/weaponcampingrifle.tga b/gfx/hud/default/weaponcampingrifle.tga
deleted file mode 100644 (file)
index f5c2e55..0000000
Binary files a/gfx/hud/default/weaponcampingrifle.tga and /dev/null differ
diff --git a/gfx/hud/default/weaponsniperrifle.tga b/gfx/hud/default/weaponsniperrifle.tga
new file mode 100644 (file)
index 0000000..f5c2e55
Binary files /dev/null and b/gfx/hud/default/weaponsniperrifle.tga differ
diff --git a/gfx/hud/luminos/weaponcampingrifle.tga b/gfx/hud/luminos/weaponcampingrifle.tga
deleted file mode 100644 (file)
index f5c2e55..0000000
Binary files a/gfx/hud/luminos/weaponcampingrifle.tga and /dev/null differ
diff --git a/gfx/hud/luminos/weaponsniperrifle.tga b/gfx/hud/luminos/weaponsniperrifle.tga
new file mode 100644 (file)
index 0000000..f5c2e55
Binary files /dev/null and b/gfx/hud/luminos/weaponsniperrifle.tga differ
diff --git a/gfx/hud/old/weaponcampingrifle.tga b/gfx/hud/old/weaponcampingrifle.tga
deleted file mode 100644 (file)
index 09da559..0000000
Binary files a/gfx/hud/old/weaponcampingrifle.tga and /dev/null differ
diff --git a/gfx/hud/old/weaponsniperrifle.tga b/gfx/hud/old/weaponsniperrifle.tga
new file mode 100644 (file)
index 0000000..09da559
Binary files /dev/null and b/gfx/hud/old/weaponsniperrifle.tga differ
index e556db70e974071a47a2c3916e6352a631ad5e7c..42d8379c5514dd9c7ee9fa579571936f3200267a 100644 (file)
@@ -13,7 +13,7 @@ seta cl_swapattacks_tuba 0
 seta cl_swapattacks_laser 0
 seta cl_swapattacks_shotgun 0
 seta cl_swapattacks_uzi 0
-seta cl_swapattacks_campingrifle 0
+seta cl_swapattacks_sniperrifle 0
 seta cl_swapattacks_grenadelauncher 0
 seta cl_swapattacks_electro 0
 seta cl_swapattacks_hlac 0
index 2d780381eedced49f15c67549f6455c535ae3a67..3d15295942e21b6cefc40c52386f5f7ea3e8d6f0 100644 (file)
@@ -156,7 +156,7 @@ float               scoreboard_showaccuracy;
 // float               coop;
 // float               deathmatch;
 
-// float               dmg_take;
+float          dmg_take;
 // float               dmg_save;
 // vector              dmg_origin;
 
@@ -258,7 +258,7 @@ float w_deathtype, w_issilent, w_random;
 string w_deathtypestring;
 vector w_org, w_backoff;
 
-float campingrifle_scope;
+float sniperrifle_scope;
 float nex_scope;
 
 float cr_maxbullets;
index 435dedabc770dbed309f663ad5945d99322b9b5e..044569fb5c373b49011389d5daf6adf141791f40 100644 (file)
@@ -65,14 +65,13 @@ void CSQC_Init(void)
 #endif
 
        float i;
-       CSQC_CheckEngine();
 
        binddb = db_create();
        tempdb = db_create();
        ClientProgsDB = db_load("client.db");
        compressShortVector_init();
 
-       drawfont = 0;
+       drawfont = FONT_USER+1;
        menu_visible = FALSE;
        menu_show = menu_show_error;
        menu_action = menu_sub_null;
@@ -1094,10 +1093,14 @@ void Ent_Init()
        g_balance_electro_secondary_bouncestop = ReadCoord();
 
        nex_scope = !ReadByte();
-       campingrifle_scope = !ReadByte();
+       sniperrifle_scope = !ReadByte();
 
        serverflags = ReadByte();
 
+       cr_maxbullets = ReadByte();
+
+       g_trueaim_minrange = ReadCoord();
+
        if(!postinit)
                PostInit();
 }
@@ -1396,10 +1399,6 @@ float CSQC_Parse_TempEntity()
                        Net_WeaponComplain();
                        bHandled = true;
                        break;
-               case TE_CSQC_CR_MAXBULLETS:
-                       cr_maxbullets = ReadByte();
-                       bHandled = true;
-                       break;
                default:
                        // No special logic for this temporary entity; return 0 so the engine can handle it
                        bHandled = false;
index 908e6dbf17fbc63b9cff14daa7e4d7f49d0866da..1cb624de6b9b94c3e0ce39772adbdddf4d9aeb89 100644 (file)
@@ -137,7 +137,7 @@ vector GetCurrentFov(float fov)
                        zoomspeed = 3.5;
 
        zoomdir = button_zoom;
-       if((getstati(STAT_ACTIVEWEAPON) == WEP_NEX && nex_scope) || (getstati(STAT_ACTIVEWEAPON) == WEP_CAMPINGRIFLE && campingrifle_scope)) // do NOT use switchweapon here
+       if((getstati(STAT_ACTIVEWEAPON) == WEP_NEX && nex_scope) || (getstati(STAT_ACTIVEWEAPON) == WEP_SNIPERRIFLE && sniperrifle_scope)) // do NOT use switchweapon here
                zoomdir += button_attack2;
        if(spectatee_status > 0 || isdemo())
        {
@@ -274,7 +274,7 @@ float TrueAimCheck()
                case WEP_MINSTANEX:
                        mv = MOVE_NORMAL;
                        break;
-               case WEP_CAMPINGRIFLE:
+               case WEP_SNIPERRIFLE:
                        ta = trueaim_rifle;
                        mv = MOVE_NORMAL;
                        if(zoomscript_caught)
@@ -306,6 +306,9 @@ float TrueAimCheck()
        traceline(view_origin, view_origin + view_forward * MAX_SHOT_DISTANCE, mv, ta);
        trueaimpoint = trace_endpos;
 
+       if(vlen(trueaimpoint - view_origin) < g_trueaim_minrange)
+               trueaimpoint = view_origin + view_forward * g_trueaim_minrange;
+
        if(vecs_x > 0)
                vecs_y = -vecs_y;
        else
@@ -572,7 +575,7 @@ void CSQC_UpdateView(float w, float h)
        // next R_RenderScene call
        drawstring('0 0 0', "", '1 1 0', '1 1 1', 0, 0);
 
-       if(autocvar_r_fakelight >= 2 || autocvar_r_fullbright >= 1)
+       if(autocvar_r_fakelight >= 2 || autocvar_r_fullbright)
        if not(serverflags & SERVERFLAG_ALLOW_FULLBRIGHT)
        {
                // apply night vision effect
@@ -628,11 +631,11 @@ void CSQC_UpdateView(float w, float h)
        // the view to go back to normal, so reticle_type would become 0 as we fade out)
        if(spectatee_status || getstati(STAT_HEALTH) <= 0)
                reticle_type = 0; // prevent reticle from showing during the respawn zoom effect or for spectators
-       else if(activeweapon == WEP_NEX && (button_zoom || zoomscript_caught) || activeweapon == WEP_CAMPINGRIFLE && (button_zoom || zoomscript_caught) || activeweapon == WEP_MINSTANEX && (button_zoom || zoomscript_caught))
+       else if(activeweapon == WEP_NEX && (button_zoom || zoomscript_caught) || activeweapon == WEP_SNIPERRIFLE && (button_zoom || zoomscript_caught) || activeweapon == WEP_MINSTANEX && (button_zoom || zoomscript_caught))
                reticle_type = 2; // nex zoom
        else if(button_zoom || zoomscript_caught)
                reticle_type = 1; // normal zoom
-       else if(activeweapon == WEP_NEX && button_attack2 || activeweapon == WEP_CAMPINGRIFLE && button_attack2)
+       else if(activeweapon == WEP_NEX && button_attack2 || activeweapon == WEP_SNIPERRIFLE && button_attack2)
                reticle_type = 2; // nex zoom
 
        if(autocvar_cl_reticle_stretch)
@@ -676,7 +679,7 @@ void CSQC_UpdateView(float w, float h)
                // fade out
                myhealth_flash = max(0, myhealth_flash - autocvar_hud_damage_fade_rate * frametime);
                // add new damage
-               myhealth_flash = bound(0, myhealth_flash + max(0, myhealth_prev - myhealth) * autocvar_hud_damage_factor, autocvar_hud_damage_maxalpha);
+               myhealth_flash = bound(0, myhealth_flash + dmg_take * autocvar_hud_damage_factor, autocvar_hud_damage_maxalpha);
 
                float pain_threshold, pain_threshold_lower, pain_threshold_lower_health;
                pain_threshold = autocvar_hud_damage_pain_threshold;
@@ -941,12 +944,12 @@ void CSQC_UpdateView(float w, float h)
                                nex_charge_movingavg = nex_charge;
 
                        // ring around crosshair representing bullets left in camping rifle clip
-                       if (activeweapon == WEP_CAMPINGRIFLE && cr_maxbullets)
+                       if (activeweapon == WEP_SNIPERRIFLE && cr_maxbullets)
                        {
                                bullets = getstati(STAT_BULLETS_LOADED);
                                f = bound(0, bullets / cr_maxbullets, 1);
 
-                               a = autocvar_crosshair_ring_campingrifle_alpha;
+                               a = autocvar_crosshair_ring_sniperrifle_alpha;
                                DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", f, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
                        }
                        else if (activeweapon == WEP_NEX && nex_charge) // ring around crosshair representing velocity-dependent damage for the nex
index f3d18aa9ffc41df7e5d7a2c873c0b9b5b937ca7c..08ad7b9022d33fd90ce7b987254b1d5d7c01ad74 100644 (file)
@@ -105,7 +105,7 @@ float autocvar_crosshair_hittest_showimpact;
 float autocvar_crosshair_per_weapon;
 float autocvar_crosshair_pickup;
 float autocvar_crosshair_pickup_speed;
-float autocvar_crosshair_ring_campingrifle_alpha;
+float autocvar_crosshair_ring_sniperrifle_alpha;
 float autocvar_crosshair_ring_nex_currentcharge_movingavg_rate;
 float autocvar_crosshair_ring_nex_currentcharge_scale;
 float autocvar_crosshair_ring_nex_inner_alpha;
index 2f3ec3b1744eaa7867499279891bf6acbed56904..694302a4d39aa4796aea24c92b04306c022d5a34 100644 (file)
@@ -297,7 +297,6 @@ void HUD_DrawCenterPrint (void)
        {
                ts = centerprint_messages[i];
                drawfontscale = sz * '1 1 0';
-               drawfont = hud_bigfont;
                pos_x = (vid_conwidth - stringwidth(ts, TRUE, centerprint_fontsize)) * 0.5;
                if (ts != "")
                {
@@ -308,7 +307,6 @@ void HUD_DrawCenterPrint (void)
                        // half height for empty lines looks better
                        pos_y = pos_y + sz * centerprint_fontsize_y * 0.5;
                drawfontscale = '1 1 0';
-               drawfont = hud_font;
        }
 }
 
@@ -1508,7 +1506,7 @@ float GetAmmoTypeForWep(float i)
                case WEP_HLAC: return 3;
                case WEP_MINSTANEX: return 3;
                case WEP_NEX: return 3;
-               case WEP_CAMPINGRIFLE: return 1;
+               case WEP_SNIPERRIFLE: return 1;
                case WEP_HAGAR: return 2;
                case WEP_ROCKET_LAUNCHER: return 2;
                case WEP_SEEKER: return 2;
@@ -1984,7 +1982,6 @@ void HUD_Ammo(void)
                ammo_size_y = newSize;
        }
 
-       drawfont = hud_bigfont;
        float i, stat_items, currently_selected;
        if (autocvar_hud_panel_ammo_onlycurrent)
        {
@@ -2016,7 +2013,6 @@ void HUD_Ammo(void)
                        column = column + 1;
                }
        }
-       drawfont = hud_font;
 }
 
 void DrawNumIcon(float iconalign, vector myPos, vector mySize, float x, string icon, float left, vector color, float alpha)
@@ -2068,9 +2064,7 @@ void DrawNumIcon(float iconalign, vector myPos, vector mySize, float x, string i
                }
        }
 
-       drawfont = hud_bigfont;
        drawstring_aspect(numpos, ftos(x), eX * (2/3) * newSize_x + eY * newSize_y, color, panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
-       drawfont = hud_font;
        drawpic_aspect_skin(picpos, icon, '1 1 0' * newSize_y, '1 1 1', panel_fg_alpha * alpha, DRAWFLAG_NORMAL);
 }
 
@@ -2153,7 +2147,6 @@ void HUD_Powerups(void) {
                rightexact = strength_time;
        }
 
-       drawfont = hud_bigfont;
        float baralign = autocvar_hud_panel_powerups_baralign;
     float barflip;
        float iconalign = autocvar_hud_panel_powerups_iconalign;
@@ -2325,7 +2318,6 @@ void HUD_Powerups(void) {
             }
                }
        }
-       drawfont = hud_font;
 }
 
 // Health/armor (#3)
@@ -2367,7 +2359,6 @@ void HUD_HealthArmor(void)
        vector picpos;
        vector numpos;
 
-       drawfont = hud_bigfont;
        float baralign = autocvar_hud_panel_healtharmor_baralign;
        float iconalign = autocvar_hud_panel_healtharmor_iconalign;
        float progressbar = autocvar_hud_panel_healtharmor_progressbar;
@@ -2630,7 +2621,6 @@ void HUD_HealthArmor(void)
                        }
                }
        }
-       drawfont = hud_font;
 }
 
 // Notification area (#4)
@@ -2728,7 +2718,7 @@ void HUD_KillNotify(string s1, string s2, string s3, float type, float msg) // s
        } else if(msg == MSG_KILL) {
                w = DEATH_WEAPONOF(type);
                if(WEP_VALID(w)) {
-                       if((w == WEP_CAMPINGRIFLE || w == WEP_MINSTANEX) && type & HITTYPE_HEADSHOT) // all headshot weapons go here
+                       if((w == WEP_SNIPERRIFLE || w == WEP_MINSTANEX) && type & HITTYPE_HEADSHOT) // all headshot weapons go here
                                HUD_KillNotify_Push(s1, s2, 1, DEATH_HEADSHOT);
                        else
                                HUD_KillNotify_Push(s1, s2, 1, type);
@@ -3490,9 +3480,7 @@ void HUD_Timer(void)
                timer = seconds_tostring(timeleft);
        }
 
-       drawfont = hud_bigfont;
        drawstring_aspect(pos, timer, mySize, timer_color, panel_fg_alpha, DRAWFLAG_NORMAL);
-       drawfont = hud_font;
 }
 
 // Radar (#6)
@@ -3681,9 +3669,7 @@ void HUD_Score(void)
                // race record display
                if (distribution <= 0)
                        HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawfont = hud_bigfont;
                drawstring_aspect(pos, timer, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawfont = hud_font;
        } else if (!teamplay) { // non-teamgames
                // me vector := [team/connected frags id]
                pl = players.sort_next;
@@ -3715,9 +3701,7 @@ void HUD_Score(void)
                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)
                        HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawfont = hud_bigfont;
                drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL);
-               drawfont = hud_font;
        } else { // teamgames
                float max_fragcount;
                max_fragcount = -99;
@@ -3739,9 +3723,7 @@ void HUD_Score(void)
                                        leader = 1;
                                if (leader)
                                        HUD_Panel_DrawHighlight(pos, eX * 0.75 * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
-                               drawfont = hud_bigfont;
                                drawstring_aspect(pos, ftos(score), eX * 0.75 * mySize_x + eY * mySize_y, GetTeamRGB(tm.team) * 0.8, panel_fg_alpha, DRAWFLAG_NORMAL);
-                               drawfont = hud_font;
                        } else {
                                if (max_fragcount == score)
                                        leader = 1;
@@ -3791,7 +3773,6 @@ void HUD_RaceTimer (void) {
        }
        mySize = newSize;
 
-       drawfont = hud_bigfont;
        float a, t;
        string s, forcetime;
 
@@ -3891,8 +3872,6 @@ void HUD_RaceTimer (void) {
                        }
                }
        }
-
-       drawfont = hud_font;
 }
 
 // Vote window (#9)
@@ -4056,7 +4035,6 @@ void HUD_Mod_CA(vector pos, vector mySize)
        redalive = getstati(STAT_REDALIVE);
        bluealive = getstati(STAT_BLUEALIVE);
 
-       drawfont = hud_bigfont;
        vector redpos, bluepos;
        if(mySize_x > mySize_y)
        {
@@ -4076,7 +4054,6 @@ void HUD_Mod_CA(vector pos, vector mySize)
                drawpic_aspect_skin(bluepos, "player_blue.tga", eX * mySize_x + eY * 0.3 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
                drawstring_aspect(bluepos + eY * 0.3 * mySize_y, ftos(bluealive), eX * mySize_x + eY * 0.2 * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
        }
-       drawfont = hud_font;
 }
 
 // CTF HUD modicon section
@@ -4400,13 +4377,21 @@ void HUD_Mod_Keepaway(vector pos, vector mySize)
                kaball_prevstatus = kaball;
        }
        
-       // todo: Fix the sizing with the expanding image
+       vector kaball_pos, kaball_size;
+       
+       if(mySize_x > mySize_y) {
+               kaball_pos = pos + eX * 0.25 * mySize_x;
+               kaball_size = eX * 0.5 * mySize_x + eY * mySize_y;
+       } else {
+               kaball_pos = pos + eY * 0.25 * mySize_y;
+               kaball_size = eY * 0.5 * mySize_y + eX * mySize_x;
+       }
        
        float kaball_statuschange_elapsedtime = time - kaball_statuschange_time;
        float f = bound(0, kaball_statuschange_elapsedtime*2, 1);
        
        if(kaball_prevstatus && f < 1)
-               drawpic_aspect_skin_expanding(pos + eY * 0.25 * mySize_y, "keepawayball_carrying", eX * mySize_x + eY * mySize_y * 0.5, '1 1 1', panel_fg_alpha * kaball_alpha, DRAWFLAG_NORMAL, f);
+               drawpic_aspect_skin_expanding(kaball_pos, "keepawayball_carrying", kaball_size, '1 1 1', panel_fg_alpha * kaball_alpha, DRAWFLAG_NORMAL, f);
        
        if(kaball)
                drawpic_aspect_skin(pos, "keepawayball_carrying", eX * mySize_x + eY * mySize_y, '1 1 1', panel_fg_alpha * kaball_alpha * f, DRAWFLAG_NORMAL);
@@ -4474,8 +4459,6 @@ void HUD_Mod_Race(vector pos, vector mySize)
        if not((scores_flags[ps_primary] & SFL_TIME) && !teamplay) // race/cts record display on HUD
                return; // no records in the actual race
 
-       drawfont = hud_bigfont;
-
        // clientside personal record
        string rr;
        if(gametype == GAME_CTS)
@@ -4598,7 +4581,6 @@ void HUD_Mod_Race(vector pos, vector mySize)
                        strunzone(race_status_name_prev);
                race_status_name_prev = string_null;
        }
-       drawfont = hud_font;
 }
 
 float mod_prev; // previous state of mod_active to check for a change
@@ -4835,9 +4817,7 @@ void HUD_EngineInfo(void)
 
        vector color;
        color = HUD_Get_Num_Color (prevfps, 100);
-       drawfont = hud_bigfont;
        drawstring_aspect(pos, strcat("FPS: ", ftos_decimals(prevfps, autocvar_hud_panel_engineinfo_framecounter_decimals)), mySize, color, panel_fg_alpha, DRAWFLAG_NORMAL);
-       drawfont = hud_font;
 }
 
 // Info messages panel (#14)
@@ -5072,15 +5052,12 @@ void HUD_ShowSpeed(void)
        numsize_x = numsize_y = autocvar_cl_showspeed_size;
        pos = (vid_conheight - numsize_y) * autocvar_cl_showspeed_position;
 
-       drawfont = hud_bigfont;
        drawstringcenter(eX + pos * eY, speed, numsize, '1 1 1', autocvar_hud_panel_fg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL);
 
        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);
        }
-
-       drawfont = hud_font;
 }
 
 vector acc_prevspeed;
index 625a4ba7be05f5be814f088858d5a64f2233d163..364e5a999fb5768bc4043c4d9671d470b3c1b002 100644 (file)
@@ -80,9 +80,6 @@ float hud_size[MAX_HUD_FIELDS + 1];
 string hud_title[MAX_HUD_FIELDS + 1];
 float hud_num_fields;
 
-float hud_font;
-float hud_bigfont;
-
 string scores_label[MAX_SCORE];
 float scores_flags[MAX_SCORE];
 string teamscores_label[MAX_SCORE];
@@ -165,3 +162,4 @@ float g_balance_grenadelauncher_bouncefactor;
 float g_balance_grenadelauncher_bouncestop;
 float g_balance_electro_secondary_bouncefactor;
 float g_balance_electro_secondary_bouncestop;
+float g_trueaim_minrange;
index 861d1d1d9f8844d5f5dfb9a7b4c4336ddebed712..5baa268fcfffba7616ab3957b9d62fee7e5ff974 100644 (file)
@@ -62,7 +62,6 @@ void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, strin
        img_size_y = isize;
        img_size_x = isize / 0.75; // 4:3 x can be stretched easily, height is defined in isize
 
-       drawfont = hud_font;
        pos_y = pos_y + img_size_y;
        
        label = MapVote_FormatMapItem(id, map, count, tsize, hud_fontsize);
@@ -109,7 +108,6 @@ void MapVote_DrawAbstain(vector pos, float isize, float tsize, float count, floa
        
        rgb = MapVote_RGB(id, count);
 
-       drawfont = hud_font;
        pos_y = pos_y + hud_fontsize_y;
        
        label = MapVote_FormatMapItem(id, "Don't care", count, tsize, hud_fontsize);
@@ -188,7 +186,6 @@ void MapVote_Draw()
        if(i >= 0 || ymax < (vid_conheight*0.5))
                ymax = vid_conheight - ymin;
 
-       drawfont = hud_bigfont;
        hud_fontsize = HUD_GetFontsize("hud_fontsize");
 
        pos_y = ymin;
@@ -206,8 +203,6 @@ void MapVote_Draw()
        pos_y += 22;
        pos_x = xmin;
 
-       drawfont = hud_font;
-       
        // base for multi-column stuff...
        ymin = pos_y;
        if(mv_abstain)
index 57e25810f7664de12d5e8ccf62d4e4f66494a1b8..90098a79a372d0bbdf9ca9472fec624e3fc6bf1a 100644 (file)
@@ -306,12 +306,6 @@ entity GetTeam(float Team, float add)
        return tm;
 }
 
-void CSQC_CheckEngine()
-{
-       hud_font = FONT_USER+1;
-       hud_bigfont = FONT_USER+2;
-}
-
 vector HUD_GetFontsize(string cvarname)
 {
        vector v;
index 31cdc45bfa04b4bcffe5697e0bbf47d4fcc4ccec..aabc069f17a88620c618c0a4dfd3013d499d1339 100644 (file)
@@ -248,12 +248,12 @@ string HUD_DefaultColumnLayout()
 {
        return strcat( // fteqcc sucks
                "ping pl name | ",
-               "-teams,race,lms/kills -teams,lms/deaths -teams,lms,race,ka/suicides -race,dm,tdm,ka/frags ", // tdm already has this in "score"
+               "-teams,race,lms/kills +freezetag/kills -teams,lms/deaths +freezetag/deaths -teams,lms,race,ka/suicides +freezetag/suicides -race,dm,tdm,ka,freezetag/frags ", // tdm already has this in "score"
                "+ctf/caps +ctf/pickups +ctf/fckills +ctf/returns ",
                "+lms/lives +lms/rank ",
                "+kh/caps +kh/pushes +kh/destroyed ",
                "?+race/laps ?+race/time ?+race/fastest ",
-               "+as/objectives +nexball/faults +nexball/goals +ka/drops +ka/pickups +ka/bckills ",
+               "+as/objectives +nexball/faults +nexball/goals +ka/drops +ka/pickups +ka/bckills +ka/time +freezetag/revivals ",
                "-lms,race,nexball/score");
 }
 
@@ -296,7 +296,6 @@ void Cmd_HUD_SetFields(float argc)
 
        hud_num_fields = 0;
 
-       drawfont = hud_font;
        hud_fontsize = HUD_GetFontsize("hud_fontsize"); 
 
        for(i = 0; i < argc - 1; ++i)
@@ -883,10 +882,12 @@ float HUD_WouldDrawScoreboard() {
                return 1;
        else if (intermission == 1)
                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)
-        return 1;
+       else if (spectatee_status == -1)
+               return 1;
        else if (scoreboard_showscores_force)
                return 1;
        return 0;
@@ -933,7 +934,6 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
                drawfill(pos + '0 1 0' * weapon_height + '0 1 0' * height * i, '1 0 0' * sbwidth + '0 1 0' * fontsize, '1 1 1', scoreboard_highlight_alpha, DRAWFLAG_NORMAL);
        }
 
-       drawfont = hud_bigfont;
        average_accuracy = 0;
        float weapons_with_stats;
        weapons_with_stats = 0;
@@ -1002,7 +1002,6 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
                        pos_y += height;
                }
        }
-       drawfont = hud_font;
 
        if(weapons_with_stats)
                average_accuracy = floor(average_accuracy / weapons_with_stats);
@@ -1126,7 +1125,6 @@ void HUD_DrawScoreboard()
        pos_z = 0;
 
        // Heading
-       drawfont = hud_bigfont;
        drawstring(pos, "Scoreboard", '24 24 0', '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
        
        centerprint_start_x = vid_conwidth - 0.5 * (pos_x + stringwidth("Scoreboard", FALSE, '24 24 0'));
@@ -1134,8 +1132,6 @@ void HUD_DrawScoreboard()
 
        pos_y += 24;
 
-       drawfont = hud_font;
-
        // Draw the scoreboard
        vector bg_size = drawgetimagesize("gfx/scoreboard/scoreboard_bg") * autocvar_scoreboard_bg_scale;
 
index 50abe9875e0899dae8da1a549b0639511ee6aa83..90376b5b96bf9691c69ed98057e403282e7cec3c 100644 (file)
@@ -61,7 +61,6 @@ const float TE_CSQC_ANNOUNCE = 110;
 const float TE_CSQC_TARGET_MUSIC = 111;
 const float TE_CSQC_NOTIFY = 112;
 const float TE_CSQC_WEAPONCOMPLAIN = 113;
-const float TE_CSQC_CAMPINGRIFLE_SCOPE = 115;
 const float TE_CSQC_NEX_SCOPE = 116;
 const float TE_CSQC_CR_MAXBULLETS = 117;
 
index 1bfbca6ae107cf27eab18fe437035669cc140e02..dcdd74deef9523b7ce3ebd9fce53ac874f07db9b 100644 (file)
@@ -360,7 +360,10 @@ float buf_load(string pFilename)
                return -1;
        fh = fopen(pFilename, FILE_READ);
        if(fh < 0)
-               return buf;
+       {
+               buf_del(buf);
+               return -1;
+       }
        i = 0;
        while((l = fgets(fh)))
        {
index 9ebcbb8f5b170af8ce7a63e1472205c3fbf0b26b..bc7368d09599cf8e223bd0ffb9ab33a2726513b1 100644 (file)
@@ -58,7 +58,7 @@
 #include "xonotic/dialog_multiplayer_create_mutators.c"
 #include "xonotic/dialog_multiplayer_create_advanced.c"
 #include "xonotic/dialog_multiplayer_create_mapinfo.c"
-#include "xonotic/gametypebutton.c"
+#include "xonotic/gametypelist.c"
 #include "xonotic/maplist.c"
 #include "xonotic/skinlist.c"
 #include "xonotic/image.c"
index a33cac91633ea8016b622d148b6840f6a1673a86..12b56d8dae8f2632ef8bbb84c847a2fde28863dd 100644 (file)
@@ -282,14 +282,14 @@ void draw_Text(vector theOrigin, string theText, vector theSize, vector theColor
 }
 void draw_CenterText(vector theOrigin, string theText, vector theSize, vector theColor, float theAlpha, float ICanHasKallerz)
 {
-       //print(strcat("orig = ", vtos(theOrigin) ," tx = ", ftos(draw_TextWidth(theText, ICanHasKallerz, theSize)), "\n"));
+       //dprint(strcat("orig = ", vtos(theOrigin) ," tx = ", ftos(draw_TextWidth(theText, ICanHasKallerz, theSize)), "\n"));
        draw_Text(theOrigin - eX * 0.5 * draw_TextWidth(theText, ICanHasKallerz, theSize), theText, theSize, theColor, theAlpha, ICanHasKallerz);
 }
 
 float draw_TextWidth(string theText, float ICanHasKallerz, vector SizeThxBye)
 {
        //return strlen(theText);
-       //print("draw_TextWidth \"", theText, "\"\n");
+       //dprint("draw_TextWidth \"", theText, "\"\n");
        vector v;
        v = '0 0 0';
        //float r;
index 439a1b5c96b4428ac82623384dc208d73ea9bf54..761cd9dcade8d2309c3ea7d5e299750fed45a108 100644 (file)
@@ -44,7 +44,7 @@ void Curl_URI_Get_Callback(float id, float status, string data)
        do_cvar = curl_uri_get_cvar[i];
        if(status != 0)
        {
-               print("error: status is ", ftos(status), "\n");
+               print(sprintf(_("error: status is %d\n"), status));
                return;
        }
        if(do_exec)
@@ -62,9 +62,9 @@ void GameCommand(string theCommand)
 
        if(argv(0) == "help" || argc == 0)
        {
-               print("Usage: menu_cmd theCommand..., where possible theCommands are:\n");
-               print("  sync - reloads all cvars on the current menu page\n");
-               print("  directmenu ITEM - select a menu item as main item\n");
+               print(_("Usage: menu_cmd theCommand..., where possible theCommands are:\n"));
+               print(_("  sync - reloads all cvars on the current menu page\n"));
+               print(_("  directmenu ITEM - select a menu item as main item\n"));
                GameCommand_Generic("help");
                return;
        }
@@ -184,7 +184,7 @@ void GameCommand(string theCommand)
                        curl_uri_get_pos = mod(curl_uri_get_pos + 1, URI_GET_CURL_END - URI_GET_CURL + 1);
                }
                else
-                       print("error creating curl handle\n");
+                       print(_("error creating curl handle\n"));
 
                buf_del(buf);
 
@@ -230,5 +230,5 @@ void GameCommand(string theCommand)
        }
 #endif
 
-       print("Invalid theCommand. For a list of supported theCommands, try menu_cmd help.\n");
+       print(_("Invalid command. For a list of supported commands, try menu_cmd help.\n"));
 }
diff --git a/qcsrc/menu/i18n-guide.txt b/qcsrc/menu/i18n-guide.txt
new file mode 100644 (file)
index 0000000..6a2172c
--- /dev/null
@@ -0,0 +1,17 @@
+Guideline:
+- do NOT translate strings in error() messages, or in dprint()!
+- delete obviously useless developer prints while at it
+- change obvious developer prints from print to dprint (even in comments),
+  unless in developer-only functions (e.g. *dumptree*)
+- mark translatable strings with _()
+- if a translatable string is a strcat monster, change it to sprintf
+- if code loads files with text, use language_filename()
+- test by:
+  find . -type f -not -name \*.po -not -name \*.txt | xgettext -LC -k_ -f-
+- interesting vim macros:
+  :map # /"<return>
+  :map ' i_(<esc>2f"a)<esc>/"<return>
+
+Unresolved TODO:
+
+- translated campaigns
index 497d1cf661699974a640bcf86e28a22b8d840e57..52b960e456c5893fb2bebcc6c1e146169fa44c3d 100644 (file)
@@ -42,7 +42,6 @@ void Item_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOr
 {
        me.origin = absOrigin;
        me.size = absSize;
-       // me.tooltip = "The quick brown fox jumped over the lazy sleeping dog's back then sat on a tack. Franz jagt im komplett verwahrlosten Taxi quer durch Bayern.";
 }
 
 void Item_draw(entity me)
index 236b2352221259a98b0e5604b4e3e2b06180b5c9..b23078bae061a91509793dc2dd415e542993a0cd 100644 (file)
@@ -57,8 +57,6 @@ void BorderImage_configureBorderImage(entity me, string theTitle, float sz, vect
 }
 void BorderImage_draw(entity me)
 {
-       //print(vtos(me.borderVec), "\n");
-
        if(me.src)
                draw_BorderPicture('0 0 0', me.src, '1 1 0', me.color, 1, me.borderVec);
        if(me.fontSize > 0)
index 3d91229ec6669dcd6f3af7c1b56858db72708b2f..871685f53797cfa38e11603e1297a15c3eb96a62 100644 (file)
@@ -169,4 +169,4 @@ void Button_draw(entity me)
                else if(!me.focused && me.playedfocus)
                        me.playedfocus = 0;
 }
-#endif
\ No newline at end of file
+#endif
index 3d537bfb92f3bc74f735a00a3031100d335e6118..800a12681e4eb3d8b95ba4c0206baf1691cf5f3a 100644 (file)
@@ -78,7 +78,6 @@ void Dialog_fill(entity me)
 
 void Dialog_addItemSimple(entity me, float row, float col, float rowspan, float colspan, entity e, vector v)
 {
-       //print(vtos(me.itemSpacing), " ", vtos(me.itemSize), "\n");
        vector o, s;
        o = me.itemOrigin + eX * ( col          * me.itemSpacing_x) + eY * ( row          * me.itemSpacing_y);
        s = me.itemSize   + eX * ((colspan - 1) * me.itemSpacing_x) + eY * ((rowspan - 1) * me.itemSpacing_y);
@@ -156,7 +155,7 @@ void Dialog_configureDialog(entity me)
        if(me.closable)
        {
                closebutton = me.closeButton = spawnButton();
-               closebutton.configureButton(closebutton, "Close", 0, me.closeButtonImage);
+               closebutton.configureButton(closebutton, "", 0, me.closeButtonImage);
                closebutton.onClick = Dialog_Close; closebutton.onClickEntity = me;
                closebutton.srcMulti = 0;
                me.addItem(me, closebutton, '0 0 0', '1 1 0', 1); // put it as LAST
index 139e87e1a03903baa96650e607b8347cb780d93f..dd752e6e54797aaac05e1bf5542621328810b097 100644 (file)
@@ -46,7 +46,7 @@ void Gecko_draw(entity me)
                local vector fontsize;
                fontsize_x = fontsize_y = 1.0 / 30.0;
                fontsize_z = 0.0;
-               draw_Text( '0 0 0', "Browser not initialized!", fontsize, '1 1 1', 1.0, 0 );
+               draw_Text( '0 0 0', _("Browser not initialized!"), fontsize, '1 1 1', 1.0, 0 );
        }
 }
 
index 750bc83b890453eb917fcaaac3aa804a54142727..5b07afd4eef2997d11b9ec5057379fd5ec89d478 100644 (file)
@@ -272,35 +272,6 @@ void InputBox_draw(entity me)
                                                draw_Text(p, substring(me.text, i, 2), me.realFontSize, '1 1 1', theAlpha, 0);
                                        }
                                }
-                               /*else if(ch2 == "a") // ^a found
-                               {
-                                       draw_Fill(p, eX * w + eY * me.realFontSize_y, '1 1 1', 0.5);
-                                       draw_Text(p, substring(me.text, i, 2), me.realFontSize, theColor, 0.8, 0);
-                                       
-                                       component = str2chr(me.text, i+2);
-                                       if (component >= '0' && component <= '9')
-                                               component = component - '0';
-                                       else if (component >= 'a' && component <= 'f')
-                                               component = component - 87;
-                                       else if (component >= 'A' && component <= 'F')
-                                               component = component - 55;
-                                       else
-                                               component = -1;
-                                       
-                                       if (component >= 0) // ^ah found
-                                       {
-                                               // FIX ME: overflow here
-                                               if (component == 20 && theVariableAlpha <= 0.97)
-                                                       theVariableAlpha = theVariableAlpha + 0.0625;
-                                               else if (component == 30 && theVariableAlpha >= 0.03)
-                                                       theVariableAlpha = theVariableAlpha - 0.0625;
-                                               else
-                                                       theVariableAlpha = component*0.0625;
-                                               
-                                               draw_Fill(p, eX * draw_TextWidth(substring(me.text, i, 3), 0, me.realFontSize) + eY * me.realFontSize_y, '0.8 0.8 0.8', 0.5);
-                                               draw_Text(p, strcat(ch, ch2), me.realFontSize, theColor, 0.8, 0);
-                                       }
-                               }*/
                                else
                                {
                                        draw_Fill(p, eX * w + eY * me.realFontSize_y, '1 1 1', 0.5);
index 7ed6e4f68ef82daf3b33821aba270e691eba3a18..c9f6a5b629b19c42218a45a3d1e5f3291f8701ba 100644 (file)
@@ -5,6 +5,7 @@ CLASS(Label) EXTENDS(Item)
        METHOD(Label, resizeNotify, void(entity, vector, vector, vector, vector))
        METHOD(Label, setText, void(entity, string))
        METHOD(Label, toString, string(entity))
+       METHOD(Label, recalcPosition, void(entity))
        ATTRIB(Label, text, string, string_null)
        ATTRIB(Label, fontSize, float, 8)
        ATTRIB(Label, align, float, 0.5)
@@ -23,6 +24,7 @@ CLASS(Label) EXTENDS(Item)
        ATTRIB(Label, textEntity, entity, NULL)
        ATTRIB(Label, allowWrap, float, 0)
        ATTRIB(Label, recalcPos, float, 0)
+       ATTRIB(Label, condenseFactor, float, 1)
 ENDCLASS(Label)
 #endif
 
@@ -36,6 +38,32 @@ void Label_setText(entity me, string txt)
        me.text = txt;
        me.recalcPos = 1;
 }
+void Label_recalcPosition(entity me)
+{
+       float spaceAvail;
+       spaceAvail = 1 - me.keepspaceLeft - me.keepspaceRight;
+
+       float spaceUsed;
+       spaceUsed = draw_TextWidth(me.text, me.allowColors, me.realFontSize);
+
+       if(spaceUsed <= spaceAvail)
+       {
+               me.realOrigin_x = me.align * (spaceAvail - spaceUsed) + me.keepspaceLeft;
+               me.condenseFactor = 1;
+       }
+       else if(me.allowCut || me.allowWrap)
+       {
+               me.realOrigin_x = me.keepspaceLeft;
+               me.condenseFactor = 1;
+       }
+       else
+       {
+               me.realOrigin_x = me.keepspaceLeft;
+               me.condenseFactor = spaceAvail / spaceUsed;
+               dprint(sprintf(_("NOTE: label text %s too wide for label, condensed by factor %f\n"), me.text, me.condenseFactor));
+       }
+       me.recalcPos = 0;
+}
 void Label_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
 {
        SUPER(Label).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
@@ -47,8 +75,8 @@ void Label_resizeNotify(entity me, vector relOrigin, vector relSize, vector absO
        if(me.marginRight)
                me.keepspaceRight = me.marginRight * me.realFontSize_x;
        me.realOrigin_y = 0.5 * (1 - me.realFontSize_y);
-       me.realOrigin_x = me.align * (1 - me.keepspaceLeft - me.keepspaceRight - min(draw_TextWidth(me.text, me.allowColors, me.realFontSize), (1 - me.keepspaceLeft - me.keepspaceRight))) + me.keepspaceLeft;
-       me.recalcPos = 0;
+
+       me.recalcPosition(me);
 }
 void Label_configureLabel(entity me, string txt, float sz, float algn)
 {
@@ -72,17 +100,23 @@ void Label_draw(entity me)
                t = me.text;
 
        if(me.recalcPos)
-               me.realOrigin_x = me.align * (1 - me.keepspaceLeft - me.keepspaceRight - min(draw_TextWidth(t, me.allowColors, me.realFontSize), (1 - me.keepspaceLeft - me.keepspaceRight))) + me.keepspaceLeft;
-       me.recalcPos = 0;
+               me.recalcPosition(me);
 
-       //if(me.text == "Bookmark")
-       //      draw_Fill(me.realOrigin, '0 1 0' + '1 0 0' * draw_TextWidth(t, me.allowColors, me.realFontSize), '1 0 1', 1);
-       
        if(me.fontSize)
                if(t)
                {
+                       vector dfs;
+                       vector fs;
+
+                       // set up variables to draw in condensed size, but use hinting for original size
+                       fs = me.realFontSize;
+                       fs_x *= me.condenseFactor;
+
+                       dfs = draw_fontscale;
+                       draw_fontscale_x *= me.condenseFactor;
+
                        if(me.allowCut) // FIXME allowCut incompatible with align != 0
-                               draw_Text(me.realOrigin, draw_TextShortenToWidth(t, (1 - me.keepspaceLeft - me.keepspaceRight), me.allowColors, me.realFontSize), me.realFontSize, me.colorL, me.alpha, me.allowColors);
+                               draw_Text(me.realOrigin, draw_TextShortenToWidth(t, (1 - me.keepspaceLeft - me.keepspaceRight), me.allowColors, fs), fs, me.colorL, me.alpha, me.allowColors);
                        else if(me.allowWrap) // FIXME allowWrap incompatible with align != 0
                        {
                                getWrappedLine_remaining = t;
@@ -90,15 +124,17 @@ void Label_draw(entity me)
                                while(getWrappedLine_remaining)
                                {
                                        if (me.allowColors)
-                                               t = getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight), me.realFontSize, draw_TextWidth_WithColors);
+                                               t = getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight), fs, draw_TextWidth_WithColors);
                                        else
-                                               t = getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight), me.realFontSize, draw_TextWidth_WithoutColors);
-                                       draw_Text(o, t, me.realFontSize, me.colorL, me.alpha, me.allowColors);
+                                               t = getWrappedLine((1 - me.keepspaceLeft - me.keepspaceRight), fs, draw_TextWidth_WithoutColors);
+                                       draw_Text(o, t, fs, me.colorL, me.alpha, me.allowColors);
                                        o_y += me.realFontSize_y;
                                }
                        }
                        else
-                               draw_Text(me.realOrigin, t, me.realFontSize, me.colorL, me.alpha, me.allowColors);
+                               draw_Text(me.realOrigin, t, fs, me.colorL, me.alpha, me.allowColors);
+
+                       draw_fontscale = dfs;
                }
 }
 #endif
index ba3fa6a9f28ca8c3dbbb31f11b85982ba8bede03..9664e93765575014aab68a8198ee3fc22bb3ca14 100644 (file)
@@ -277,6 +277,7 @@ void ListBox_draw(entity me)
        oldshift = draw_shift;
        oldscale = draw_scale;
        absSize = boxToGlobalSize(me.size, eX * (1 - me.controlWidth) + eY * me.itemHeight);
+       draw_scale = boxToGlobalSize(eX * (1 - me.controlWidth) + eY * me.itemHeight, oldscale);
        for(i = floor(me.scrollPos / me.itemHeight); i < me.nItems; ++i)
        {
                float y;
@@ -284,7 +285,6 @@ void ListBox_draw(entity me)
                if(y >= 1)
                        break;
                draw_shift = boxToGlobal(eY * y, oldshift, oldscale);
-               draw_scale = boxToGlobalSize(eY * me.itemHeight + eX * (1 - me.controlWidth), oldscale);
                me.drawListBoxItem(me, i, absSize, (me.selectedItem == i));
        }
        draw_ClearClip();
@@ -297,6 +297,6 @@ void ListBox_clickListBoxItem(entity me, float i, vector where)
 
 void ListBox_drawListBoxItem(entity me, float i, vector absSize, float selected)
 {
-       draw_Text('0 0 0', strcat("Item ", ftos(i)), eX * (8 / absSize_x) + eY * (8 / absSize_y), (selected ? '0 1 0' : '1 1 1'), 1, 0);
+       draw_Text('0 0 0', sprintf(_("Item %d"), i), eX * (8 / absSize_x) + eY * (8 / absSize_y), (selected ? '0 1 0' : '1 1 1'), 1, 0);
 }
 #endif
index 2369a41077db5334d6ea9ac63348fe3fb47c2b56..304bf1dd241c053fa707c13a39898f4a0377fcbf 100644 (file)
@@ -149,8 +149,6 @@ void Nexposee_draw(entity me)
                me.animationState = 0;
        }
 
-       //print(ftos(me.animationState), "\n");
-
        f = min(1, frametime * 5);
        switch(me.animationState)
        {
index c8bab9bf80cda0314036564df6633b276d4da7d7..9a8a35fdcbc699d03ba12742342bb45f0e7fe0f4 100644 (file)
@@ -61,7 +61,7 @@ void Slider_setSliderValue(entity me, float val)
 }
 string Slider_toString(entity me)
 {
-       return strcat(ftos(me.value), " (", me.valueToText(me, me.value), ")");
+       return sprintf(_("%d (%s)"), me.value, me.valueToText(me, me.value));
 }
 void Slider_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
 {
index c4a7af7a890e6a5d84ae4cf727e7cde8d5c5151f..028a1603a16c35ef50e43577c587f2127e59b8d8 100644 (file)
@@ -26,9 +26,9 @@ string TextSlider_valueToIdentifier(entity me, float val)
 string TextSlider_valueToText(entity me, float val)
 {
        if(val >= me.nValues)
-               return "custom";
+               return _("custom");
        if(val < 0)
-               return "custom";
+               return _("custom");
        return me.(valueStrings[val]);
 }
 void TextSlider_setValueFromIdentifier(entity me, string id)
index 761b63a83b30dc1a97990cdc7a172e6c53e3de40..e5d366eb7049cd92ea883e24444c0dcc5c441230 100644 (file)
@@ -3,9 +3,6 @@
 //////////////////////////////////////////////////
 // AK FIXME: Create perhaps a special builtin file for the common cmds
 
-//#define PROFILESTRZONE
-//#define FIXEDFOPEN
-
 float  checkextension(string ext) = #1;
 
 // error cmds
@@ -100,11 +97,7 @@ float       bound(float min,float value, float max)  = #45;
 float  pow(float a, float b)  = #46;
 void   copyentity(entity src, entity dst)  = #47;
 
-#ifdef FIXEDFOPEN
-float  _fopen( string filename, float mode ) = #48;
-#else
 float  fopen(string filename, float mode)  = #48;
-#endif
 void   fclose(float fhandle)  = #49;
 string fgets(float fhandle)  = #50;
 void   fputs(float fhandle, string s)  = #51;
@@ -116,23 +109,8 @@ string     substring(string s, float start, float length)  = #54;
 
 vector stov(string s)  = #55;
 
-#ifdef PROFILESTRZONE
-string _strzone(string s)  = #56;
-void   _strunzone(string s) = #57;
-
-string( string s ) strzone =
-{
-       return _strzone( s );
-};
-
-void( string s ) strunzone =
-{
-       return _strunzone( s );
-};
-#else
 string strzone(string s)  = #56;
 void   strunzone(string s) = #57;
-#endif
 
 float  tokenize(string s) = #58;
 float(string s, string separator1, ...) tokenizebyseparator = #479;
@@ -343,26 +321,6 @@ string(string search, string replace, string subject) strreplace = #484;
 
 string(float uselocaltime, string format, ...) strftime = #478;
 
-#ifdef FIXEDFOPEN
-float  fopen( string filename, float mode ) =
-{
-       local float handle;
-       if( mode == FILE_READ ) {
-               return _fopen( filename, mode );
-       }
-
-       // check for data/
-       filename = strzone( filename );
-       if( substring( filename, 0, 5 ) != "data/" ) {
-               print( "menu: fopen: all output must go into data/!\n" );
-               return -1;
-       }
-       handle = _fopen( substring( filename, 5, 10000 ), mode );
-       strunzone( filename );
-       return handle;
-};
-#endif
-
 float(string s) tokenize_console = #514;
 float(float i) argv_start_index = #515;
 float(float i) argv_end_index = #516;
index 7bec34ea0b0a1ff91aad1c9ed91d051f34ca7fc9..fbdbdd2e7f7edd36b6a90f6ba243d03fc5768018 100644 (file)
@@ -25,7 +25,7 @@ void() m_init =
        check_unacceptable_compiler_bugs();
 
 #ifdef WATERMARK
-       print("^4MQC Build information: ", WATERMARK(), "\n");
+       print(sprintf(_("^4MQC Build information: %s\n"), WATERMARK()));
 #endif
 
        // list all game dirs (TEST)
@@ -38,7 +38,7 @@ void() m_init =
                        s = getgamedirinfo(i, GETGAMEDIRINFO_NAME);
                        if not(s)
                                break;
-                       print(s, ": ", getgamedirinfo(i, GETGAMEDIRINFO_DESCRIPTION));
+                       dprint(s, ": ", getgamedirinfo(i, GETGAMEDIRINFO_DESCRIPTION));
                }
        }
 }
@@ -115,18 +115,18 @@ void() m_init_delayed =
        if(cvar_string("menu_skin") != "")
        {
                draw_currentSkin = strcat("gfx/menu/", cvar_string("menu_skin"));
-               fh = fopen(strcat(draw_currentSkin, "/skinvalues.txt"), FILE_READ);
+               fh = fopen(language_filename(strcat(draw_currentSkin, "/skinvalues.txt")), FILE_READ);
        }
        if(fh < 0)
        if(cvar_defstring("menu_skin") != "")
        {
                draw_currentSkin = strcat("gfx/menu/", cvar_defstring("menu_skin"));
-               fh = fopen(strcat(draw_currentSkin, "/skinvalues.txt"), FILE_READ);
+               fh = fopen(language_filename(strcat(draw_currentSkin, "/skinvalues.txt")), FILE_READ);
        }
        if(fh < 0)
        {
                draw_currentSkin = "gfx/menu/default";
-               fh = fopen(strcat(draw_currentSkin, "/skinvalues.txt"), FILE_READ);
+               fh = fopen(language_filename(strcat(draw_currentSkin, "/skinvalues.txt")), FILE_READ);
        }
        draw_currentSkin = strzone(draw_currentSkin);
        while((s = fgets(fh)))
@@ -183,7 +183,7 @@ void(float key, float ascii) m_keyup =
                if(mouseButtonsPressed < 0)
                {
                        mouseButtonsPressed = 0;
-                       print("Warning: released an already released button\n");
+                       dprint("Warning: released an already released button\n");
                }
        }
        if(key == K_ALT) menuShiftState -= (menuShiftState & S_ALT);
@@ -221,7 +221,7 @@ void(float key, float ascii) m_keydown =
                if(mouseButtonsPressed > 10)
                {
                        mouseButtonsPressed = 10;
-                       print("Warning: pressed an already pressed button\n");
+                       dprint("Warning: pressed an already pressed button\n");
                }
        }
        if(key == K_ALT) menuShiftState |= S_ALT;
@@ -341,11 +341,6 @@ float m_testtooltipbox(vector tooltippos)
                return FALSE;
        if(tooltippos_y + menuTooltipSize_y > 1)
                return FALSE;
-       /*
-       menuTooltipOrigin_x = rint(tooltippos_x * cvar("vid_width")) / cvar("vid_width");
-       menuTooltipOrigin_y = rint(tooltippos_y * cvar("vid_height")) / cvar("vid_height");
-       menuTooltipOrigin_z = 0;
-       */
        menuTooltipOrigin = tooltippos;
        return TRUE;
 }
@@ -566,7 +561,7 @@ void() m_draw =
                if(!cvar("menu_video_played"))
                {
                        localcmd("set menu_video_played 1; cd loop $menu_cdtrack; play sound/announcer/default/welcome.ogg\n");
-                       menuLogoAlpha = -0.8; // no idea why, but when I start this at zero, it jumps instead of fading
+                       menuLogoAlpha = -0.8; // no idea why, but when I start this at zero, it jumps instead of fading FIXME
                }
        }
 
index afea3e752fd871c079df07fd8cc013995297894c..0a0de3d27768cfea9cc0783b87dd3ac609a74680 100644 (file)
@@ -6,7 +6,7 @@ print "\n";
 while(<DATA>)
 {
        chomp;
-       if(/^\s*(?:SKINFLOAT|SKINVECTOR)\(([A-Z_]+), ([-'0-9. ]+)\);$/)
+       if(/^\s*(?:SKINFLOAT|SKINVECTOR)\(([A-Z_]+), ([-'0-9. ]+)\);$/) #'
        {
                printf "%-31s %s\n", $1, $2;
        }
index 20da37d24e5d02f8204fefca6d61733dc59b3489..437c49bf72c3327f3b17b4ef70903fce63c47b4e 100644 (file)
@@ -17,7 +17,7 @@
 //#define SKINSTRING(name,def) case #name: break
 #define SKINSTRING(name,def) case #name: SKIN##name = strzone(value); break
        // I know this leaks memory when skin is read multiple times. Screw it.
-#define SKINEND case "": break; case "//": break; default: print("Invalid key in skin file: ", key, "\n"); } }
+#define SKINEND case "": break; case "//": break; default: dprint("Invalid key in skin file: ", key, "\n"); } }
 #include "skin-customizables.inc"
 #undef SKINEND
 #undef SKINSTRING
index e7667f69cfd64ceae7fd3bd7fd65b5397d5c18c6..04f7a083c2d32a035ac9bb5d15e6c2e1c127b72e 100644 (file)
@@ -281,8 +281,8 @@ void XonoticCampaignList_drawListBoxItem(entity me, float i, vector absSize, flo
        if(i <= me.campaignIndex)
                s = campaign_shortdesc[i]; // fteqcc sucks
        else
-               s = "???";
-       s = draw_TextShortenToWidth(strcat("Level ", ftos(i + 1), ": ", s), me.columnNameSize, 0, me.realFontSize);
+               s = _("???");
+       s = draw_TextShortenToWidth(sprintf(_("Level %d: %s"), i+1, s), me.columnNameSize, 0, me.realFontSize);
        draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, theColor, theAlpha, 0);
 
        if(i <= me.campaignIndex)
index 86609a659865c963c6485813867eaa53e0dd33ed..daf4d22f9c8dd95b221fdaf7c4134b628c4ccfc2 100644 (file)
@@ -30,7 +30,9 @@ void XonoticCreditsList_configureXonoticCreditsList(entity me)
 {
        me.configureXonoticListBox(me);
        // load the file
-       me.bufferIndex = buf_load("xonotic-credits.txt");
+       me.bufferIndex = buf_load(language_filename("xonotic-credits.txt"));
+       if(me.bufferIndex < 0)
+               me.bufferIndex = buf_load("xonotic-credits.txt");
        me.nItems = buf_getsize(me.bufferIndex);
 }
 void XonoticCreditsList_destroy(entity me)
index 3eaf2677e9a4316231080e552e34ad0c7bf7365b..4d36c92581b277b338afbc05982d88cac6012f96 100644 (file)
@@ -81,15 +81,15 @@ void XonoticCvarList_setSelected(entity me, float i)
        t = cvar_type(me.cvarName);
        me.cvarType = "";
        if(t & CVAR_TYPEFLAG_SAVED)
-               me.cvarType = strcat(me.cvarType, ", will be saved to config.cfg");
+               me.cvarType = strcat(me.cvarType, ", ", _("will be saved to config.cfg"));
        else
-               me.cvarType = strcat(me.cvarType, ", will not be saved");
+               me.cvarType = strcat(me.cvarType, ", ", _("will not be saved"));
        if(t & CVAR_TYPEFLAG_PRIVATE)
-               me.cvarType = strcat(me.cvarType, ", private");
+               me.cvarType = strcat(me.cvarType, ", ", _("private"));
        if(t & CVAR_TYPEFLAG_ENGINE)
-               me.cvarType = strcat(me.cvarType, ", engine setting");
+               me.cvarType = strcat(me.cvarType, ", ", _("engine setting"));
        if(t & CVAR_TYPEFLAG_READONLY)
-               me.cvarType = strcat(me.cvarType, ", read only");
+               me.cvarType = strcat(me.cvarType, ", ", _("read only"));
        me.cvarType = strzone(substring(me.cvarType, 2, strlen(me.cvarType) - 2));
 
        me.cvarNameBox.setText(me.cvarNameBox, me.cvarName);
index 7087d83cb9707987437edd588a45f71119ec8b14..f18658c7154197e1f1f7d535d0e8801d619d6631 100644 (file)
@@ -3,7 +3,7 @@ CLASS(XonoticDialog) EXTENDS(Dialog)
        // still to be customized by user
        /*
        ATTRIB(XonoticDialog, closable, float, 1)
-       ATTRIB(XonoticDialog, title, string, "Form1") // ;)
+       ATTRIB(XonoticDialog, title, string, _("Form1")) // ;)
        ATTRIB(XonoticDialog, color, vector, '1 0.5 1')
        ATTRIB(XonoticDialog, intendedWidth, float, 0)
        ATTRIB(XonoticDialog, rows, float, 3)
index 07c2fc4f293bca09b22c1089263c274e66324bc2..e90ae4b42590d08435472ea66b76c31e5a317fe4 100644 (file)
@@ -2,7 +2,7 @@
 CLASS(XonoticCreditsDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticCreditsDialog, fill, void(entity))
        METHOD(XonoticCreditsDialog, focusEnter, void(entity))
-       ATTRIB(XonoticCreditsDialog, title, string, "Credits")
+       ATTRIB(XonoticCreditsDialog, title, string, _("Credits"))
        ATTRIB(XonoticCreditsDialog, color, vector, SKINCOLOR_DIALOG_CREDITS)
        ATTRIB(XonoticCreditsDialog, intendedWidth, float, SKINWIDTH_CREDITS)
        ATTRIB(XonoticCreditsDialog, rows, float, SKINROWS_CREDITS)
@@ -18,7 +18,7 @@ void XonoticCreditsDialog_fill(entity me)
        me.TR(me);
                me.TD(me, me.rows - 1, me.columns, me.creditsList = makeXonoticCreditsList());
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("OK", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index 256dbe7df028ec0a93852b1dc0ae06123680a2df..299ea09fd7dc690b49584b108e570824cabfdff7 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDAmmoDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDAmmoDialog, fill, void(entity))
-       ATTRIB(XonoticHUDAmmoDialog, title, string, "Ammo Panel")
+       ATTRIB(XonoticHUDAmmoDialog, title, string, _("Ammo Panel"))
        ATTRIB(XonoticHUDAmmoDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDAmmoDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDAmmoDialog, rows, float, 15)
@@ -15,71 +15,18 @@ void XonoticHUDAmmoDialog_fill(entity me)
 {
        entity e;
        string panelname = "ammo";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_ammo", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Ammunition display:"));
+               me.TD(me, 1, 2, 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, 2, 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, 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")));
 }
 #endif
index c9a4eae6e80734de20449611918a871a5734aad6..331b0ee9ae265e0fe29b67f27f316f00f9cedce2 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDChatDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDChatDialog, fill, void(entity))
-       ATTRIB(XonoticHUDChatDialog, title, string, "Chat Panel")
+       ATTRIB(XonoticHUDChatDialog, title, string, _("Chat Panel"))
        ATTRIB(XonoticHUDChatDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDChatDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDChatDialog, rows, float, 15)
@@ -15,74 +15,21 @@ void XonoticHUDChatDialog_fill(entity me)
 {
        entity e;
        string panelname = "chat";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_chat", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Chat entries:"));
+               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Chat entries:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Chat size:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Chat size:")));
                me.TD(me, 1, 2.6, e = makeXonoticSlider(6, 20, 1, "con_chatsize"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Chat lifetime:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Chat lifetime:")));
                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, e = makeXonoticCheckBox(0, "con_chatsound", _("Chat beep sound")));
 }
 #endif
index 03ef106c7decd260147dbae0a48d8c0f9ffc296a..b69a5869e79993603011a0646df5bb17cfa92b7c 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDEngineInfoDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDEngineInfoDialog, fill, void(entity))
-       ATTRIB(XonoticHUDEngineInfoDialog, title, string, "Engine Info Panel")
+       ATTRIB(XonoticHUDEngineInfoDialog, title, string, _("Engine Info Panel"))
        ATTRIB(XonoticHUDEngineInfoDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDEngineInfoDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDEngineInfoDialog, rows, float, 15)
@@ -15,66 +15,13 @@ void XonoticHUDEngineInfoDialog_fill(entity me)
 {
        entity e;
        string panelname = "engineinfo";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_engineinfo", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Engine info:"));
+               me.TD(me, 1, 2, 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, e = makeXonoticCheckBox(0, "hud_panel_engineinfo_framecounter_exponentialmovingaverage", _("Use an averaging algorithm for fps")));
 }
 #endif
index 3e8a43aeb38520a386ca1ef25960587e6aae83b4..91da57cdfae8da55427c3dd189f5aed28b731505 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDHealthArmorDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDHealthArmorDialog, fill, void(entity))
-       ATTRIB(XonoticHUDHealthArmorDialog, title, string, "Health/Armor Panel")
+       ATTRIB(XonoticHUDHealthArmorDialog, title, string, _("Health/Armor Panel"))
        ATTRIB(XonoticHUDHealthArmorDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDHealthArmorDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDHealthArmorDialog, rows, float, 15)
@@ -15,86 +15,33 @@ void XonoticHUDHealthArmorDialog_fill(entity me)
 {
        entity e;
        string panelname = "healtharmor";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_progressbar", "Enable status bar"));
+               me.TD(me, 1, 3, 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, 2, e = makeXonoticTextLabel(0, _("Status bar alignment:")));
                        setDependent(e, "hud_panel_healtharmor_progressbar", 1, 1);
        me.TR(me);
                me.TDempty(me, 0.2);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "0", "Left"));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "0", _("Left")));
                        setDependent(e, "hud_panel_healtharmor_progressbar", 1, 1);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_healtharmor_baralign", "1", "Right"));
+                       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", "3", _("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", "4", _("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, 2, 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", "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.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_flip", "Flip health and armor positions"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor_flip", _("Flip health and armor positions")));
 }
 #endif
index d8534a20e9974d34030cb4dce2da064fcb987d6e..44b20294b7cc801eac215b0fd9421ab85702319c 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDInfoMessagesDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDInfoMessagesDialog, fill, void(entity))
-       ATTRIB(XonoticHUDInfoMessagesDialog, title, string, "Info Messages Panel")
+       ATTRIB(XonoticHUDInfoMessagesDialog, title, string, _("Info Messages Panel"))
        ATTRIB(XonoticHUDInfoMessagesDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDInfoMessagesDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDInfoMessagesDialog, rows, float, 15)
@@ -15,66 +15,13 @@ void XonoticHUDInfoMessagesDialog_fill(entity me)
 {
        entity e;
        string panelname = "infomessages";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_infomessages", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Info messages:"));
+               me.TD(me, 1, 2, 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, e = makeXonoticCheckBox(0, "hud_panel_infomessages_flip", _("Flip align")));
 }
 #endif
index d60a72473f4999bf5bc96e2d105a5c2a00834130..fd5d233dcf63b0acd5229864aaa5fe7e71b719da 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDModIconsDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDModIconsDialog, fill, void(entity))
-       ATTRIB(XonoticHUDModIconsDialog, title, string, "Mod Icons Panel")
+       ATTRIB(XonoticHUDModIconsDialog, title, string, _("Mod Icons Panel"))
        ATTRIB(XonoticHUDModIconsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDModIconsDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDModIconsDialog, rows, float, 15)
@@ -15,61 +15,7 @@ void XonoticHUDModIconsDialog_fill(entity me)
 {
        entity e;
        string panelname = "modicons";
-       float i;
 
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_modicons", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
+       DIALOG_HUDPANEL_COMMON();
 }
 #endif
index 3eeaff284db99458439ea17e9cc052016e835919..1f26ab34aa92e3f909cc71a223dddc462e1d8be8 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDNotificationDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDNotificationDialog, fill, void(entity))
-       ATTRIB(XonoticHUDNotificationDialog, title, string, "Notification Panel")
+       ATTRIB(XonoticHUDNotificationDialog, title, string, _("Notification Panel"))
        ATTRIB(XonoticHUDNotificationDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDNotificationDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDNotificationDialog, rows, float, 15)
@@ -15,77 +15,24 @@ void XonoticHUDNotificationDialog_fill(entity me)
 {
        entity e;
        string panelname = "notify";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_healtharmor", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Notifications:"));
+               me.TD(me, 1, 2, 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, 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, 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:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Entry lifetime:")));
                        me.TD(me, 1, 2.6, e = makeXonoticSlider(3, 15, 1, "hud_panel_notify_time"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Entry fadetime:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Entry fadetime:")));
                        me.TD(me, 1, 2.6, e = makeXonoticSlider(0.5, 5, 0.5, "hud_panel_notify_fadetime"));
 }
 #endif
index 5d4e14c08b62fc64876d7f22ae303c836a36d659..e63e785528f0ef10de774a51eb6a364c9d41f2fc 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDPowerupsDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDPowerupsDialog, fill, void(entity))
-       ATTRIB(XonoticHUDPowerupsDialog, title, string, "Powerups Panel")
+       ATTRIB(XonoticHUDPowerupsDialog, title, string, _("Powerups Panel"))
        ATTRIB(XonoticHUDPowerupsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDPowerupsDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDPowerupsDialog, rows, float, 15)
@@ -15,86 +15,33 @@ void XonoticHUDPowerupsDialog_fill(entity me)
 {
        entity e;
        string panelname = "powerups";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_powerups", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_powerups_progressbar", "Enable status bar"));
+               me.TD(me, 1, 3, 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, 2, e = makeXonoticTextLabel(0, _("Status bar alignment:")));
                        setDependent(e, "hud_panel_powerups_progressbar", 1, 1);
        me.TR(me);
                me.TDempty(me, 0.2);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "0", "Left"));
+                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "0", _("Left")));
                        setDependent(e, "hud_panel_powerups_progressbar", 1, 1);
-                       me.TD(me, 1, 0.95, e = makeXonoticRadioButton(2, "hud_panel_powerups_baralign", "1", "Right"));
+                       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", "3", _("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", "4", _("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, 2, 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", "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.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_powerups_flip", "Flip strength and shield positions"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_powerups_flip", _("Flip strength and shield positions")));
 }
 #endif
index 30f6bfc1f2da723a813477fa3b70e4c106ab9432..bbddb7fc1b5b7abb7bf29455662c84a89e4b4e72 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDPressedKeysDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDPressedKeysDialog, fill, void(entity))
-       ATTRIB(XonoticHUDPressedKeysDialog, title, string, "Pressed Keys Panel")
+       ATTRIB(XonoticHUDPressedKeysDialog, title, string, _("Pressed Keys Panel"))
        ATTRIB(XonoticHUDPressedKeysDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDPressedKeysDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDPressedKeysDialog, rows, float, 15)
@@ -15,69 +15,19 @@ void XonoticHUDPressedKeysDialog_fill(entity me)
 {
        entity e;
        string panelname = "pressedkeys";
-       float i;
 
        me.TR(me);
                me.TD(me, 1, 2, e = makeXonoticTextSlider("hud_panel_pressedkeys"));
-                       e.addValue(e, "Panel disabled", "0");
-                       e.addValue(e, "Panel enabled when spectating", "1");
-                       e.addValue(e, "Panel always enabled", "2");
+                       e.addValue(e, _("Panel disabled"), "0");
+                       e.addValue(e, _("Panel enabled when spectating"), "1");
+                       e.addValue(e, _("Panel always enabled"), "2");
                        e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
+
+       DIALOG_HUDPANEL_COMMON_NOTOGGLE();
+
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Forced aspect:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Forced aspect:")));
                        me.TD(me, 1, 2.6, e = makeXonoticSlider(0.2, 4, 0.1, "hud_panel_pressedkeys_aspect"));
 }
 #endif
index 35fdc55f3c8b5d9a8ae355dde2faa245fe11975d..015979b21e72157675fb963f4c19e6208fa7eb9f 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDRaceTimerDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDRaceTimerDialog, fill, void(entity))
-       ATTRIB(XonoticHUDRaceTimerDialog, title, string, "Race Timer Panel")
+       ATTRIB(XonoticHUDRaceTimerDialog, title, string, _("Race Timer Panel"))
        ATTRIB(XonoticHUDRaceTimerDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDRaceTimerDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDRaceTimerDialog, rows, float, 15)
@@ -15,61 +15,7 @@ void XonoticHUDRaceTimerDialog_fill(entity me)
 {
        entity e;
        string panelname = "racetimer";
-       float i;
 
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_racetimer", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
+       DIALOG_HUDPANEL_COMMON();
 }
 #endif
index d1202846e26c140f0140c5f3ac67b7898b1e0c8a..5a43bbdf60ac1a9ef7286637f25e13fe43e610bb 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDRadarDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDRadarDialog, fill, void(entity))
-       ATTRIB(XonoticHUDRadarDialog, title, string, "Radar Panel")
+       ATTRIB(XonoticHUDRadarDialog, title, string, _("Radar Panel"))
        ATTRIB(XonoticHUDRadarDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDRadarDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDRadarDialog, rows, float, 15)
@@ -15,94 +15,44 @@ void XonoticHUDRadarDialog_fill(entity me)
 {
        entity e;
        string panelname = "radar";
-       float i;
 
        me.TR(me);
                me.TD(me, 1, 2, e = makeXonoticTextSlider("hud_panel_radar"));
-                       e.addValue(e, "Panel disabled", "0");
-                       e.addValue(e, "Panel enabled in teamgames", "1");
-                       e.addValue(e, "Panel always enabled", "2");
+                       e.addValue(e, _("Panel disabled"), "0");
+                       e.addValue(e, _("Panel enabled in teamgames"), "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 = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Radar:"));
+               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Radar:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:")));
                me.TD(me, 1, 2.6, e = makeXonoticSlider(0.1, 1, 0.1, "hud_panel_radar_foreground_alpha"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Rotation:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Rotation:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_radar_rotation"));
-                               e.addValue(e, "Forward", "0");
-                               e.addValue(e, "West", "1");
-                               e.addValue(e, "South", "2");
-                               e.addValue(e, "East", "3");
-                               e.addValue(e, "North", "4");
+                               e.addValue(e, _("Forward"), "0");
+                               e.addValue(e, _("West"), "1");
+                               e.addValue(e, _("South"), "2");
+                               e.addValue(e, _("East"), "3");
+                               e.addValue(e, _("North"), "4");
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Scale:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Scale:")));
                me.TD(me, 1, 2.6, e = makeXonoticSlider(1024, 8192, 512, "hud_panel_radar_scale"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Zoom mode:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Zoom mode:")));
                        me.TD(me, 1, 1.6, e = makeXonoticTextSlider("hud_panel_radar_zoommode"));
-                               e.addValue(e, "Zoomed in", "0");
-                               e.addValue(e, "Zoomed out", "1");
-                               e.addValue(e, "Always zoomed", "2");
-                               e.addValue(e, "Never zoomed", "3");
+                               e.addValue(e, _("Zoomed in"), "0");
+                               e.addValue(e, _("Zoomed out"), "1");
+                               e.addValue(e, _("Always zoomed"), "2");
+                               e.addValue(e, _("Never zoomed"), "3");
                                e.configureXonoticTextSliderValues(e);
 }
 #endif
index fc51921e23777a3b2980123ca42ba99e2f446cd1..ccb8d9528bed1807833c8acaa8f0d2124e34b3d2 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDScoreDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDScoreDialog, fill, void(entity))
-       ATTRIB(XonoticHUDScoreDialog, title, string, "Score Panel")
+       ATTRIB(XonoticHUDScoreDialog, title, string, _("Score Panel"))
        ATTRIB(XonoticHUDScoreDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDScoreDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDScoreDialog, rows, float, 15)
@@ -15,61 +15,7 @@ void XonoticHUDScoreDialog_fill(entity me)
 {
        entity e;
        string panelname = "score";
-       float i;
 
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_score", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
+       DIALOG_HUDPANEL_COMMON();
 }
 #endif
index 96dc4aa6959f8fa8c18c4423cfc0c49afb913483..5f2fc5dd747b63cf8d73589ecc90b377c59fae7f 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDTimerDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDTimerDialog, fill, void(entity))
-       ATTRIB(XonoticHUDTimerDialog, title, string, "Timer Panel")
+       ATTRIB(XonoticHUDTimerDialog, title, string, _("Timer Panel"))
        ATTRIB(XonoticHUDTimerDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDTimerDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDTimerDialog, rows, float, 15)
@@ -15,66 +15,13 @@ void XonoticHUDTimerDialog_fill(entity me)
 {
        entity e;
        string panelname = "timer";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_timer", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, "Timer:"));
+               me.TD(me, 1, 2, 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, e = makeXonoticCheckBox(0, "hud_panel_timer_increment", _("Show elapsed time")));
 }
 #endif
index b5f5b6e27b965713d2cb0099a3457fd28fccd5a8..d3d35c22a45b19a2cd975509e43f74f5f8ee470e 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDVoteDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDVoteDialog, fill, void(entity))
-       ATTRIB(XonoticHUDVoteDialog, title, string, "Vote Panel")
+       ATTRIB(XonoticHUDVoteDialog, title, string, _("Vote Panel"))
        ATTRIB(XonoticHUDVoteDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDVoteDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDVoteDialog, rows, float, 15)
@@ -15,64 +15,11 @@ void XonoticHUDVoteDialog_fill(entity me)
 {
        entity e;
        string panelname = "vote";
-       float i;
+
+       DIALOG_HUDPANEL_COMMON();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_vote", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Alpha after voting:"));
+               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"));
 }
 #endif
index ad3d080415e6547af2452536ff50b8f8c4149321..b426a75c259cb964ed18a1b44eea496d2f638063 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDWeaponsDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDWeaponsDialog, fill, void(entity))
-       ATTRIB(XonoticHUDWeaponsDialog, title, string, "Weapons Panel")
+       ATTRIB(XonoticHUDWeaponsDialog, title, string, _("Weapons Panel"))
        ATTRIB(XonoticHUDWeaponsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDWeaponsDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDWeaponsDialog, rows, float, 17)
@@ -17,98 +17,46 @@ void XonoticHUDWeaponsDialog_fill(entity me)
        string panelname = "weapons";
        float i;
 
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_panel_weapons", "Enable panel"));
-       me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "Background:"));
-                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
-               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
-                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", cvar_string("hud_panel_bg_color"), strzone(strcat("hud_panel_", panelname, "_bg_color")), "Use default"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team Color:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
-                               e.addValue(e, "Default", "");
-                               e.addValue(e, "Disable", "0");
-                               for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
-                               e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
-                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
-                               e.addValue(e, "Default", "");
-                               for(i = 0; i <= 10; ++i)
-                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
-                               e.configureXonoticTextSliderValues(e);
+       DIALOG_HUDPANEL_COMMON();
+
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Fade out after:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Fade out after:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_timeout"))));
-                               e.addValue(e, "Never", "0");
+                               e.addValue(e, _("Never"), "0");
                                for(i = 1; i <= 10; ++i)
-                                       e.addValue(e, strzone(strcat(ftos_decimals(i, 0), "s")), strzone(ftos(i)));
+                                       e.addValue(e, strzone(sprintf(_("%ds"), i)), strzone(ftos(i)));
                                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", "None"));
+               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", _("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"));
+               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, 0.8, e = makeXonoticRadioButton(3, "hud_panel_weapons_timeout_effect", "2", _("Alpha")));
                        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, 2, 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:"));
-                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "0", "None"));
-                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "1", "Number"));
-                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "2", "Bind"));
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Show weapon ID as:")));
+                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "0", _("None")));
+                       me.TD(me, 1, 0.8, e = makeXonoticRadioButton(2, "hud_panel_weapons_label", "1", _("Number")));
+                       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, 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.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Ammo bar color:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Ammo bar color:")));
                me.TD(me, 2, 2.4, e = makeXonoticColorpickerString("hud_panel_weapons_ammo_color", "hud_panel_weapons_ammo_color"));
                        setDependent(e, "hud_panel_weapons_ammo", 1, 1);
                me.TR(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, 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"));
                        setDependent(e, "hud_panel_weapons_ammo", 1, 1);
 }
index 751b3cf95c73004f35b08ea92bb3ecc97e1150ec..5a7139fdc9d62d33b1a0c8b8f32a587dd957df08 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticHUDExitDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticHUDExitDialog, fill, void(entity))
-       ATTRIB(XonoticHUDExitDialog, title, string, "Panel HUD Setup")
+       ATTRIB(XonoticHUDExitDialog, title, string, _("Panel HUD Setup"))
        ATTRIB(XonoticHUDExitDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticHUDExitDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticHUDExitDialog, rows, float, 18)
@@ -18,95 +18,95 @@ void XonoticHUDExitDialog_fill(entity me)
        float i;
 
        me.TR(me);
-               me.TD(me, 1, 4, makeXonoticTextLabel(0, "Panel background defaults:"));
+               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.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_bg"))));
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, "border_default", "border_default");
+                               e.addValue(e, _("Disable"), "0");
+                               e.addValue(e, "border_default", "border_default"); // this is a file name!
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Color:")));
                me.TD(me, 2, 2.4, e = makeXonoticColorpickerString("hud_panel_bg_color", "hud_panel_bg_color"));
        me.TR(me);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Border size:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Border size:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_border"));
-                               e.addValue(e, "Disable", "0");
+                               e.addValue(e, _("Disable"), "0");
                                for(i = 1; i <= 10; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_alpha"));
                                for(i = 1; i <= 10; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team color:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Team color:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_color_team"));
-                               e.addValue(e, "Disable", "0");
+                               e.addValue(e, _("Disable"), "0");
                                for(i = 1; i <= 10; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.4);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", "Test the team color in HUD configure mode"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", _("Test the team color in HUD configure mode")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Padding:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Padding:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_panel_bg_padding"));
                                for(i = 0; i <= 10; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
                                e.configureXonoticTextSliderValues(e);
 
        me.TR(me);
-               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, "HUD Dock:"));
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("HUD Dock:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_dock"));
-                               e.addValue(e, "Disable", "0");
-                               e.addValue(e, "Small", "dock_small");
-                               e.addValue(e, "Medium", "dock_medium");
-                               e.addValue(e, "Large", "dock_large");
+                               e.addValue(e, _("Disable"), "0");
+                               e.addValue(e, _("Small"), "dock_small");
+                               e.addValue(e, _("Medium"), "dock_medium");
+                               e.addValue(e, _("Large"), "dock_large");
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Color:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Color:")));
                me.TD(me, 2, 2.4, e = makeXonoticColorpickerString("hud_dock_color", "hud_dock_color"));
        me.TR(me);
        me.TR(me);      
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Alpha:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_dock_alpha"));
                                for(i = 1; i <= 10; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Team color:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Team color:")));
                        me.TD(me, 1, 2.6, e = makeXonoticTextSlider("hud_dock_color_team"));
-                               e.addValue(e, "Disable", "0");
+                               e.addValue(e, _("Disable"), "0");
                                for(i = 1; i <= 10; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
                                e.configureXonoticTextSliderValues(e);
        me.TR(me);
-               me.TD(me, 1, 4, makeXonoticTextLabel(0, "Grid settings:"));
+               me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Grid settings:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_grid", "Snap panels to grid"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_grid", _("Snap panels to grid")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Grid size:"));
-               me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, "X:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Grid size:")));
+               me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, _("X:")));
                        me.TD(me, 1, 1.1, e = makeXonoticTextSlider("hud_configure_grid_xsize"));
                                for(i = 1; i <= 14; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i/200, 3)), strzone(ftos(i/200)));
                                e.configureXonoticTextSliderValues(e);
                        setDependent(e, "hud_configure_grid", 1, 1);
-               me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, "Y:"));
+               me.TD(me, 1, 0.2, e = makeXonoticTextLabel(0, _("Y:")));
                        me.TD(me, 1, 1.1, e = makeXonoticTextSlider("hud_configure_grid_ysize"));
                                for(i = 1; i <= 14; ++i)
                                        e.addValue(e, strzone(ftos_decimals(i/200, 3)), strzone(ftos(i/200)));
@@ -114,6 +114,6 @@ void XonoticHUDExitDialog_fill(entity me)
                        setDependent(e, "hud_configure_grid", 1, 1);
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticCommandButton("Exit setup", '0 0 0', "_hud_configure 0", 1));
+               me.TD(me, 1, me.columns, e = makeXonoticCommandButton(_("Exit setup"), '0 0 0', "_hud_configure 0", 1));
 }
 #endif
index e755710c5b31bb0bb69de0cb5d85be32c85f4380..e57ecce29f5786d62d21efd11768f99b59a53ca9 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticMultiplayerDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticMultiplayerDialog, fill, void(entity))
-       ATTRIB(XonoticMultiplayerDialog, title, string, "Multiplayer")
+       ATTRIB(XonoticMultiplayerDialog, title, string, _("Multiplayer"))
        ATTRIB(XonoticMultiplayerDialog, color, vector, SKINCOLOR_DIALOG_MULTIPLAYER)
        ATTRIB(XonoticMultiplayerDialog, intendedWidth, float, 0.96)
        ATTRIB(XonoticMultiplayerDialog, rows, float, 24)
@@ -15,12 +15,12 @@ void XonoticMultiplayerDialog_fill(entity me)
        entity mc, e;
        mc = makeXonoticTabController(me.rows - 2);
        me.TR(me);
-               me.TD(me, 1, 1, e = mc.makeTabButton(mc, "Servers",  makeXonoticServerListTab()));
+               me.TD(me, 1, 1, e = mc.makeTabButton(mc, _("Servers"),  makeXonoticServerListTab()));
                        setDependentStringNotEqual(e, "_cl_name", "Player");
-               me.TD(me, 1, 1, e = mc.makeTabButton(mc, "Create",  makeXonoticServerCreateTab()));
+               me.TD(me, 1, 1, e = mc.makeTabButton(mc, _("Create"),  makeXonoticServerCreateTab()));
                        setDependentStringNotEqual(e, "_cl_name", "Player");
-               me.TD(me, 1, 1, mc.makeTabButton(mc, "Demos",   makeXonoticDemoBrowserTab()));
-               me.TD(me, 1, 1, e = mc.makeTabButton(mc, "Player Setup",  makeXonoticPlayerSettingsTab()));
+               me.TD(me, 1, 1, mc.makeTabButton(mc, _("Demos"),   makeXonoticDemoBrowserTab()));
+               me.TD(me, 1, 1, e = mc.makeTabButton(mc, _("Player Setup"),  makeXonoticPlayerSettingsTab()));
                        if(cvar_string("_cl_name") == "Player")
                                e.onClick(e, e.onClickEntity); // lol animation
 
index 416a85419b1f2a3cd5e549c428b7713e2195c20b..2d9689f64422e5d527692b91b753a30afb6268a8 100644 (file)
@@ -2,7 +2,7 @@
 CLASS(XonoticServerCreateTab) EXTENDS(XonoticTab)
        METHOD(XonoticServerCreateTab, fill, void(entity))
        METHOD(XonoticServerCreateTab, gameTypeChangeNotify, void(entity))
-       ATTRIB(XonoticServerCreateTab, title, string, "Create")
+       ATTRIB(XonoticServerCreateTab, title, string, _("Create"))
        ATTRIB(XonoticServerCreateTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticServerCreateTab, rows, float, 22)
        ATTRIB(XonoticServerCreateTab, columns, float, 6.5)
@@ -32,148 +32,92 @@ void XonoticServerCreateTab_fill(entity me)
        float n;
 
        me.TR(me);
-               n = 6;
-               me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_dm", "DM"));
-                       e0 = e;
-               me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_lms", "LMS"));
-                       if(e.checked) e0 = NULL;
-               me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_arena", "Arena"));
-                       if(e.checked) e0 = NULL;
-               me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_keepaway", "Keepaway"));
-                       if(e.checked) e0 = NULL;
-               me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_race", "Race"));
-                       if(e.checked) e0 = NULL;
-               me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_cts", "Race CTS"));
-                       if(e.checked) e0 = NULL;
-       me.TR(me);
-               n = 9;
-               me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_tdm", "TDM"));
-                       if(e.checked) e0 = NULL;
-               me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_ctf", "CTF"));
-                       if(e.checked) e0 = NULL;
-               me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_ca", "CA"));
-                       if(e.checked) e0 = NULL;
-               me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_freezetag", "Freeze Tag"));
-                       if(e.checked) e0 = NULL;
-               me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_domination", "Domination"));
-                       if(e.checked) e0 = NULL;
-               me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_keyhunt", "Key Hunt"));
-                       if(e.checked) e0 = NULL;
-               me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_assault", "Assault"));
-                       if(e.checked) e0 = NULL;
-               me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_onslaught", "Onslaught"));
-                       if(e.checked) e0 = NULL;
-               me.TD(me, 1, me.columns / n, e = makeXonoticGametypeButton(1, "g_nexball", "Nexball"));
-                       if(e.checked) e0 = NULL;
-               if(e0)
-               {
-                       //print("NO CHECK\n");
-                       e0.setChecked(e0, 1);
-               }
+               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Game type:")));
+       me.TR(me);
+               me.TD(me, 9, 3, e = makeXonoticGametypeList());
+       me.TR(me);
        me.TR(me);
        me.TR(me);
-               me.mapListBox = makeXonoticMapList();
-               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, "Map list:"));
-                       makeCallback(e, me.mapListBox, me.mapListBox.refilterCallback);
        me.TR(me);
-               me.TD(me, me.rows - 7, 3, me.mapListBox);
-       me.gotoRC(me, me.rows - 3, 0);
-               me.TDempty(me, 0.5);
-               me.TD(me, 1, 1, e = makeXonoticButton("All", '0 0 0'));
-                       e.onClick = MapList_All;
-                       e.onClickEntity = me.mapListBox;
-               me.TD(me, 1, 1, e = makeXonoticButton("None", '0 0 0'));
-                       e.onClick = MapList_None;
-                       e.onClickEntity = me.mapListBox;
-               me.TDempty(me, 0.5);
-
-       me.gotoRC(me, 3, 3.5); me.setFirstColumn(me, me.currentColumn);
-               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, "Match settings:"));
+       me.TR(me);
+       me.TR(me);
+       me.TR(me);
+       me.TR(me);
+       me.TR(me);
+               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Match settings:")));
        me.TR(me);
                me.sliderTimelimit = makeXonoticSlider(1.0, 60.0, 0.5, "timelimit_override");
-               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, me.sliderTimelimit, "Time limit:"));
+               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, me.sliderTimelimit, _("Time limit:")));
                me.TD(me, 1, 2, me.sliderTimelimit);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2.8, e = makeXonoticSliderCheckBox(-1, 0, me.sliderTimelimit, "Use map specified default"));
+               me.TD(me, 1, 2.8, e = makeXonoticSliderCheckBox(-1, 0, me.sliderTimelimit, _("Use map specified default")));
        me.TR(me);
                me.sliderFraglimit = makeXonoticSlider(1.0, 2000.0, 5, "fraglimit_override");
-               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, me.sliderFraglimit, "Point limit:"));
+               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, me.sliderFraglimit, _("Point limit:")));
                        me.checkboxFraglimit = e;
                me.TD(me, 1, 2, me.sliderFraglimit);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2.8, e = makeXonoticSliderCheckBox(-1, 0, me.sliderFraglimit, "Use map specified default"));
+               me.TD(me, 1, 2.8, e = makeXonoticSliderCheckBox(-1, 0, me.sliderFraglimit, _("Use map specified default")));
                        me.checkboxFraglimitMapinfo = e;
        me.TR(me);
-       me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Player slots:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Player slots:")));
                me.TD(me, 1, 2, makeXonoticSlider(1, 32, 1, "menu_maxplayers"));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Number of bots:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Number of bots:")));
                me.TD(me, 1, 2, makeXonoticSlider(0, 9, 1, "bot_number"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Bot skill:"));
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Bot skill:")));
                        setDependent(e, "bot_number", 0, -1);
                me.TD(me, 1, 2, e = makeXonoticTextSlider("skill"));
-                       e.addValue(e, "Botlike", "0");
-                       e.addValue(e, "Beginner", "1");
-                       e.addValue(e, "You will win", "2");
-                       e.addValue(e, "You can win", "3");
-                       e.addValue(e, "You might win", "4");
-                       e.addValue(e, "Advanced", "5");
-                       e.addValue(e, "Expert", "6");
-                       e.addValue(e, "Pro", "7");
-                       e.addValue(e, "Assassin", "8");
-                       e.addValue(e, "Unhuman", "9");
-                       e.addValue(e, "Godlike", "10");
+                       e.addValue(e, _("Botlike"), "0");
+                       e.addValue(e, _("Beginner"), "1");
+                       e.addValue(e, _("You will win"), "2");
+                       e.addValue(e, _("You can win"), "3");
+                       e.addValue(e, _("You might win"), "4");
+                       e.addValue(e, _("Advanced"), "5");
+                       e.addValue(e, _("Expert"), "6");
+                       e.addValue(e, _("Pro"), "7");
+                       e.addValue(e, _("Assassin"), "8");
+                       e.addValue(e, _("Unhuman"), "9");
+                       e.addValue(e, _("Godlike"), "10");
                        e.configureXonoticTextSliderValues(e);
                        setDependent(e, "bot_number", 0, -1);
        me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Bot names:"));
-               me.TD(me, 1, 0.7, e = makeXonoticInputBox(1, "bot_prefix"));
-                       setDependent(e, "bot_number", 0, -1);
-               me.TD(me, 1, 0.6, e = makeXonoticTextLabel(0.5, "Shadow"));
-                       setDependent(e, "bot_number", 0, -1);
-               me.TD(me, 1, 0.7, e = makeXonoticInputBox(1, "bot_suffix"));
-                       setDependent(e, "bot_number", 0, -1);
-       me.TR(me);
-       me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Map voting:"));
-               me.TD(me, 1, 2, e = makeXonoticTextSlider("g_maplist_votable"));
-                       e.addValue(e, "No voting", "0");
-                       e.addValue(e, "2 choices", "2");
-                       e.addValue(e, "3 choices", "3");
-                       e.addValue(e, "4 choices", "4");
-                       e.addValue(e, "5 choices", "5");
-                       e.addValue(e, "6 choices", "6");
-                       e.addValue(e, "7 choices", "7");
-                       e.addValue(e, "8 choices", "8");
-                       e.addValue(e, "9 choices", "9");
-                       e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.5, 0, "sv_vote_simple_majority_factor", "Simple majority wins vcall"));
-       me.TR(me);
-       me.TR(me);
-               me.TDempty(me, 0.5);
-               me.TD(me, 1, 2, e = makeXonoticButton("Advanced settings...", '0 0 0'));
-                       e.onClick = DialogOpenButton_Click;
-                       e.onClickEntity = main.advancedDialog;
-                       main.advancedDialog.refilterEntity = me.mapListBox;
-               me.TR(me);
-               me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticButton("Mutators...", '0 0 0'));
+               me.TD(me, 1, 1, e = makeXonoticButton(_("Mutators..."), '0 0 0'));
                        e.onClick = DialogOpenButton_Click;
                        e.onClickEntity = main.mutatorsDialog;
                        main.mutatorsDialog.refilterEntity = me.mapListBox;
                me.TD(me, 1, 2, e0 = makeXonoticTextLabel(0, string_null));
                        e0.textEntity = main.mutatorsDialog;
                        e0.allowCut = 1;
+       me.TR(me);
+               me.TDempty(me, 0.5);
+               me.TD(me, 1, 2, e = makeXonoticButton(_("Advanced settings..."), '0 0 0'));
+                       e.onClick = DialogOpenButton_Click;
+                       e.onClickEntity = main.advancedDialog;
+                       main.advancedDialog.refilterEntity = me.mapListBox;
+
+       me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
+               me.mapListBox = makeXonoticMapList();
+               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Map list:")));
+                       makeCallback(e, me.mapListBox, me.mapListBox.refilterCallback);
+       me.TR(me);
+               me.TD(me, me.rows - 4, 3, me.mapListBox);
+       me.gotoRC(me, me.rows - 3, 3.5);
+               me.TDempty(me, 0.25);
+               me.TD(me, 1, 1.125, e = makeXonoticButton(_("Select all"), '0 0 0'));
+                       e.onClick = MapList_All;
+                       e.onClickEntity = me.mapListBox;
+               me.TD(me, 1, 1.125, e = makeXonoticButton(_("Select none"), '0 0 0'));
+                       e.onClick = MapList_None;
+                       e.onClickEntity = me.mapListBox;
+               me.TDempty(me, 0.25);
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("Start Multiplayer!", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("Start Multiplayer!"), '0 0 0'));
                        e.onClick = MapList_LoadMap;
                        e.onClickEntity = me.mapListBox;
                        me.mapListBox.startButton = e;
@@ -208,17 +152,17 @@ void XonoticServerCreateTab_gameTypeChangeNotify(entity me)
        l2 = me.checkboxFraglimitMapinfo;
        switch(gt)
        {
-               case MAPINFO_TYPE_CTF:        GameType_ConfigureSliders(e, l, l2, "Capture limit:",   1,   20, 1, "capturelimit_override");     break;
-               case MAPINFO_TYPE_DOMINATION: GameType_ConfigureSliders(e, l, l2, "Point limit:",    50,  500, 10, "g_domination_point_limit"); break;
-               case MAPINFO_TYPE_KEYHUNT:    GameType_ConfigureSliders(e, l, l2, "Point limit:",   200, 1500, 50, "g_keyhunt_point_limit");    break;
-               case MAPINFO_TYPE_RUNEMATCH:  GameType_ConfigureSliders(e, l, l2, "Point limit:",    50,  500, 10, "g_runematch_point_limit");  break;
-               case MAPINFO_TYPE_LMS:        GameType_ConfigureSliders(e, l, l2, "Lives:",           3,   50,  1, "g_lms_lives_override");     break;
-               case MAPINFO_TYPE_RACE:       GameType_ConfigureSliders(e, l, l2, "Laps:",            1,   25,  1, "g_race_laps_limit");        break;
-               case MAPINFO_TYPE_NEXBALL:    GameType_ConfigureSliders(e, l, l2, "Goals:",           1,   50,  1, "g_nexball_goallimit");      break;
-               case MAPINFO_TYPE_ASSAULT:    GameType_ConfigureSliders(e, l, l2, "Point limit:",    50,  500, 10, "");                         break;
-               case MAPINFO_TYPE_ONSLAUGHT:  GameType_ConfigureSliders(e, l, l2, "Point limit:",    50,  500, 10, "");                         break;
-               case MAPINFO_TYPE_CTS:        GameType_ConfigureSliders(e, l, l2, "Point limit:",    50,  500, 10, "");                         break;
-               default:                      GameType_ConfigureSliders(e, l, l2, "Frag limit:",      5,  100,  5, "fraglimit_override");       break;
+               case MAPINFO_TYPE_CTF:        GameType_ConfigureSliders(e, l, l2, _("Capture limit:"),   1,   20, 1, "capturelimit_override");     break;
+               case MAPINFO_TYPE_DOMINATION: GameType_ConfigureSliders(e, l, l2, _("Point limit:"),    50,  500, 10, "g_domination_point_limit"); break;
+               case MAPINFO_TYPE_KEYHUNT:    GameType_ConfigureSliders(e, l, l2, _("Point limit:"),   200, 1500, 50, "g_keyhunt_point_limit");    break;
+               case MAPINFO_TYPE_RUNEMATCH:  GameType_ConfigureSliders(e, l, l2, _("Point limit:"),    50,  500, 10, "g_runematch_point_limit");  break;
+               case MAPINFO_TYPE_LMS:        GameType_ConfigureSliders(e, l, l2, _("Lives:"),           3,   50,  1, "g_lms_lives_override");     break;
+               case MAPINFO_TYPE_RACE:       GameType_ConfigureSliders(e, l, l2, _("Laps:"),            1,   25,  1, "g_race_laps_limit");        break;
+               case MAPINFO_TYPE_NEXBALL:    GameType_ConfigureSliders(e, l, l2, _("Goals:"),           1,   50,  1, "g_nexball_goallimit");      break;
+               case MAPINFO_TYPE_ASSAULT:    GameType_ConfigureSliders(e, l, l2, _("Point limit:"),    50,  500, 10, "");                         break;
+               case MAPINFO_TYPE_ONSLAUGHT:  GameType_ConfigureSliders(e, l, l2, _("Point limit:"),    50,  500, 10, "");                         break;
+               case MAPINFO_TYPE_CTS:        GameType_ConfigureSliders(e, l, l2, _("Point limit:"),    50,  500, 10, "");                         break;
+               default:                      GameType_ConfigureSliders(e, l, l2, _("Frag limit:"),      5,  100,  5, "fraglimit_override");       break;
        }
        me.mapListBox.refilter(me.mapListBox);
 }
index 647f6afbaac36dd25b4ee2b7b16da136d1a4b996..226f346b643ae55e715a7b5e5cf87eea887412cf 100644 (file)
@@ -3,10 +3,10 @@ CLASS(XonoticAdvancedDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticAdvancedDialog, fill, void(entity))
        METHOD(XonoticAdvancedDialog, showNotify, void(entity))
        METHOD(XonoticAdvancedDialog, close, void(entity))
-       ATTRIB(XonoticAdvancedDialog, title, string, "Advanced server settings")
+       ATTRIB(XonoticAdvancedDialog, title, string, _("Advanced server settings"))
        ATTRIB(XonoticAdvancedDialog, color, vector, SKINCOLOR_DIALOG_ADVANCED)
        ATTRIB(XonoticAdvancedDialog, intendedWidth, float, 0.5)
-       ATTRIB(XonoticAdvancedDialog, rows, float, 12)
+       ATTRIB(XonoticAdvancedDialog, rows, float, 17)
        ATTRIB(XonoticAdvancedDialog, columns, float, 3)
        ATTRIB(XonoticAdvancedDialog, refilterEntity, entity, NULL)
 ENDCLASS(XonoticAdvancedDialog)
@@ -22,42 +22,64 @@ void XonoticAdvancedDialog_fill(entity me)
 {
        entity e;
        me.TR(me);
-               me.TD(me, 1, 3, makeXonoticTextLabel(0, "Game settings:"));
+               me.TD(me, 1, 3, makeXonoticTextLabel(0, _("Game settings:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "sv_spectate", "Allow spectating"));
+               me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "sv_spectate", _("Allow spectating")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Spawn shield:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Spawn shield:")));
                me.TD(me, 1, 1.6, e = makeXonoticSlider(0, 15, 0.5, "g_spawnshieldtime"));
        me.TR(me);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Game speed:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Game speed:")));
                me.TD(me, 1, 1.6, e = makeXonoticSlider(0.5, 2.0, 0.1, "slowmo"));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 3, makeXonoticTextLabel(0, "Teamplay settings:"));
+               me.TD(me, 1, 3, makeXonoticTextLabel(0, _("Teamplay settings:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Friendly fire scale:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Friendly fire scale:")));
                me.TD(me, 1, 1.6, e = makeXonoticSlider(0, 1.0, 0.05, "g_friendlyfire"));
+       me.TR(me);
+               me.TDempty(me, 0.4);
+               me.TD(me, 1, 2.6, e = makeXonoticCheckBox(0, "g_friendlyfire_virtual", _("Virtual friendly fire (effect only)")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Friendly fire penalty:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Friendly fire penalty:")));
                me.TD(me, 1, 1.6, e = makeXonoticSlider(0, 1.0, 0.05, "g_mirrordamage"));
+       me.TR(me);
+               me.TDempty(me, 0.4);
+               me.TD(me, 1, 2.6, e = makeXonoticCheckBox(0, "g_mirrordamage_virtual", _("Virtual penalty (effect only)")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, "Teams:"));
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Teams:")));
                me.TD(me, 1, 1.6, e = makeXonoticTextSlider("g_tdm_teams_override g_domination_teams_override g_keyhunt_teams_override"));
                        e.addValue(e, "Default", "0");
                        e.addValue(e, "2 teams", "2");
                        e.addValue(e, "3 teams", "3");
                        e.addValue(e, "4 teams", "4");
                        e.configureXonoticTextSliderValues(e);
+       me.TR(me);
+       me.TR(me);
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Map voting:")));
+               me.TD(me, 1, 2, e = makeXonoticTextSlider("g_maplist_votable"));
+                       e.addValue(e, _("No voting"), "0");
+                       e.addValue(e, _("2 choices"), "2");
+                       e.addValue(e, _("3 choices"), "3");
+                       e.addValue(e, _("4 choices"), "4");
+                       e.addValue(e, _("5 choices"), "5");
+                       e.addValue(e, _("6 choices"), "6");
+                       e.addValue(e, _("7 choices"), "7");
+                       e.addValue(e, _("8 choices"), "8");
+                       e.addValue(e, _("9 choices"), "9");
+                       e.configureXonoticTextSliderValues(e);
+       me.TR(me);
+               me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(0.5, 0, "sv_vote_simple_majority_factor", _("Simple majority wins vcall")));
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("OK", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index f3f620d7318bad17a6b00edc8ae5cac4e20f8c0f..677161b637077ff6aab7d7b57f329e4cc965c9f5 100644 (file)
@@ -2,10 +2,10 @@
 CLASS(XonoticMapInfoDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticMapInfoDialog, fill, void(entity))
        METHOD(XonoticMapInfoDialog, loadMapInfo, void(entity, float, entity))
-       ATTRIB(XonoticMapInfoDialog, title, string, "Map Information")
+       ATTRIB(XonoticMapInfoDialog, title, string, _("Map Information"))
        ATTRIB(XonoticMapInfoDialog, color, vector, SKINCOLOR_DIALOG_MAPINFO)
-       ATTRIB(XonoticMapInfoDialog, intendedWidth, float, 0.85)
-       ATTRIB(XonoticMapInfoDialog, rows, float, 9)
+       ATTRIB(XonoticMapInfoDialog, intendedWidth, float, 1.0)
+       ATTRIB(XonoticMapInfoDialog, rows, float, 12)
        ATTRIB(XonoticMapInfoDialog, columns, float, 10)
 
        ATTRIB(XonoticMapInfoDialog, previewImage, entity, NULL)
@@ -14,22 +14,7 @@ CLASS(XonoticMapInfoDialog) EXTENDS(XonoticDialog)
        ATTRIB(XonoticMapInfoDialog, descriptionLabel, entity, NULL)
        ATTRIB(XonoticMapInfoDialog, featuresLabel, entity, NULL)
 
-       ATTRIB(XonoticMapInfoDialog, typeDeathmatchLabel, entity, NULL)
-       ATTRIB(XonoticMapInfoDialog, typeTDMLabel, entity, NULL)
-       ATTRIB(XonoticMapInfoDialog, typeLMSLabel, entity, NULL)
-       ATTRIB(XonoticMapInfoDialog, typeArenaLabel, entity, NULL)
-       ATTRIB(XonoticMapInfoDialog, typeRuneLabel, entity, NULL)
-       ATTRIB(XonoticMapInfoDialog, typeDominationLabel, entity, NULL)
-       ATTRIB(XonoticMapInfoDialog, typeKeyHuntLabel, entity, NULL)
-       ATTRIB(XonoticMapInfoDialog, typeCTFLabel, entity, NULL)
-       ATTRIB(XonoticMapInfoDialog, typeCALabel, entity, NULL)
-       ATTRIB(XonoticMapInfoDialog, typeAssaultLabel, entity, NULL)
-       ATTRIB(XonoticMapInfoDialog, typeOnslaughtLabel, entity, NULL)
-       ATTRIB(XonoticMapInfoDialog, typeRaceLabel, entity, NULL)
-       ATTRIB(XonoticMapInfoDialog, typeCTSLabel, entity, NULL)
-       ATTRIB(XonoticMapInfoDialog, typeNexballLabel, entity, NULL)
-       ATTRIB(XonoticMapInfoDialog, typeFreezetagLabel, entity, NULL)
-       ATTRIB(XonoticMapInfoDialog, typeKeepawayLabel, entity, NULL)
+       ATTRIBARRAY(XonoticMapInfoDialog, typeLabels, entity, 24)
 
        ATTRIB(XonoticMapInfoDialog, currentMapIndex, float, 0)
        ATTRIB(XonoticMapInfoDialog, currentMapBSPName, string, string_null)
@@ -61,7 +46,7 @@ void XonoticMapInfoDialog_loadMapInfo(entity me, float i, entity mlb)
        me.currentMapTitle = strzone(MapInfo_Map_title);
        me.currentMapAuthor = strzone(MapInfo_Map_author);
        me.currentMapDescription = strzone(MapInfo_Map_description);
-       me.currentMapFeaturesText = strzone((MapInfo_Map_supportedFeatures & MAPINFO_FEATURE_WEAPONS) ? "Full item placement" : "MinstaGib only");
+       me.currentMapFeaturesText = strzone((MapInfo_Map_supportedFeatures & MAPINFO_FEATURE_WEAPONS) ? _("Full item placement") : _("MinstaGib only"));
        me.currentMapPreviewImage = strzone(strcat("/maps/", MapInfo_Map_bspname));
 
        me.frame.setText(me.frame, me.currentMapBSPName);
@@ -71,89 +56,57 @@ void XonoticMapInfoDialog_loadMapInfo(entity me, float i, entity mlb)
        me.featuresLabel.setText(me.featuresLabel, me.currentMapFeaturesText);
        me.previewImage.src = me.currentMapPreviewImage;
 
-       me.typeDeathmatchLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH);
-       me.typeTDMLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH);
-       me.typeLMSLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_LMS);
-       me.typeArenaLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ARENA);
-       me.typeDominationLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DOMINATION);
-       me.typeRuneLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RUNEMATCH);
-       me.typeKeyHuntLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_KEYHUNT);
-       me.typeCTFLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CTF);
-       me.typeCALabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CA);
-       me.typeAssaultLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ASSAULT);
-       me.typeOnslaughtLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_ONSLAUGHT);
-       me.typeRaceLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RACE);
-       me.typeCTSLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CTS);
-       me.typeNexballLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_NEXBALL);
-       me.typeFreezetagLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_FREEZETAG);
-       me.typeKeepawayLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_KEEPAWAY);
+       for(i = 0; i < GameType_GetCount(); ++i)
+       {
+               entity e;
+               e = me.(typeLabels[i]);
+               e.disabled = !(MapInfo_Map_supportedGametypes & GameType_GetID(i));
+       }
 
        MapInfo_ClearTemps();
 }
 void XonoticMapInfoDialog_fill(entity me)
 {
        entity e;
-       float w, wgt;
+       float w, wgt, i, n;
        me.TR(me);
                me.TDempty(me, 0.2);
                me.TD(me, me.rows - 2, 3, e = makeXonoticImage(string_null, 4.0/3.0));
                me.previewImage = e;
        me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
        w = me.columns - me.currentColumn;
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Title:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Title:")));
                me.TD(me, 1, w-1, e = makeXonoticTextLabel(0, ""));
                        e.colorL = SKINCOLOR_MAPLIST_TITLE;
                        e.allowCut = 1;
                        me.titleLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Author:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Author:")));
                me.TD(me, 1, w-1, e = makeXonoticTextLabel(0, ""));
                        e.colorL = SKINCOLOR_MAPLIST_AUTHOR;
                        e.allowCut = 1;
                        me.authorLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Features:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Features:")));
                me.TD(me, 1, w-1, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.featuresLabel = e;
        me.TR(me);
-               me.TD(me, 1, w, e = makeXonoticTextLabel(0, "Game types:"));
-       me.TR(me); wgt = (w-0.2)/5;
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "DM"));
-                       me.typeDeathmatchLabel = e;
-               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "TDM"));
-                       me.typeTDMLabel = e;
-               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "LMS"));
-                       me.typeLMSLabel = e;
-               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "Arena"));
-                       me.typeArenaLabel = e;
-               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "Domination"));
-                       me.typeDominationLabel = e;
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "Key Hunt"));
-                       me.typeKeyHuntLabel = e;
-               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "CTF"));
-                       me.typeCTFLabel = e;
-               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "CA"));
-                       me.typeCALabel = e;
-               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "Assault"));
-                       me.typeAssaultLabel = e;
-               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "Onslaught"));
-                       me.typeOnslaughtLabel = e;
-       me.TR(me);
-               me.TDempty(me, 0.2);
-               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "Race"));
-                       me.typeRaceLabel = e;
-               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "CTS"));
-                       me.typeCTSLabel = e;
-               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "Nexball"));
-                       me.typeNexballLabel = e;
-               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "Freezetag"));
-                       me.typeFreezetagLabel = e;
-               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, "Keepaway"));
-                       me.typeKeepawayLabel = e;
+               me.TD(me, 1, w, e = makeXonoticTextLabel(0, _("Game types:")));
+
+       
+       n = ceil(GameType_GetCount() / (me.rows - 6));
+       wgt = (w - 0.2) / n;
+       for(i = 0; i < GameType_GetCount(); ++i)
+       {
+               if(mod(i, n) == 0)
+               {
+                       me.TR(me);
+                       me.TDempty(me, 0.2);
+               }
+               me.TD(me, 1, wgt, e = makeXonoticTextLabel(0, GameType_GetName(i)));
+                       me.(typeLabels[i]) = e;
+       }
 
        me.gotoRC(me, me.rows - 2, 0);
                me.TD(me, 1, me.columns, e = makeXonoticTextLabel(0.5, ""));
@@ -163,10 +116,10 @@ void XonoticMapInfoDialog_fill(entity me)
        me.gotoRC(me, me.rows - 1, 0);
                me.TDempty(me, 0.5);
 
-               me.TD(me, 1, me.columns - 5.5, e = makeXonoticButton("Close", '0 0 0'));
+               me.TD(me, 1, me.columns - 5.5, e = makeXonoticButton(_("Close"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
-               me.TD(me, 1, me.columns - 5.5, me.startButton = e = makeXonoticButton("Play", '0 0 0'));
+               me.TD(me, 1, me.columns - 5.5, me.startButton = e = makeXonoticButton(_("Play"), '0 0 0'));
                        me.startButton.onClick = MapList_LoadMap;
                        me.startButton.onClickEntity = NULL; // filled later
 }
index 984ae9b2655538c6f3be917f3560dec175143047..267d237b4b713793210850fc69fbe085e9fc1a3e 100644 (file)
@@ -4,7 +4,7 @@ CLASS(XonoticMutatorsDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticMutatorsDialog, fill, void(entity))
        METHOD(XonoticMutatorsDialog, showNotify, void(entity))
        METHOD(XonoticMutatorsDialog, close, void(entity))
-       ATTRIB(XonoticMutatorsDialog, title, string, "Mutators")
+       ATTRIB(XonoticMutatorsDialog, title, string, _("Mutators"))
        ATTRIB(XonoticMutatorsDialog, color, vector, SKINCOLOR_DIALOG_MUTATORS)
        ATTRIB(XonoticMutatorsDialog, intendedWidth, float, 0.9)
        ATTRIB(XonoticMutatorsDialog, rows, float, 17)
@@ -30,9 +30,9 @@ string WeaponArenaString()
        if(s == "0")
                return "";
        if(s == "all")
-               return "All Weapons Arena";
+               return _("All Weapons Arena");
        if(s == "most")
-               return "Most Weapons Arena";
+               return _("Most Weapons Arena");
        if(s == weaponarenastring_cvar)
                return weaponarenastring;
        if(weaponarenastring)
@@ -53,7 +53,7 @@ string WeaponArenaString()
                                s = strcat(s, " & ", e.message);
                }
        }
-       s = strcat(substring(s, 3, strlen(s) - 3), " Arena");
+       s = sprintf(_("%s Arena"), substring(s, 3, strlen(s) - 3));
        
        weaponarenastring = strzone(s);
 
@@ -65,37 +65,37 @@ string XonoticMutatorsDialog_toString(entity me)
        string s;
        s = "";
        if(cvar("g_dodging"))
-               s = strcat(s, ", Dodging");
+               s = strcat(s, ", ", _("Dodging"));
        if(cvar("g_minstagib"))
-               s = strcat(s, ", MinstaGib");
+               s = strcat(s, ", ", _("MinstaGib"));
        if(cvar("g_nix"))
-               s = strcat(s, ", NIX");
+               s = strcat(s, ", ", _("NIX"));
        if(cvar("g_rocket_flying"))
-               s = strcat(s, ", Rocket Flying");
+               s = strcat(s, ", ", _("Rocket Flying"));
        if(cvar_string("g_weaponarena") != "0")
                s = strcat(s, ", ", WeaponArenaString());
        if(cvar("g_start_weapon_laser") == 0)
-               s = strcat(s, ", No start weapons");
+               s = strcat(s, ", ", _("No start weapons"));
        if(cvar("sv_gravity") < 800)
-               s = strcat(s, ", Low gravity");
+               s = strcat(s, ", ", _("Low gravity"));
        if(cvar("g_cloaked"))
-               s = strcat(s, ", Cloaked");
+               s = strcat(s, ", ", _("Cloaked"));
        if(cvar("g_grappling_hook"))
-               s = strcat(s, ", Hook");
+               s = strcat(s, ", ", _("Hook"));
        if(cvar("g_midair"))
-               s = strcat(s, ", Midair");
+               s = strcat(s, ", ", _("Midair"));
        if(cvar("g_vampire"))
-               s = strcat(s, ", Vampire");
+               s = strcat(s, ", ", _("Vampire"));
        if(cvar("g_pinata"))
-               s = strcat(s, ", Pinata");
+               s = strcat(s, ", ", _("Pinata"));
        if(cvar("g_weapon_stay"))
-               s = strcat(s, ", Weapons stay");
+               s = strcat(s, ", ", _("Weapons stay"));
        if(cvar("g_bloodloss") > 0)
-               s = strcat(s, ", Bloodloss");
+               s = strcat(s, ", ", _("Bloodloss"));
        if(cvar("g_jetpack"))
-               s = strcat(s, ", Jet pack");
+               s = strcat(s, ", ", _("Jet pack"));
        if(s == "")
-               return "None";
+               return _("None");
        else
                return substring(s, 2, strlen(s) - 2);
 }
@@ -161,23 +161,23 @@ void XonoticMutatorsDialog_fill(entity me)
        float i, j;
        string str, hstr;
        me.TR(me);
-               me.TD(me, 1, 2, makeXonoticTextLabel(0, "Gameplay mutators:"));
+               me.TD(me, 1, 2, makeXonoticTextLabel(0, _("Gameplay mutators:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_dodging", "Dodging"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_dodging", _("Dodging")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_cloaked", "Cloaked"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_cloaked", _("Cloaked")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_midair", "Midair"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_midair", _("Midair")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_vampire", "Vampire"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_vampire", _("Vampire")));
        me.TR(me);
                me.TDempty(me, 0.2);
                s = makeXonoticSlider(10, 50, 1, "g_bloodloss");
-               me.TD(me, 1, 2, e = makeXonoticSliderCheckBox(0, 1, s, "Blood loss"));
+               me.TD(me, 1, 2, e = makeXonoticSliderCheckBox(0, 1, s, _("Blood loss")));
        me.TR(me);
                me.TDempty(me, 0.4);
                me.TD(me, 1, 1.8, s);
@@ -186,36 +186,36 @@ void XonoticMutatorsDialog_fill(entity me)
                s = makeXonoticSlider(80, 400, 8, "sv_gravity");
                        s.valueDigits = 0;
                        s.valueDisplayMultiplier = 0.125; // show gravity in percent
-               me.TD(me, 1, 2, e = makeXonoticSliderCheckBox(800, 1, s, "Low gravity"));
+               me.TD(me, 1, 2, e = makeXonoticSliderCheckBox(800, 1, s, _("Low gravity")));
                        e.savedValue = 200; // good on silvercity
        me.TR(me);
                me.TDempty(me, 0.4);
                me.TD(me, 1, 1.8, s);
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 2, makeXonoticTextLabel(0, "Weapon & item mutators:"));
+               me.TD(me, 1, 2, makeXonoticTextLabel(0, _("Weapon & item mutators:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_grappling_hook", "Grappling hook"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_grappling_hook", _("Grappling hook")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_jetpack", "Jet pack"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_jetpack", _("Jet pack")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_rocket_flying", "Rocket Flying"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_rocket_flying", _("Rocket Flying")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_pinata", "Pinata"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "g_pinata", _("Pinata")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticCheckBoxEx(2, 0, "g_weapon_stay", "Weapons stay"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBoxEx(2, 0, "g_weapon_stay", _("Weapons stay")));
        me.TR(me);
 
        me.gotoRC(me, 0, 2); me.setFirstColumn(me, me.currentColumn);
-               me.TD(me, 1, 4, makeXonoticTextLabel(0, "Weapon arenas:"));
+               me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Weapon arenas:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, string_null, string_null, "Regular (no arena)"));
+               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, string_null, string_null, _("Regular (no arena)")));
        for(i = WEP_FIRST, j = 0; i <= WEP_LAST; ++i)
        {
                w = get_weaponinfo(i);
@@ -236,7 +236,7 @@ void XonoticMutatorsDialog_fill(entity me)
        }
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "menu_weaponarena_with_laser", "with laser"));
+               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "menu_weaponarena_with_laser", _("with laser")));
                        // hook the draw function to gray it out
                        e.draw_weaponarena = e.draw;
                        e.draw = preDrawLaserWeaponArenaLaserButton;
@@ -244,29 +244,29 @@ void XonoticMutatorsDialog_fill(entity me)
                        e.saveCvars_weaponarena = e.saveCvars;
                        e.saveCvars = saveCvarsLaserWeaponArenaLaserButton;
        me.TR(me);
-               me.TD(me, 1, 4, makeXonoticTextLabel(0, "Special arenas:"));
+               me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Special arenas:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_minstagib", string_null, "MinstaGib"));
+               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_minstagib", string_null, _("MinstaGib")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_nix", string_null, "NIX"));
+               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_nix", string_null, _("NIX")));
        me.TR(me);
                me.TDempty(me, 0.4);
-               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "g_nix_with_laser", "with laser"));
+               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "g_nix_with_laser", _("with laser")));
                        setDependent(e, "g_nix", 1, 1);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_weaponarena", "most", "Most weapons"));
+               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_weaponarena", "most", _("Most weapons")));
                        e.cvarOffValue = "0";
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_start_weapon_laser", "0", "No start weapons"));
+               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "g_start_weapon_laser", "0", _("No start weapons")));
                        e.cvarOffValue = "-1";
-                       makeMulti(e, "g_start_weapon_shotgun g_start_weapon_uzi g_start_weapon_grenadelauncher g_start_weapon_minelayer g_start_weapon_electro g_start_weapon_crylink g_start_weapon_nex g_start_weapon_hagar g_start_weapon_rocketlauncher g_start_weapon_campingrifle g_start_weapon_hlac g_start_weapon_seeker g_start_weapon_minstanex g_start_weapon_hook g_start_weapon_porto g_start_weapon_tuba");
+                       makeMulti(e, "g_start_weapon_shotgun g_start_weapon_uzi g_start_weapon_grenadelauncher g_start_weapon_minelayer g_start_weapon_electro g_start_weapon_crylink g_start_weapon_nex g_start_weapon_hagar g_start_weapon_rocketlauncher g_start_weapon_sniperrifle g_start_weapon_hlac g_start_weapon_seeker g_start_weapon_minstanex g_start_weapon_hook g_start_weapon_porto g_start_weapon_tuba g_start_weapon_minelayer");
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("OK", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index ec57b7fca809ec5e917f1bceafc6d82e59bf07c5..85171e094099818a2fc3f93b5fc359368dad932f 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticDemoBrowserTab) EXTENDS(XonoticTab)
        METHOD(XonoticDemoBrowserTab, fill, void(entity))
-       ATTRIB(XonoticDemoBrowserTab, title, string, "Demo")
+       ATTRIB(XonoticDemoBrowserTab, title, string, _("Demo"))
        ATTRIB(XonoticDemoBrowserTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticDemoBrowserTab, rows, float, 22)
        ATTRIB(XonoticDemoBrowserTab, columns, float, 6.5)
@@ -25,12 +25,12 @@ void XonoticDemoBrowserTab_fill(entity me)
        entity dlist;
 
        me.TR(me);
-               me.TD(me, 1, me.columns, e = makeXonoticCheckBox(0, "cl_autodemo", "Record demos while playing"));
+               me.TD(me, 1, me.columns, e = makeXonoticCheckBox(0, "cl_autodemo", _("Record demos while playing")));
        me.TR(me);
        dlist = makeXonoticDemoList();
        me.TR(me);
-               me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, "Filter:"));
-               me.TD(me, 1, 0.5, btn = makeXonoticButton("Clear", '0 0 0'));
+               me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, _("Filter:")));
+               me.TD(me, 1, 0.5, btn = makeXonoticButton(_("Clear"), '0 0 0'));
                        btn.onClick = InputBox_Clear_Click;
                me.TD(me, 1, me.columns - 1, e = makeXonoticInputBox(0, string_null));
                        e.onChange = DemoList_Filter_Change;
@@ -40,10 +40,10 @@ void XonoticDemoBrowserTab_fill(entity me)
        me.TR(me);
                me.TD(me, me.rows - 4, me.columns, dlist);
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns / 2, e = makeXonoticButton("Timedemo", '0 0 0'));
+               me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Timedemo"), '0 0 0'));
                        e.onClick = TimeDemo_Click;
                        e.onClickEntity = dlist;
-               me.TD(me, 1, me.columns / 2, e = makeXonoticButton("Play", '0 0 0'));
+               me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Play"), '0 0 0'));
                        e.onClick = StartDemo_Click;
                        e.onClickEntity = dlist;
 }
index 799d33455f19f0015025c141d4e84612c01089ab..cfe1ab06611451a4253cf58b88dcb0b0849e000a 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticServerListTab) EXTENDS(XonoticTab)
        METHOD(XonoticServerListTab, fill, void(entity))
-       ATTRIB(XonoticServerListTab, title, string, "Join")
+       ATTRIB(XonoticServerListTab, title, string, _("Join"))
        ATTRIB(XonoticServerListTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticServerListTab, rows, float, 22)
        ATTRIB(XonoticServerListTab, columns, float, 6.5)
@@ -25,23 +25,23 @@ void XonoticServerListTab_fill(entity me)
        slist  = makeXonoticServerList();
 
        me.TR(me);
-               me.TD(me, 1, 0.4, e = makeXonoticTextLabel(0, "Filter:"));
-               me.TD(me, 1, 0.6, btn = makeXonoticButton("Clear", '0 0 0'));
+               me.TD(me, 1, 0.4, e = makeXonoticTextLabel(0, _("Filter:")));
+               me.TD(me, 1, 0.6, btn = makeXonoticButton(_("Clear"), '0 0 0'));
                        btn.onClick = InputBox_Clear_Click;
                me.TD(me, 1, me.columns - 0.6 * 4 - 0.4, e = makeXonoticInputBox(0, string_null));
                        e.onChange = ServerList_Filter_Change;
                        e.onChangeEntity = slist;
                        btn.onClickEntity = e;
                        slist.controlledTextbox = e;
-               me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "menu_slist_showempty", "Empty"));
+               me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "menu_slist_showempty", _("Empty")));
                        slist.filterShowEmpty = e.checked;
                        e.onClickEntity = slist;
                        e.onClick = ServerList_ShowEmpty_Click;
-               me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "menu_slist_showfull", "Full"));
+               me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "menu_slist_showfull", _("Full")));
                        slist.filterShowFull = e.checked;
                        e.onClickEntity = slist;
                        e.onClick = ServerList_ShowFull_Click;
-               me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "net_slist_pause", "Pause"));
+               me.TD(me, 1, 0.6, e = makeXonoticCheckBox(0, "net_slist_pause", _("Pause")));
 
        me.TR(me);
                me.TD(me, 1, 1, slist.sortButton1 = makeXonoticButton(string_null, '0 0 0'));
@@ -53,7 +53,7 @@ void XonoticServerListTab_fill(entity me)
                me.TD(me, me.rows - 4, me.columns, slist);
 
        me.gotoRC(me, me.rows - 2, 0);
-               me.TD(me, 1, 0.6, e = makeXonoticTextLabel(0, "Address:"));
+               me.TD(me, 1, 0.6, e = makeXonoticTextLabel(0, _("Address:")));
                me.TD(me, 1, 2.9, e = makeXonoticInputBox(0, string_null));
                        e.onEnter = ServerList_Connect_Click;
                        e.onEnterEntity = slist;
@@ -62,12 +62,12 @@ void XonoticServerListTab_fill(entity me)
                        e.onClick = ServerList_Favorite_Click;
                        e.onClickEntity = slist;
                        slist.favoriteButton = e;
-               me.TD(me, 1, 1.5, e = makeXonoticButton("Info", '0 0 0'));
+               me.TD(me, 1, 1.5, e = makeXonoticButton(_("Info"), '0 0 0'));
                        e.onClick = ServerList_Info_Click;
                        e.onClickEntity = slist;
                        slist.infoButton = e;
        me.TR(me);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("Join!", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("Join!"), '0 0 0'));
                        e.onClick = ServerList_Connect_Click;
                        e.onClickEntity = slist;
                        slist.connectButton = e;
index 5f6262cf45e5bdb508f69dd32f7117cd4b9c673e..5eaabf67acbdeb5110dad849e5f379f4bd78f0b3 100644 (file)
@@ -2,7 +2,7 @@
 CLASS(XonoticServerInfoDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticServerInfoDialog, fill, void(entity))
        METHOD(XonoticServerInfoDialog, loadServerInfo, void(entity, float))
-       ATTRIB(XonoticServerInfoDialog, title, string, "Server Information")
+       ATTRIB(XonoticServerInfoDialog, title, string, _("Server Information"))
        ATTRIB(XonoticServerInfoDialog, color, vector, SKINCOLOR_DIALOG_SERVERINFO)
        ATTRIB(XonoticServerInfoDialog, intendedWidth, float, 0.68)
        ATTRIB(XonoticServerInfoDialog, rows, float, 15)
@@ -56,8 +56,8 @@ void Join_Click(entity btn, entity me);
 #ifdef IMPLEMENTATION
 void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
 {
-       float m, pure, j;
-       string s, typestr, versionstr, numh, maxp, k, v;
+       float m, pure, j, numh, maxp;
+       string s, typestr, versionstr, k, v;
 
        if(me.currentServerName)
                strunzone(me.currentServerName);
@@ -112,8 +112,8 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
        me.cnameLabel.setText(me.cnameLabel, me.currentServerCName);
 
        pure = -1;
-       typestr = "N/A";
-       versionstr = "N/A";
+       typestr = _("N/A");
+       versionstr = _("N/A");
 
        SLIST_FIELD_QCSTATUS = gethostcacheindexforkey("qcstatus");
        s = gethostcachestring(SLIST_FIELD_QCSTATUS, i);
@@ -145,10 +145,10 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
        me.rawPlayerList.setPlayerList(me.rawPlayerList, me.currentServerPlayers);
 
        SLIST_FIELD_NUMHUMANS = gethostcacheindexforkey("numhumans");
-       numh = ftos(gethostcachenumber(SLIST_FIELD_NUMHUMANS, i));
+       numh = gethostcachenumber(SLIST_FIELD_NUMHUMANS, i);
        SLIST_FIELD_MAXPLAYERS = gethostcacheindexforkey("maxplayers");
-       maxp = ftos(gethostcachenumber(SLIST_FIELD_MAXPLAYERS, i));
-       me.currentServerNumPlayers = strzone(strcat(numh,"/",maxp));
+       maxp = gethostcachenumber(SLIST_FIELD_MAXPLAYERS, i);
+       me.currentServerNumPlayers = strzone(sprintf(_("%d/%d"), numh, maxp));
        me.numPlayersLabel.setText(me.numPlayersLabel, me.currentServerNumPlayers);
 
        SLIST_FIELD_NUMBOTS = gethostcacheindexforkey("numbots");
@@ -163,7 +163,7 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
        me.currentServerVersion = strzone(versionstr);
        me.versionLabel.setText(me.versionLabel, me.currentServerVersion);
 
-       me.currentServerPure = ((pure < 0) ? "N/A" : (pure == 0) ? "Official settings" : sprintf("%d modified settings", pure));
+       me.currentServerPure = ((pure < 0) ? "N/A" : (pure == 0) ? _("Official settings") : sprintf(_("%d modified settings"), pure));
        me.currentServerPure = strzone(me.currentServerPure);
        me.pureLabel.setText(me.pureLabel, me.currentServerPure);
 
@@ -174,13 +174,13 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
 
        s = crypto_getidfp(me.currentServerCName);
        if not(s)
-               s = "N/A";
+               s = _("N/A");
        me.currentServerID = strzone(s);
        me.idLabel.setText(me.idLabel, me.currentServerID);
 
        s = crypto_getkeyfp(me.currentServerCName);
        if not(s)
-               s = "N/A";
+               s = _("N/A");
        me.currentServerKey = strzone(s);
        me.keyLabel.setText(me.keyLabel, me.currentServerKey);
 
@@ -188,35 +188,35 @@ void XonoticServerInfoDialog_loadServerInfo(entity me, float i)
        if(s == "")
        {
                if(cvar("crypto_aeslevel") >= 3)
-                       me.currentServerEncrypt = "N/A (can't connect)";
+                       me.currentServerEncrypt = _("N/A (can't connect)");
                else
-                       me.currentServerEncrypt = "N/A";
+                       me.currentServerEncrypt = _("N/A");
        }
        else switch(stof(substring(s, 0, 1)))
        {
                case 0:
                        if(cvar("crypto_aeslevel") >= 3)
-                               me.currentServerEncrypt = "not supported (can't connect)";
+                               me.currentServerEncrypt = _("not supported (can't connect)");
                        else
-                               me.currentServerEncrypt = "not supported (won't encrypt)";
+                               me.currentServerEncrypt = _("not supported (won't encrypt)");
                        break;
                case 1:
                        if(cvar("crypto_aeslevel") >= 2)
-                               me.currentServerEncrypt = "supported (will encrypt)";
+                               me.currentServerEncrypt = _("supported (will encrypt)");
                        else
-                               me.currentServerEncrypt = "supported (won't encrypt)";
+                               me.currentServerEncrypt = _("supported (won't encrypt)");
                        break;
                case 2:
                        if(cvar("crypto_aeslevel") >= 1)
-                               me.currentServerEncrypt = "requested (will encrypt)";
+                               me.currentServerEncrypt = _("requested (will encrypt)");
                        else
-                               me.currentServerEncrypt = "requested (won't encrypt)";
+                               me.currentServerEncrypt = _("requested (won't encrypt)");
                        break;
                case 3:
                        if(cvar("crypto_aeslevel") <= 0)
-                               me.currentServerEncrypt = "required (can't connect)";
+                               me.currentServerEncrypt = _("required (can't connect)");
                        else
-                               me.currentServerEncrypt = "required (will encrypt)";
+                               me.currentServerEncrypt = _("required (will encrypt)");
                        break;
        }
        me.encryptLabel.setText(me.encryptLabel, me.currentServerEncrypt);
@@ -237,7 +237,7 @@ void XonoticServerInfoDialog_fill(entity me)
                        me.cnameLabel = e;
 
        me.TR(me);
-               me.TD(me, 1, 5.5, e = makeXonoticTextLabel(0, "Players:"));
+               me.TD(me, 1, 5.5, e = makeXonoticTextLabel(0, _("Players:")));
        me.TR(me);
                me.TD(me, me.rows - 4, 6, e = makeXonoticPlayerList());
                        me.rawPlayerList = e;
@@ -245,70 +245,70 @@ void XonoticServerInfoDialog_fill(entity me)
        me.gotoRC(me, 1, 6.25); me.setFirstColumn(me, me.currentColumn);
 
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Type:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Type:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.typeLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Map:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Map:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.mapLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Gameplay:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Gameplay:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.pureLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Players:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Players:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.numPlayersLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Bots:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Bots:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.numBotsLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Mod:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Mod:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.modLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Version:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Version:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.versionLabel = e;
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Ping:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Ping:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.pingLabel = e;
 
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "CA:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("CA:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.keyLabel = e;
 
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Key:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Key:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.idLabel = e;
 
        me.TR(me);
-               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, "Encryption:"));
+               me.TD(me, 1, 1.75, e = makeXonoticTextLabel(0, _("Encryption:")));
                me.TD(me, 1, 4.0, e = makeXonoticTextLabel(0, ""));
                        e.allowCut = 1;
                        me.encryptLabel = e;
 
        me.gotoRC(me, me.rows - 1, 0);
 
-               me.TD(me, 1, me.columns - 6, e = makeXonoticButton("Close", '0 0 0'));
+               me.TD(me, 1, me.columns - 6, e = makeXonoticButton(_("Close"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
-               me.TD(me, 1, me.columns - 6, e = makeXonoticButton("Join!", '0 0 0'));
+               me.TD(me, 1, me.columns - 6, e = makeXonoticButton(_("Join!"), '0 0 0'));
                        e.onClick = Join_Click;
                        e.onClickEntity = me;
 }
index 002cf7468a0e46dea59c5082494cd4b8224c7b41..d42c9aaa9366d0537b916bccc14c96ee15c754f3 100644 (file)
@@ -2,7 +2,7 @@
 CLASS(XonoticPlayerSettingsTab) EXTENDS(XonoticTab)
        METHOD(XonoticPlayerSettingsTab, fill, void(entity))
        METHOD(XonoticPlayerSettingsTab, draw, void(entity))
-       ATTRIB(XonoticPlayerSettingsTab, title, string, "Player Setup")
+       ATTRIB(XonoticPlayerSettingsTab, title, string, _("Player Setup"))
        ATTRIB(XonoticPlayerSettingsTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticPlayerSettingsTab, rows, float, 22)
        ATTRIB(XonoticPlayerSettingsTab, columns, float, 6.5)
@@ -37,7 +37,7 @@ void XonoticPlayerSettingsTab_fill(entity me)
        float i, r, m, n;
 
        me.TR(me);
-               me.TD(me, 1, 0.5, me.playerNameLabel = makeXonoticTextLabel(0, "Name:"));
+               me.TD(me, 1, 0.5, me.playerNameLabel = makeXonoticTextLabel(0, _("Name:")));
                        me.playerNameLabelAlpha = me.playerNameLabel.alpha;
                me.TD(me, 1, 2.5, label = makeXonoticTextLabel(0, string_null));
                        label.allowCut = 1;
@@ -46,7 +46,7 @@ void XonoticPlayerSettingsTab_fill(entity me)
        me.TR(me);
                me.TD(me, 1, 3.0, box = makeXonoticInputBox(1, "_cl_name"));
                        box.forbiddenCharacters = "\r\n\\\"$"; // don't care, isn't getting saved
-                       box.maxLength = -63; // negativ means encoded length in bytes
+                       box.maxLength = -127; // negative means encoded length in bytes
                        label.textEntity = box;
        me.TR(me);
                me.TD(me, 5, 1, e = makeXonoticColorpicker(box));
@@ -59,7 +59,7 @@ void XonoticPlayerSettingsTab_fill(entity me)
        me.TR(me);
        me.gotoRC(me, 8, 0.0);
                pms = makeXonoticPlayerModelSelector();
-               me.TD(me, 1, 0.6, e = makeXonoticTextLabel(1, "Model:"));
+               me.TD(me, 1, 0.6, e = makeXonoticTextLabel(1, _("Model:")));
                me.TD(me, 1, 0.3, e = makeXonoticButton("<<", '0 0 0'));
                        e.onClick = PlayerModelSelector_Prev_Click;
                        e.onClickEntity = pms;
@@ -84,30 +84,30 @@ void XonoticPlayerSettingsTab_fill(entity me)
                }
 
        me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Field of view:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Field of view:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(60, 130, 1, "fov"));
        me.TR(me);
                sl = makeXonoticSlider(0.45, 0.75, 0.01, "cl_bobcycle");
-               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, sl, "View bobbing:"));
+               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, sl, _("View bobbing:")));
                makeMulti(sl, "cl_bob2cycle");
                me.TD(me, 1, 2, sl);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Zoom factor:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Zoom factor:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(2, 16, 0.5, "cl_zoomfactor"));
        me.TR(me);
                sl = makeXonoticSlider(1, 8, 0.5, "cl_zoomspeed");
-               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(-1, 1, sl, "Zoom speed:"));
+               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(-1, 1, sl, _("Zoom speed:")));
                me.TD(me, 1, 2, sl);
        me.TR(me);
-               me.TD(me, 1, 1.5, e = makeXonoticButton("Weapon settings...", '0 0 0'));
+               me.TD(me, 1, 1.5, e = makeXonoticButton(_("Weapon settings..."), '0 0 0'));
                        e.onClick = DialogOpenButton_Click;
                        e.onClickEntity = main.weaponsDialog;
                me.TD(me, 1, 1.5, e0 = makeXonoticTextLabel(0, string_null));
                        e0.textEntity = main.weaponsDialog;
                        e0.allowCut = 1;
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair:"));
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "crosshair_per_weapon", "Per weapon"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair:")));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "crosshair_per_weapon", _("Per weapon")));
        me.TR(me);
                me.TDempty(me, 0.2);
                for(i = 1; i <= 10; ++i) {
@@ -126,71 +126,71 @@ void XonoticPlayerSettingsTab_fill(entity me)
                }
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair size:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair size:")));
                me.TD(me, 1, 1.8, e = makeXonoticSlider(0.10, 1.5, 0.05, "crosshair_size"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair alpha:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair alpha:")));
                me.TD(me, 1, 1.8, e = makeXonoticSlider(0, 1, 0.1, "crosshair_alpha"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Crosshair color:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Crosshair color:")));
                me.TD(me, 2, 1.8, e = makeXonoticColorpickerString("crosshair_color", "crosshair_color"));
                setDependent(e, "crosshair_color_per_weapon", 0, 0);
        me.TR(me);
                me.TDempty(me, 0.3);
-               me.TD(me, 1, 0.7, e = makeXonoticCheckBox(0, "crosshair_color_per_weapon", "Per weapon"));
+               me.TD(me, 1, 0.7, e = makeXonoticCheckBox(0, "crosshair_color_per_weapon", _("Per weapon")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", "Enable center dot"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "crosshair_dot", _("Enable center dot")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, "Size:"));
+               me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, _("Size:")));
                me.TD(me, 1, 0.9, e = makeXonoticSlider(0.2, 2, 0.1, "crosshair_dot_size"));
                        setDependent(e, "crosshair_dot", 1, 1);
-               me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, "Alpha:"));
+               me.TD(me, 1, 0.5, e = makeXonoticTextLabel(0, _("Alpha:")));
                me.TD(me, 1, 0.9, e = makeXonoticSlider(0.10, 1, 0.1, "crosshair_dot_alpha"));
                        setDependent(e, "crosshair_dot", 1, 1);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Hit test:"));
-               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(5, "crosshair_hittest", "0",    "None"));
-               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(5, "crosshair_hittest", "1",    "TrueAim"));
-               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(5, "crosshair_hittest", "1.25", "Enemies"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Hit test:")));
+               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(5, "crosshair_hittest", "0",    _("None")));
+               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(5, "crosshair_hittest", "1",    _("TrueAim")));
+               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(5, "crosshair_hittest", "1.25", _("Enemies")));
        me.TR(me);
                me.TDempty(me, 0.4);
-               me.TD(me, 1, 2.2, e = makeXonoticButton("Waypoints setup...", '0 0 0'));
+               me.TD(me, 1, 2.2, e = makeXonoticButton(_("Waypoints setup..."), '0 0 0'));
                        e.onClick = DialogOpenButton_Click;
                        e.onClickEntity = main.waypointDialog;
                me.TDempty(me, 0.5);
        me.TR(me);
                me.TDempty(me, 0.4);
-               me.TD(me, 1, 2.2, e = makeXonoticButton("Enter HUD editor", '0 0 0'));
+               me.TD(me, 1, 2.2, e = makeXonoticButton(_("Enter HUD editor"), '0 0 0'));
                        e.onClick = HUDSetup_Join_Click;
                        e.onClickEntity = me;
                me.TDempty(me, 0.5);
        me.TR(me);
        me.TR(me);
        #ifdef ALLOW_FORCEMODELS
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Force models:"));
-               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(6, string_null, string_null, "None"));
-               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(6, "cl_forceplayermodelsfromxonotic", string_null, "Custom"));
-               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(6, "cl_forceplayermodels", string_null, "All"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Force models:")));
+               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(6, string_null, string_null, _("None")));
+               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(6, "cl_forceplayermodelsfromxonotic", string_null, _("Custom")));
+               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(6, "cl_forceplayermodels", string_null, _("All")));
        #endif
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_gentle", "Disable gore effects"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_gentle", _("Disable gore effects")));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Gibs:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gibs:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_nogibs"));
-                       e.addValue(e, "None", "1");
-                       e.addValue(e, "Few", "0.75");
-                       e.addValue(e, "Many", "0.5");
-                       e.addValue(e, "Lots", "0");
+                       e.addValue(e, _("None"), "1");
+                       e.addValue(e, _("Few"), "0.75");
+                       e.addValue(e, _("Many"), "0.5");
+                       e.addValue(e, _("Lots"), "0");
                        e.configureXonoticTextSliderValues(e);
                        setDependent(e, "cl_gentle", 0, 0);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Damage splash:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Damage splash:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(0, 1, 0.05, "hud_damage"));
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, makeXonoticCommandButton("Apply immediately", '0 0 0', "color -1 -1;name \"$_cl_name\";cl_cmd sendcvar cl_weaponpriority;sendcvar cl_zoomfactor;sendcvar cl_zoomspeed;sendcvar cl_autoswitch;sendcvar cl_shownames;sendcvar cl_forceplayermodelsfromxonotic;sendcvar cl_forceplayermodels;playermodel $_cl_playermodel;playerskin $_cl_playerskin", COMMANDBUTTON_APPLY));
+               me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "color -1 -1;name \"$_cl_name\";cl_cmd sendcvar cl_weaponpriority;sendcvar cl_zoomfactor;sendcvar cl_zoomspeed;sendcvar cl_autoswitch;sendcvar cl_shownames;sendcvar cl_forceplayermodelsfromxonotic;sendcvar cl_forceplayermodels;playermodel $_cl_playermodel;playerskin $_cl_playerskin", COMMANDBUTTON_APPLY));
 }
 void HUDSetup_Join_Click(entity me, entity btn)
 {
index dcc6a64f3681652d777d6fcf090ccf9779b60059..470fc678522c6a4f49decbdd864252512119d8d0 100644 (file)
@@ -1,9 +1,8 @@
 #ifdef INTERFACE
 CLASS(XonoticWaypointDialog) EXTENDS(XonoticDialog)
-       METHOD(XonoticWaypointDialog, toString, string(entity))
        METHOD(XonoticWaypointDialog, fill, void(entity))
        METHOD(XonoticWaypointDialog, showNotify, void(entity))
-       ATTRIB(XonoticWaypointDialog, title, string, "Waypoints")
+       ATTRIB(XonoticWaypointDialog, title, string, _("Waypoints"))
        ATTRIB(XonoticWaypointDialog, color, vector, SKINCOLOR_DIALOG_RADAR)
        ATTRIB(XonoticWaypointDialog, intendedWidth, float, 0.7)
        ATTRIB(XonoticWaypointDialog, rows, float, 6)
@@ -16,39 +15,35 @@ void XonoticWaypointDialog_showNotify(entity me)
 {
         loadAllCvars(me);
 }
-string XonoticWaypointDialog_toString(entity me)
-{
-       return "XXX";
-}
 void XonoticWaypointDialog_fill(entity me)
 {
        entity e;
        
        me.TR(me);
-               me.TD(me, 1, 4, makeXonoticTextLabel(0, "Waypoint settings:"));
+               me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Waypoint settings:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(1, "cl_hidewaypoints", "Show base waypoints"));
+               me.TD(me, 1, 3.8, e = makeXonoticCheckBox(1, "cl_hidewaypoints", _("Show base waypoints")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Waypoint scale:"));
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Waypoint scale:")));
                        me.TD(me, 1, 3, e = makeXonoticSlider(0.5, 1.5, 0.01, "g_waypointsprite_scale"));
                                setDependent(e, "cl_hidewaypoints", 0, 0);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Waypoint alpha:"));
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Waypoint alpha:")));
                        me.TD(me, 1, 3, e = makeXonoticSlider(0.1, 1, 0.01, "g_waypointsprite_alpha"));
                                setDependent(e, "cl_hidewaypoints", 0, 0);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Show names:"));
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Show names:")));
                me.TD(me, 1, 3, e = makeXonoticTextSlider("cl_shownames"));
-                       e.addValue(e, "Never", "0");
-                       e.addValue(e, "Teammates", "1");
-                       e.addValue(e, "All players", "2");
+                       e.addValue(e, _("Never"), "0");
+                       e.addValue(e, _("Teammates"), "1");
+                       e.addValue(e, _("All players"), "2");
                        e.configureXonoticTextSliderValues(e);
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("OK", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index ca6d705c6fd68df9a85226533dd8573c9601faa5..ed5802a972d5dfcbd6ccef2671a412b821df8d44 100644 (file)
@@ -3,7 +3,7 @@ CLASS(XonoticWeaponsDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticWeaponsDialog, toString, string(entity))
        METHOD(XonoticWeaponsDialog, fill, void(entity))
        METHOD(XonoticWeaponsDialog, showNotify, void(entity))
-       ATTRIB(XonoticWeaponsDialog, title, string, "Weapon settings")
+       ATTRIB(XonoticWeaponsDialog, title, string, _("Weapon settings"))
        ATTRIB(XonoticWeaponsDialog, color, vector, SKINCOLOR_DIALOG_WEAPONS)
        ATTRIB(XonoticWeaponsDialog, intendedWidth, float, 0.5)
        ATTRIB(XonoticWeaponsDialog, rows, float, 17)
@@ -26,33 +26,33 @@ void XonoticWeaponsDialog_fill(entity me)
        entity e;
 
        me.TR(me);
-               me.TD(me, 1, 4, makeXonoticTextLabel(0, "Weapon priority list:"));
+               me.TD(me, 1, 4, makeXonoticTextLabel(0, _("Weapon priority list:")));
        me.TR(me);
                me.TD(me, 9, 4, e = me.weaponsList = makeXonoticWeaponsList());
        me.gotoRC(me, 10, 0);
                me.TDempty(me, 1);
-               me.TD(me, 1, 1, e = makeXonoticButton("Up", '0 0 0'));
+               me.TD(me, 1, 1, e = makeXonoticButton(_("Up"), '0 0 0'));
                        e.onClick = WeaponsList_MoveUp_Click;
                        e.onClickEntity = me.weaponsList;
-               me.TD(me, 1, 1, e = makeXonoticButton("Down", '0 0 0'));
+               me.TD(me, 1, 1, e = makeXonoticButton(_("Down"), '0 0 0'));
                        e.onClick = WeaponsList_MoveDown_Click;
                        e.onClickEntity = me.weaponsList;
        me.gotoRC(me, 11, 0);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_weaponpriority_useforcycling", "Use priority list for weapon cycling"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_weaponpriority_useforcycling", _("Use priority list for weapon cycling")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_autoswitch", "Auto switch weapons on pickup"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_autoswitch", _("Auto switch weapons on pickup")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "r_drawviewmodel", "Draw 1st person weapon model"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "r_drawviewmodel", _("Draw 1st person weapon model")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_gunalign", "4", "Left align"));
+               me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_gunalign", "4", _("Left align")));
                        setDependent(e, "r_drawviewmodel", 1, 1);
-               me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_gunalign", "3", "Right align"));
+               me.TD(me, 1, 1, e = makeXonoticRadioButton(1, "cl_gunalign", "3", _("Right align")));
                        setDependent(e, "r_drawviewmodel", 1, 1);
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "v_flipped", "Flip view horizontally"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "v_flipped", _("Flip view horizontally")));
        me.TR(me);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("OK", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index cfe91afceece6fe5e7ca8c57dc7fe2877203ece5..f638c770d1365cb9037a7c5d02669ae9779fd260 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticNewsDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticNewsDialog, fill, void(entity))
-       ATTRIB(XonoticNewsDialog, title, string, "News")
+       ATTRIB(XonoticNewsDialog, title, string, _("News"))
        ATTRIB(XonoticNewsDialog, color, vector, SKINCOLOR_DIALOG_SETTINGS)
        ATTRIB(XonoticNewsDialog, intendedWidth, float, 0.96)
        ATTRIB(XonoticNewsDialog, rows, float, 24)
@@ -15,6 +15,6 @@ void XonoticNewsDialog_fill(entity me)
        entity e;
        me.TR(me);
                me.TD(me, 24, 1, e = spawnGecko());
-               e.configureBrowser( e, "http://alientrap.org/xonotic/index.php?module=news" );
+               e.configureBrowser( e, _("http://www.xonotic.org/team/blog/") );
 }
 #endif
index 0229e026766d4037daa76339c003a3e910f4a80f..6d9dde47b30d80dd2be57c1b396dde04e13f192f 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticQuitDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticQuitDialog, fill, void(entity))
-       ATTRIB(XonoticQuitDialog, title, string, "Quit")
+       ATTRIB(XonoticQuitDialog, title, string, _("Quit"))
        ATTRIB(XonoticQuitDialog, color, vector, SKINCOLOR_DIALOG_QUIT)
        ATTRIB(XonoticQuitDialog, intendedWidth, float, 0.5)
        ATTRIB(XonoticQuitDialog, rows, float, 3)
@@ -14,11 +14,11 @@ void XonoticQuitDialog_fill(entity me)
 {
        entity e;
        me.TR(me);
-               me.TD(me, 1, 2, makeXonoticTextLabel(0.5, "Are you sure you want to quit?"));
+               me.TD(me, 1, 2, makeXonoticTextLabel(0.5, _("Are you sure you want to quit?")));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticCommandButton("Yes", '1 0 0', "quit", 0));
-               me.TD(me, 1, 1, e = makeXonoticButton("No", '0 1 0'));
+               me.TD(me, 1, 1, e = makeXonoticCommandButton(_("Yes"), '1 0 0', "quit", 0));
+               me.TD(me, 1, 1, e = makeXonoticButton(_("No"), '0 1 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index 1f19bf656531e1bc26d27d9f49e487ec5395515e..1f084a16cc0e9600cc4743626a9b8789a8c4d157 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticSettingsDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticSettingsDialog, fill, void(entity))
-       ATTRIB(XonoticSettingsDialog, title, string, "Settings")
+       ATTRIB(XonoticSettingsDialog, title, string, _("Settings"))
        ATTRIB(XonoticSettingsDialog, color, vector, SKINCOLOR_DIALOG_SETTINGS)
        ATTRIB(XonoticSettingsDialog, intendedWidth, float, 0.96)
        ATTRIB(XonoticSettingsDialog, rows, float, 19)
@@ -15,12 +15,12 @@ void XonoticSettingsDialog_fill(entity me)
        entity mc;
        mc = makeXonoticTabController(me.rows - 2);
        me.TR(me);
-               me.TD(me, 1, 1, mc.makeTabButton(mc, "Input",   makeXonoticInputSettingsTab()));
-               me.TD(me, 1, 1, mc.makeTabButton(mc, "Video",   makeXonoticVideoSettingsTab()));
-               me.TD(me, 1, 1, mc.makeTabButton(mc, "Effects", makeXonoticEffectsSettingsTab()));
-               me.TD(me, 1, 1, mc.makeTabButton(mc, "Audio",   makeXonoticAudioSettingsTab()));
-               me.TD(me, 1, 1, mc.makeTabButton(mc, "Network", makeXonoticNetworkSettingsTab()));
-               me.TD(me, 1, 1, mc.makeTabButton(mc, "Misc",    makeXonoticMiscSettingsTab()));
+               me.TD(me, 1, 1, mc.makeTabButton(mc, _("Input"),   makeXonoticInputSettingsTab()));
+               me.TD(me, 1, 1, mc.makeTabButton(mc, _("Video"),   makeXonoticVideoSettingsTab()));
+               me.TD(me, 1, 1, mc.makeTabButton(mc, _("Effects"), makeXonoticEffectsSettingsTab()));
+               me.TD(me, 1, 1, mc.makeTabButton(mc, _("Audio"),   makeXonoticAudioSettingsTab()));
+               me.TD(me, 1, 1, mc.makeTabButton(mc, _("Network"), makeXonoticNetworkSettingsTab()));
+               me.TD(me, 1, 1, mc.makeTabButton(mc, _("Misc"),    makeXonoticMiscSettingsTab()));
        me.TR(me);
        me.TR(me);
                me.TD(me, me.rows - 2, me.columns, mc);
index ddde45d2b8706199d98841aa3a5c336d9774c98e..6f9dfce6de4a36e2f3086bcb1ad8d93fd722a0b1 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticAudioSettingsTab) EXTENDS(XonoticTab)
        METHOD(XonoticAudioSettingsTab, fill, void(entity))
-       ATTRIB(XonoticAudioSettingsTab, title, string, "Audio")
+       ATTRIB(XonoticAudioSettingsTab, title, string, _("Audio"))
        ATTRIB(XonoticAudioSettingsTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticAudioSettingsTab, rows, float, 17)
        ATTRIB(XonoticAudioSettingsTab, columns, float, 6.5)
@@ -24,155 +24,155 @@ void XonoticAudioSettingsTab_fill(entity me)
 
        me.TR(me);
                s = makeXonoticDecibelsSlider(-20, 0, 0.5, "mastervolume");
-               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(-1000000, 1, s, "Master:"));
+               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Master:")));
                me.TD(me, 1, 2, s);
        me.TR(me);
                me.TDempty(me, 0.2);
                s = makeXonoticDecibelsSlider(-20, 0, 0.5, "bgmvolume");
                makeMulti(s, "snd_csqcchannel2volume");
-               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, "Music:"));
+               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Music:")));
                me.TD(me, 1, 2, s);
        me.TR(me);
                me.TDempty(me, 0.2);
                s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_staticvolume");
-               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, "Ambient:"));
+               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Ambient:")));
                makeMulti(s, "snd_entchannel2volume");
                me.TD(me, 1, 2, s);
                setDependentStringNotEqual(e, "volume", "0");
-               setDependentStringNotEqual(s, "volume", "0");
+               setDependentStringNotEqual(e, "mastervolume", "0");
        me.TR(me);
                me.TDempty(me, 0.2);
                s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_worldchannel0volume");
-               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, "Info:"));
+               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Info:")));
                makeMulti(s, "snd_csqcchannel0volume");
                me.TD(me, 1, 2, s);
                setDependentStringNotEqual(e, "volume", "0");
-               setDependentStringNotEqual(s, "volume", "0");
+               setDependentStringNotEqual(e, "mastervolume", "0");
        me.TR(me);
                me.TDempty(me, 0.2);
                s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_entchannel3volume");
                makeMulti(s, "snd_playerchannel0volume snd_playerchannel3volume snd_csqcchannel3volume");
-               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, "Items:"));
+               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Items:")));
                me.TD(me, 1, 2, s);
-               setDependentStringNotEqual(e, "volume", "0");
                setDependentStringNotEqual(s, "volume", "0");
+               setDependentStringNotEqual(e, "mastervolume", "0");
        me.TR(me);
                me.TDempty(me, 0.2);
                s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_playerchannel6volume");
                makeMulti(s, "snd_csqcchannel6volume");
-               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, "Pain:"));
+               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Pain:")));
                me.TD(me, 1, 2, s);
                setDependentStringNotEqual(e, "volume", "0");
-               setDependentStringNotEqual(s, "volume", "0");
+               setDependentStringNotEqual(e, "mastervolume", "0");
        me.TR(me);
                me.TDempty(me, 0.2);
                s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_playerchannel7volume");
                makeMulti(s, "snd_entchannel7volume");
-               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, "Player:"));
+               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Player:")));
                me.TD(me, 1, 2, s);
-               setDependentStringNotEqual(e, "volume", "0");
                setDependentStringNotEqual(s, "volume", "0");
+               setDependentStringNotEqual(e, "mastervolume", "0");
        me.TR(me);
                me.TDempty(me, 0.2);
                s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_entchannel4volume");
                makeMulti(s, "snd_playerchannel4volume snd_entchannel6volume snd_csqcchannel4volume");
-               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, "Shots:"));
+               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Shots:")));
                me.TD(me, 1, 2, s);
                setDependentStringNotEqual(e, "volume", "0");
-               setDependentStringNotEqual(s, "volume", "0");
+               setDependentStringNotEqual(s, "mastervolume", "0");
        me.TR(me);
                me.TDempty(me, 0.2);
                s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_playerchannel2volume");
-               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, "Voice:"));
+               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Voice:")));
                me.TD(me, 1, 2, s);
                setDependentStringNotEqual(e, "volume", "0");
-               setDependentStringNotEqual(s, "volume", "0");
+               setDependentStringNotEqual(s, "mastervolume", "0");
        me.TR(me);
                me.TDempty(me, 0.2);
                s = makeXonoticDecibelsSlider(-20, 0, 0.5, "snd_playerchannel1volume");
                makeMulti(s, "snd_playerchannel5volume snd_entchannel1volume snd_entchannel5volume");
-               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, "Weapons:"));
+               me.TD(me, 1, 0.8, e = makeXonoticSliderCheckBox(-1000000, 1, s, _("Weapons:")));
                me.TD(me, 1, 2, s);
                setDependentStringNotEqual(e, "volume", "0");
-               setDependentStringNotEqual(s, "volume", "0");
+               setDependentStringNotEqual(s, "mastervolume", "0");
        me.TR(me);
 
        me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Frequency:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Frequency:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("snd_speed"));
-                       e.addValue(e, "8 kHz", "8000");
-                       e.addValue(e, "11.025 kHz", "11025");
-                       e.addValue(e, "16 kHz", "16000");
-                       e.addValue(e, "22.05 kHz", "22050");
-                       e.addValue(e, "24 kHz", "24000");
-                       e.addValue(e, "32 kHz", "32000");
-                       e.addValue(e, "44.1 kHz", "44100");
-                       e.addValue(e, "48 kHz", "48000");
+                       e.addValue(e, _("8 kHz"), "8000");
+                       e.addValue(e, _("11.025 kHz"), "11025");
+                       e.addValue(e, _("16 kHz"), "16000");
+                       e.addValue(e, _("22.05 kHz"), "22050");
+                       e.addValue(e, _("24 kHz"), "24000");
+                       e.addValue(e, _("32 kHz"), "32000");
+                       e.addValue(e, _("44.1 kHz"), "44100");
+                       e.addValue(e, _("48 kHz"), "48000");
                        e.configureXonoticTextSliderValues(e);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Channels:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Channels:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("snd_channels"));
-                       e.addValue(e, "Mono", "1");
-                       e.addValue(e, "Stereo", "2");
-                       e.addValue(e, "2.1", "3");
-                       e.addValue(e, "3.1", "4");
-                       e.addValue(e, "4.1", "5");
-                       e.addValue(e, "5.1", "6");
-                       e.addValue(e, "6.1", "7");
-                       e.addValue(e, "7.1", "8");
+                       e.addValue(e, _("Mono"), "1");
+                       e.addValue(e, _("Stereo"), "2");
+                       e.addValue(e, _("2.1"), "3");
+                       e.addValue(e, _("4"), "4");
+                       e.addValue(e, _("5"), "5");
+                       e.addValue(e, _("5.1"), "6");
+                       e.addValue(e, _("6.1"), "7");
+                       e.addValue(e, _("7.1"), "8");
                        e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "snd_swapstereo", "Swap Stereo"));
+               me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "snd_swapstereo", _("Swap Stereo")));
                setDependent(e, "snd_channels", 1.5, 0.5);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "snd_spatialization_control", "Headphone friendly mode"));
+               me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "snd_spatialization_control", _("Headphone friendly mode")));
                setDependent(e, "snd_channels", 1.5, 0.5);
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Spatial voices:"));
-               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "cl_voice_directional", "0", "None"));
-               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "cl_voice_directional", "2", "Taunts"));
-               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "cl_voice_directional", "1", "All"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Spatial voices:")));
+               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "cl_voice_directional", "0", _("None")));
+               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "cl_voice_directional", "2", _("Taunts")));
+               me.TD(me, 1, 2/3, e = makeXonoticRadioButton(1, "cl_voice_directional", "1", _("All")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Taunt range:"));
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Taunt range:")));
                setDependent(e, "cl_voice_directional", 0.5, -0.5);
                me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_voice_directional_taunt_attenuation"));
-                       e.addValue(e, "Very short", "3");
-                       e.addValue(e, "Short", "2");
-                       e.addValue(e, "Normal", "0.5");
-                       e.addValue(e, "Long", "0.25");
-                       e.addValue(e, "Full", "0.015625");
+                       e.addValue(e, _("Very short"), "3");
+                       e.addValue(e, _("Short"), "2");
+                       e.addValue(e, _("Normal"), "0.5");
+                       e.addValue(e, _("Long"), "0.25");
+                       e.addValue(e, _("Full"), "0.015625");
                        e.configureXonoticTextSliderValues(e);
                setDependent(e, "cl_voice_directional", 0.5, -0.5);
        me.TR(me);
                sl = makeXonoticSlider(0.15, 1, 0.05, "cl_autotaunt");
                        sl.valueDisplayMultiplier = 100;
                        sl.valueDigits = 0;
-               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, sl, "Automatic taunts"));
+               me.TD(me, 1, 3, e = makeXonoticSliderCheckBox(0, 1, sl, _("Automatic taunts")));
                if(sl.value != e.savedValue)
                        e.savedValue = 0.65; // default
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Frequency:"));
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Frequency:")));
                me.TD(me, 1, 2, sl);
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Time warning:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Time warning:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("cl_sound_maptime_warning"));
-                       e.addValue(e, "None", "0");
-                       e.addValue(e, "1 minute", "1");
-                       e.addValue(e, "5 minutes", "2");
-                       e.addValue(e, "Both", "3");
+                       e.addValue(e, _("None"), "0");
+                       e.addValue(e, _("1 minute"), "1");
+                       e.addValue(e, _("5 minutes"), "2");
+                       e.addValue(e, _("Both"), "3");
                        e.configureXonoticTextSliderValues(e);
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_hitsound", "Hit indicator"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_hitsound", _("Hit indicator")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 0, "menu_sounds", "Menu sounds"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 0, "menu_sounds", _("Menu sounds")));
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, makeXonoticCommandButton("Apply immediately", '0 0 0', "snd_restart; sendcvar cl_hitsound; sendcvar cl_autotaunt; sendcvar cl_voice_directional; sendcvar cl_voice_directional_taunt_attenuation", COMMANDBUTTON_APPLY));
+               me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "snd_restart; sendcvar cl_hitsound; sendcvar cl_autotaunt; sendcvar cl_voice_directional; sendcvar cl_voice_directional_taunt_attenuation", COMMANDBUTTON_APPLY));
 }
 #endif
index cd108f0be99679bac91121dcb170f5f430f127fd..c6f65f11b76156dbdb132ed35bc7e763a6ddfb38 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticEffectsSettingsTab) EXTENDS(XonoticTab)
        METHOD(XonoticEffectsSettingsTab, fill, void(entity))
-       ATTRIB(XonoticEffectsSettingsTab, title, string, "Effects")
+       ATTRIB(XonoticEffectsSettingsTab, title, string, _("Effects"))
        ATTRIB(XonoticEffectsSettingsTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticEffectsSettingsTab, rows, float, 17)
        ATTRIB(XonoticEffectsSettingsTab, columns, float, 6.5)
@@ -35,47 +35,47 @@ void XonoticEffectsSettingsTab_fill(entity me)
        entity e, s;
        float n;
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Quality preset:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Quality preset:")));
                n = 5 + 2 * !!cvar("developer");
                if(cvar("developer"))
-                       me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton("OMG!", '1 0 1', "exec effects-omg.cfg", 0));
-               me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton("Low", '0 0 0', "exec effects-low.cfg", 0));
-               me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton("Medium", '0 0 0', "exec effects-med.cfg", 0));
-               me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton("Normal", '0 0 0', "exec effects-normal.cfg", 0));
-               me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton("High", '0 0 0', "exec effects-high.cfg", 0));
-               me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton("Ultra", '0 0 0', "exec effects-ultra.cfg", 0));
+                       me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton(_("OMG!"), '1 0 1', "exec effects-omg.cfg", 0));
+               me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton(_("Low"), '0 0 0', "exec effects-low.cfg", 0));
+               me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton(_("Medium"), '0 0 0', "exec effects-med.cfg", 0));
+               me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton(_("Normal"), '0 0 0', "exec effects-normal.cfg", 0));
+               me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton(_("High"), '0 0 0', "exec effects-high.cfg", 0));
+               me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton(_("Ultra"), '0 0 0', "exec effects-ultra.cfg", 0));
                if(cvar("developer"))
-                       me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton("Ultimate", '0 0 0', "exec effects-ultimate.cfg", 0));
+                       me.TD(me, 1, 5.5 / n, e = makeXonoticCommandButton(_("Ultimate"), '0 0 0', "exec effects-ultimate.cfg", 0));
 
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Geometry detail:"));
+               me.TD(me, 1, 1.1, e = makeXonoticTextLabel(0, _("Geometry detail:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("r_subdivisions_tolerance"));
-                       e.addValue(e, "Lowest", "16");
-                       e.addValue(e, "Low", "8");
-                       e.addValue(e, "Normal", "4");
-                       e.addValue(e, "Good", "3");
-                       e.addValue(e, "Best", "2");
-                       e.addValue(e, "Insane", "1");
+                       e.addValue(e, _("Lowest"), "16");
+                       e.addValue(e, _("Low"), "8");
+                       e.addValue(e, _("Normal"), "4");
+                       e.addValue(e, _("Good"), "3");
+                       e.addValue(e, _("Best"), "2");
+                       e.addValue(e, _("Insane"), "1");
                        e.configureXonoticTextSliderValues(e);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Antialiasing:"));
+               me.TD(me, 1, 1.1, e = makeXonoticTextLabel(0, _("Antialiasing:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("vid_samples"));
-                       e.addValue(e, "Disabled", "1");
-                       e.addValue(e, "2x", "2");
-                       e.addValue(e, "4x", "4");
+                       e.addValue(e, _("Disabled"), "1");
+                       e.addValue(e, _("2x"), "2");
+                       e.addValue(e, _("4x"), "4");
                        e.configureXonoticTextSliderValues(e);
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Texture resolution:"));
+               me.TD(me, 1, 1.1, e = makeXonoticTextLabel(0, _("Texture resolution:")));
                me.TD(me, 1, 2, e = makeXonoticPicmipSlider());
                        if(cvar("developer"))
-                               e.addValue(e, "Leet", "1337");
-                       e.addValue(e, "Lowest", "2");
-                       e.addValue(e, "Low", "1");
-                       e.addValue(e, "Normal", "0");
-                       e.addValue(e, "Good", "-1");
-                       e.addValue(e, "Best", "-2");
+                               e.addValue(e, _("Leet"), "1337");
+                       e.addValue(e, _("Lowest"), "2");
+                       e.addValue(e, _("Low"), "1");
+                       e.addValue(e, _("Normal"), "0");
+                       e.addValue(e, _("Good"), "-1");
+                       e.addValue(e, _("Best"), "-2");
                        e.configureXonoticTextSliderValues(e);
        me.TR(me);
                me.TDempty(me, 0.2);
@@ -88,108 +88,108 @@ void XonoticEffectsSettingsTab_fill(entity me)
                                case 0:
                                        break;
                                case 1:
-                                       me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", "Avoid lossy texture compression"));
+                                       me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
                                        break;
                                case 2:
-                                       me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", "Avoid lossy texture compression"));
+                                       me.TD(me, 1, 2.8, e = makeXonoticCheckBox(1, "r_texture_dds_load", _("Avoid lossy texture compression")));
                                                makeMulti(e, "gl_texturecompression");
                                        break;
                        }
                }
        me.TR(me);
-       me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Anisotropy:"));
+       me.TD(me, 1, 1.1, e = makeXonoticTextLabel(0, _("Anisotropy:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("gl_texture_anisotropy"));
-                       e.addValue(e, "Disabled", "1");
-                       e.addValue(e, "2x", "2");
-                       e.addValue(e, "4x", "4");
-                       e.addValue(e, "8x", "8");
-                       e.addValue(e, "16x", "16");
+                       e.addValue(e, _("Disabled"), "1");
+                       e.addValue(e, _("2x"), "2");
+                       e.addValue(e, _("4x"), "4");
+                       e.addValue(e, _("8x"), "8");
+                       e.addValue(e, _("16x"), "16");
                        e.configureXonoticTextSliderValues(e);
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Particle quality:"));
+               me.TD(me, 1, 1.1, e = makeXonoticTextLabel(0, _("Particle quality:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(0.2, 1.0, 0.1, "cl_particles_quality"));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Particle dist.:"));
+               me.TD(me, 1, 1.1, e = makeXonoticTextLabel(0, _("Particle distance:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(500, 2000, 100, "r_drawparticles_drawdistance"));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_decals", "Decals"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_decals", _("Decals")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Distance:"));
+               me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Distance:")));
                        setDependent(e, "cl_decals", 1, 1);
                me.TD(me, 1, 2, e = makeXonoticSlider(200, 500, 20, "r_drawdecals_drawdistance"));
                        setDependent(e, "cl_decals", 1, 1);
        me.TR(me);
                me.TDempty(me, 0.2);
-           me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Time:"));
+           me.TD(me, 1, 0.9, e = makeXonoticTextLabel(0, _("Time:")));
                setDependent(e, "cl_decals", 1, 1);
            me.TD(me, 1, 2, e = makeXonoticSlider(1, 20, 1, "cl_decals_time"));
                setDependent(e, "cl_decals", 1, 1);
 
        me.gotoRC(me, 2, 3.5); me.setFirstColumn(me, me.currentColumn);
-       me.TD(me, 1, 2, e = makeXonoticCheckBox(1, "mod_q3bsp_nolightmaps", "Use lightmaps"));
-       me.TD(me, 1, 1.9, e = makeXonoticCheckBox(0, "r_glsl_deluxemapping", "Deluxe mapping"));
+       me.TD(me, 1, 2, e = makeXonoticCheckBox(1, "mod_q3bsp_nolightmaps", _("Use lightmaps")));
+       me.TD(me, 1, 1.9, e = makeXonoticCheckBox(0, "r_glsl_deluxemapping", _("Deluxe mapping")));
                setDependentAND(e, "vid_gl20", 1, 1, "mod_q3bsp_nolightmaps", 0, 0);
-       me.TD(me, 1, 0.7, e = makeXonoticCheckBox(0, "r_shadow_gloss", "Gloss"));
+       me.TD(me, 1, 0.7, e = makeXonoticCheckBox(0, "r_shadow_gloss", _("Gloss")));
                setDependentAND3(e, "vid_gl20", 1, 1, "r_glsl_deluxemapping", 1, 2, "mod_q3bsp_nolightmaps", 0, 0);
        me.TR(me);
-               me.TD(me, 1, 1.5, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping", "Offset mapping"));
+               me.TD(me, 1, 1.5, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping", _("Offset mapping")));
                        setDependent(e, "vid_gl20", 1, 1);
-               me.TD(me, 1, 1.9, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping_reliefmapping", "Relief mapping"));
+               me.TD(me, 1, 1.9, e = makeXonoticCheckBox(0, "r_glsl_offsetmapping_reliefmapping", _("Relief mapping")));
                        setDependentAND(e, "vid_gl20", 1, 1, "r_glsl_offsetmapping", 1, 1);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_water", "Reflections:"));
+               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_water", _("Reflections:")));
                        setDependent(e, "vid_gl20", 1, 1);
                me.TD(me, 1, 2, e = makeXonoticTextSlider("r_water_resolutionmultiplier"));
-                       e.addValue(e, "Blurred", "0.25");
-                       e.addValue(e, "Good", "0.5");
-                       e.addValue(e, "Sharp", "1");
+                       e.addValue(e, _("Blurred"), "0.25");
+                       e.addValue(e, _("Good"), "0.5");
+                       e.addValue(e, _("Sharp"), "1");
                        e.configureXonoticTextSliderValues(e);
                        setDependentAND(e, "vid_gl20", 1, 1, "r_water", 1, 1);
        me.TR(me);
                if(cvar("developer"))
-                       me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(3, 0, "r_showsurfaces", "Show surfaces"));
+                       me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(3, 0, "r_showsurfaces", _("Show surfaces")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticRadioButton(1, string_null, string_null, "No dynamic lighting"));
+               me.TD(me, 1, 3, e = makeXonoticRadioButton(1, string_null, string_null, _("No dynamic lighting")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "gl_flashblend", string_null, "Flash blend approximation"));
+               me.TD(me, 1, 3, e = makeXonoticRadioButton(1, "gl_flashblend", string_null, _("Flash blend approximation")));
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "r_shadow_realtime_dlight", string_null, "Realtime dynamic lighting"));
-               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_realtime_dlight_shadows", "Shadows"));
+               me.TD(me, 1, 2, e = makeXonoticRadioButton(1, "r_shadow_realtime_dlight", string_null, _("Realtime dynamic lighting")));
+               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_realtime_dlight_shadows", _("Shadows")));
                        setDependent(e, "r_shadow_realtime_dlight", 1, 1);
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "r_shadow_realtime_world", "Realtime world lighting"));
-               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_realtime_world_shadows", "Shadows"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "r_shadow_realtime_world", _("Realtime world lighting")));
+               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_realtime_world_shadows", _("Shadows")));
                        setDependent(e, "r_shadow_realtime_world", 1, 1);
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "r_shadow_usenormalmap", "Use normal maps"));
+               me.TD(me, 1, 1.8, e = makeXonoticCheckBox(0, "r_shadow_usenormalmap", _("Use normal maps")));
                        setDependentOR(e, "r_shadow_realtime_dlight", 1, 1, "r_shadow_realtime_world", 1, 1);
-               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_shadowmapping", "Soft shadows"));
+               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_shadow_shadowmapping", _("Soft shadows")));
                        setDependentWeird(e, someShadowCvarIsEnabled);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_coronas", "Coronas"));
+               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_coronas", _("Coronas")));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_bloom", "Bloom"));
+               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "r_bloom", _("Bloom")));
                        setDependent(e, "r_hdr", 0, 0);
-               me.TD(me, 1, 2, e = makeXonoticCheckBoxEx(2, 0, "r_hdr", "High Dynamic Range (HDR)"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBoxEx(2, 0, "r_hdr", _("High Dynamic Range (HDR)")));
        
        me.TR(me);
                s = makeXonoticSlider(0.1, 1, 0.1, "r_motionblur");
-               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, s, "Motion blur:"));
+               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, s, _("Motion blur:")));
                if(s.value != e.savedValue)
                        e.savedValue = 0.5; // default
                me.TD(me, 1, 2, s);
        me.TR(me);
                s = makeXonoticSlider(0.1, 1, 0.1, "r_damageblur");
-               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, s, "Damage blur:"));
+               me.TD(me, 1, 1, e = makeXonoticSliderCheckBox(0, 1, s, _("Damage blur:")));
                if(s.value != e.savedValue)
                        e.savedValue = 0.4; // default
                me.TD(me, 1, 2, s);
        
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, makeXonoticCommandButton("Apply immediately", '0 0 0', "vid_restart", COMMANDBUTTON_APPLY));
+               me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "vid_restart", COMMANDBUTTON_APPLY));
 }
 #endif
index df3bd084a5ec4633be91cd4a651b598c9f092974..2135b301fedf746801695bd1424f88c672b050ad 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticInputSettingsTab) EXTENDS(XonoticTab)
        METHOD(XonoticInputSettingsTab, fill, void(entity))
-       ATTRIB(XonoticInputSettingsTab, title, string, "Input")
+       ATTRIB(XonoticInputSettingsTab, title, string, _("Input"))
        ATTRIB(XonoticInputSettingsTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticInputSettingsTab, rows, float, 17)
        ATTRIB(XonoticInputSettingsTab, columns, float, 6.5)
@@ -23,55 +23,46 @@ void XonoticInputSettingsTab_fill(entity me)
        entity kb;
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, "Key bindings:"));
+               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Key bindings:")));
        me.TR(me);
                me.TD(me, me.rows - 2, 3.3, kb = makeXonoticKeyBinder());
        me.gotoRC(me, me.rows - 1, 0);
        me.TR(me);
-               me.TD(me, 1, 1.1, e = makeXonoticButton("Change key...", '0 0 0'));
+               me.TD(me, 1, 1.1, e = makeXonoticButton(_("Change key..."), '0 0 0'));
                        e.onClick = KeyBinder_Bind_Change;
                        e.onClickEntity = kb;
                        kb.keyGrabButton = e;
-               me.TD(me, 1, 1.1, e = makeXonoticButton("Edit...", '0 0 0'));
+               me.TD(me, 1, 1.1, e = makeXonoticButton(_("Edit..."), '0 0 0'));
                        e.onClick = KeyBinder_Bind_Edit;
                        e.onClickEntity = kb;
                        kb.userbindEditButton = e;
                        kb.userbindEditDialog = main.userbindEditDialog;
                        main.userbindEditDialog.keybindBox = kb;
-               me.TD(me, 1, 1.1, e = makeXonoticButton("Clear", '0 0 0'));
+               me.TD(me, 1, 1.1, e = makeXonoticButton(_("Clear"), '0 0 0'));
                        e.onClick = KeyBinder_Bind_Clear;
                        e.onClickEntity = kb;
 
        me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Sensitivity:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Sensitivity:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(1, 32, 0.2, "sensitivity"));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "UI mouse speed:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("UI mouse speed:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(0.2, 4.0, 0.1, "menu_mouse_speed"));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "m_filter", "Mouse filter"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "m_filter", _("Mouse filter")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(1.022, "m_pitch", "Invert mouse"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(1.022, "m_pitch", _("Invert mouse")));
        me.TR(me);
                if(cvar_type("joy_enable") & CVAR_TYPEFLAG_ENGINE)
-                       me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "joy_enable", "Use joystick input"));
+                       me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "joy_enable", _("Use joystick input")));
                else if(cvar_type("joystick") & CVAR_TYPEFLAG_ENGINE)
-                       me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "joystick", "Use joystick input"));
+                       me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "joystick", _("Use joystick input")));
        me.TR(me);
                if(cvar_type("vid_dgamouse") & CVAR_TYPEFLAG_ENGINE)
-                       me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_dgamouse", "Turn off OS mouse acceleration"));
+                       me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_dgamouse", _("Turn off OS mouse acceleration")));
                else if(cvar_type("apple_mouse_noaccel") & CVAR_TYPEFLAG_ENGINE)
-                       me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "apple_mouse_noaccel", "Turn off OS mouse acceleration"));
+                       me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "apple_mouse_noaccel", _("Turn off OS mouse acceleration")));
        me.TR(me);
                me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "con_closeontoggleconsole", "\"enter console\" also closes"));
-       me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Show binds:"));
-               me.TD(me, 1, 2, e = makeXonoticTextSlider("sbar_showbinds"));
-                       e.addValue(e, "Actions", "0");
-                       e.addValue(e, "Bound keys", "1");
-                       e.addValue(e, "Both", "2");
-                       e.configureXonoticTextSliderValues(e);
-       me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBoxEx(2, 0, "cl_showpressedkeys", "Show pressed keys"));
 }
 #endif
index 3cdfa95b739c957670fc42ff5d17a36e2c3098f4..aaf182fcd80e93a92e15ca4ca5af48ae27481534 100644 (file)
@@ -2,7 +2,7 @@
 CLASS(XonoticUserbindEditDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticUserbindEditDialog, loadUserBind, void(entity, string, string, string))
        METHOD(XonoticUserbindEditDialog, fill, void(entity))
-       ATTRIB(XonoticUserbindEditDialog, title, string, "User defined key bind")
+       ATTRIB(XonoticUserbindEditDialog, title, string, _("User defined key bind"))
        ATTRIB(XonoticUserbindEditDialog, color, vector, SKINCOLOR_DIALOG_USERBIND)
        ATTRIB(XonoticUserbindEditDialog, intendedWidth, float, 0.7)
        ATTRIB(XonoticUserbindEditDialog, rows, float, 4)
@@ -36,19 +36,19 @@ void XonoticUserbindEditDialog_fill(entity me)
 {
        entity e;
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Name:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Name:")));
                me.TD(me, 1, me.columns - 1, me.nameBox = makeXonoticInputBox(0, string_null));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Command when pressed:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Command when pressed:")));
                me.TD(me, 1, me.columns - 1, me.commandPressBox = makeXonoticInputBox(0, string_null));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Command when released:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Command when released:")));
                me.TD(me, 1, me.columns - 1, me.commandReleaseBox = makeXonoticInputBox(0, string_null));
        me.TR(me);
-               me.TD(me, 1, me.columns / 2, e = makeXonoticButton("Save", '0 0 0'));
+               me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Save"), '0 0 0'));
                        e.onClick = XonoticUserbindEditDialog_Save;
                        e.onClickEntity = me;
-               me.TD(me, 1, me.columns / 2, e = makeXonoticButton("Cancel", '0 0 0'));
+               me.TD(me, 1, me.columns / 2, e = makeXonoticButton(_("Cancel"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index 14293d7f2c6c330b497872fd821460365b3de114..1495269948495db1ef8ac88987cc7e9d34ea7546 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticMiscSettingsTab) EXTENDS(XonoticTab)
        METHOD(XonoticMiscSettingsTab, fill, void(entity))
-       ATTRIB(XonoticMiscSettingsTab, title, string, "Misc")
+       ATTRIB(XonoticMiscSettingsTab, title, string, _("Misc"))
        ATTRIB(XonoticMiscSettingsTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticMiscSettingsTab, rows, float, 17)
        ATTRIB(XonoticMiscSettingsTab, columns, float, 6.5)
@@ -23,54 +23,54 @@ void XonoticMiscSettingsTab_fill(entity me)
        entity sk;
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, "Menu skins:"));
+               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Menu skins:")));
        me.TR(me);
                me.TD(me, me.rows - 2, 3, sk = makeXonoticSkinList());
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, 3, e = makeXonoticButton("Apply immediately", '0 0 0'));
+               me.TD(me, 1, 3, e = makeXonoticButton(_("Apply immediately"), '0 0 0'));
                        e.onClick = SetSkin_Click;
                        e.onClickEntity = sk;
 
        me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "showtime", "Show current time"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "showtime", _("Show current time")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "showdate", "Show current date"));
+               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.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.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)"));
+               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"));
+               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"));
+               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"));
+               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"));
+               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"));
+               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.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:"));
+               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.TDempty(me, 0.2);
-               me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "cl_maxfps_alwayssleep", "Minimize input latency"));
+               me.TD(me, 1, 2.8, e = makeXonoticCheckBox(0, "cl_maxfps_alwayssleep", _("Minimize input latency")));
        me.TR(me);
        me.TR(me);
                me.TDempty(me, 0.5);
-               me.TD(me, 1, 2, e = makeXonoticButton("Advanced settings...", '0 0 0'));
+               me.TD(me, 1, 2, e = makeXonoticButton(_("Advanced settings..."), '0 0 0'));
                        e.onClick = DialogOpenButton_Click;
                        e.onClickEntity = main.cvarsDialog;
 }
index 0d846caf2ae5f60643f4b8b376bd7a0c89e86278..7f26a4002686a42dd97d9c7370fe64572dce1c49 100644 (file)
@@ -1,9 +1,8 @@
 #ifdef INTERFACE
 CLASS(XonoticCvarsDialog) EXTENDS(XonoticDialog)
-       METHOD(XonoticCvarsDialog, toString, string(entity))
        METHOD(XonoticCvarsDialog, fill, void(entity))
        METHOD(XonoticCvarsDialog, showNotify, void(entity))
-       ATTRIB(XonoticCvarsDialog, title, string, "Advanced settings")
+       ATTRIB(XonoticCvarsDialog, title, string, _("Advanced settings"))
        ATTRIB(XonoticCvarsDialog, color, vector, SKINCOLOR_DIALOG_CVARS)
        ATTRIB(XonoticCvarsDialog, intendedWidth, float, 0.8)
        ATTRIB(XonoticCvarsDialog, rows, float, 25)
@@ -16,17 +15,13 @@ void XonoticCvarsDialog_showNotify(entity me)
 {
        loadAllCvars(me);
 }
-string XonoticCvarsDialog_toString(entity me)
-{
-       return "XXX";
-}
 void XonoticCvarsDialog_fill(entity me)
 {
        entity e, cvarlist, btn;
        cvarlist = makeXonoticCvarList();
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Cvar filter:"));
-               me.TD(me, 1, 0.5, btn = makeXonoticButton("Clear", '0 0 0'));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Cvar filter:")));
+               me.TD(me, 1, 0.5, btn = makeXonoticButton(_("Clear"), '0 0 0'));
                me.TD(me, 1, me.columns - 1.5, e = makeXonoticInputBox(0, string_null));
                        e.onChange = CvarList_Filter_Change;
                        e.onChangeEntity = cvarlist;
@@ -36,15 +31,15 @@ void XonoticCvarsDialog_fill(entity me)
        me.TR(me);
                me.TD(me, me.rows - me.currentRow - 7, me.columns, cvarlist);
        me.gotoRC(me, me.rows - 7, 0);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Setting:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Setting:")));
                me.TD(me, 1, me.columns - 1, e = makeXonoticTextLabel(0, string_null));
                        cvarlist.cvarNameBox = e;
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Type:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Type:")));
                me.TD(me, 1, me.columns - 1, e = makeXonoticTextLabel(0, string_null));
                        cvarlist.cvarTypeBox = e;
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Value:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Value:")));
                me.TD(me, 1, me.columns - 2, e = makeXonoticInputBox(0, string_null));
                        cvarlist.cvarValueBox = e;
                        e.onChange = CvarList_Value_Change;
@@ -56,12 +51,12 @@ void XonoticCvarsDialog_fill(entity me)
                        e.allowCut = 1;
                        e.marginLeft = e.marginRight = 0.5;
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Description:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Description:")));
                me.TD(me, 1, me.columns - 1, e = makeXonoticTextLabel(0, string_null));
                        cvarlist.cvarDescriptionBox = e;
                        e.allowWrap = 1;
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("OK", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index 6e0c472afb4dc07a92a6a175f457d584353323a5..9b6b7c33037fffef60d3f07564eb06f7405f8105 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticNetworkSettingsTab) EXTENDS(XonoticTab)
        METHOD(XonoticNetworkSettingsTab, fill, void(entity))
-       ATTRIB(XonoticNetworkSettingsTab, title, string, "Network")
+       ATTRIB(XonoticNetworkSettingsTab, title, string, _("Network"))
        ATTRIB(XonoticNetworkSettingsTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticNetworkSettingsTab, rows, float, 17)
        ATTRIB(XonoticNetworkSettingsTab, columns, float, 6.5)
@@ -23,38 +23,38 @@ void XonoticNetworkSettingsTab_fill(entity me)
        entity e;
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_movement", "Client-side movement prediction"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_movement", _("Client-side movement prediction")));
        me.TR(me);
-               //me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_nolerp", "Network update smoothing"));
+               //me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_nolerp", _("Network update smoothing")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "shownetgraph", "Show netgraph"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "shownetgraph", _("Show netgraph")));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Network speed:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Network speed:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("_cl_rate"));
-                       e.addValue(e, "56k", "4000");
-                       e.addValue(e, "ISDN", "7000");
-                       e.addValue(e, "Slow ADSL", "15000");
-                       e.addValue(e, "Fast ADSL", "20000");
-                       e.addValue(e, "Broadband", "66666");
+                       e.addValue(e, _("56k"), "4000");
+                       e.addValue(e, _("ISDN"), "7000");
+                       e.addValue(e, _("Slow ADSL"), "15000");
+                       e.addValue(e, _("Fast ADSL"), "20000");
+                       e.addValue(e, _("Broadband"), "66666");
                        e.configureXonoticTextSliderValues(e);
     me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Input packets/s:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Input packets/s:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(20, 100, 1, "cl_netfps"));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, "HTTP downloads:"));
+               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("HTTP downloads:")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Downloads:"));
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Downloads:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(1, 5, 1, "cl_curl_maxdownloads"));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, "Speed (kB/s):"));
+               me.TD(me, 1, 0.8, e = makeXonoticTextLabel(0, _("Speed (kB/s):")));
                me.TD(me, 1, 2, e = makeXonoticSlider(10, 1500, 10, "cl_curl_maxspeed"));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Client UDP port:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Client UDP port:")));
                me.TD(me, 1, 0.64, e = makeXonoticInputBox(0, "cl_port"));
 }
 #endif
index 0aa5e68cc3a6e8391d04428b74f4984546d71aba..d7aeef5cbbc6282c5a990f2d8086f8a997848e68 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticVideoSettingsTab) EXTENDS(XonoticTab)
        METHOD(XonoticVideoSettingsTab, fill, void(entity))
-       ATTRIB(XonoticVideoSettingsTab, title, string, "Video")
+       ATTRIB(XonoticVideoSettingsTab, title, string, _("Video"))
        ATTRIB(XonoticVideoSettingsTab, intendedWidth, float, 0.9)
        ATTRIB(XonoticVideoSettingsTab, rows, float, 17)
        ATTRIB(XonoticVideoSettingsTab, columns, float, 6.5)
@@ -23,86 +23,86 @@ void XonoticVideoSettingsTab_fill(entity me)
        entity e;
 
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Resolution:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Resolution:")));
                me.TD(me, 1, 2, e = makeXonoticResolutionSlider());
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Font/UI size:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Font/UI size:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("menu_vid_scale"));
-                       e.addValue(e, "Unreadable", "-1");
-                       e.addValue(e, "Tiny", "-0.75");
-                       e.addValue(e, "Little", "-0.5");
-                       e.addValue(e, "Small", "-0.25");
-                       e.addValue(e, "Medium", "0");
-                       e.addValue(e, "Large", "0.25");
-                       e.addValue(e, "Huge", "0.5");
-                       e.addValue(e, "Gigantic", "0.75");
-                       e.addValue(e, "Colossal", "1");
+                       e.addValue(e, _("Unreadable"), "-1");
+                       e.addValue(e, _("Tiny"), "-0.75");
+                       e.addValue(e, _("Little"), "-0.5");
+                       e.addValue(e, _("Small"), "-0.25");
+                       e.addValue(e, _("Medium"), "0");
+                       e.addValue(e, _("Large"), "0.25");
+                       e.addValue(e, _("Huge"), "0.5");
+                       e.addValue(e, _("Gigantic"), "0.75");
+                       e.addValue(e, _("Colossal"), "1");
                        e.configureXonoticTextSliderValues(e);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Color depth:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Color depth:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(16, 32, 16, "vid_bitsperpixel"));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "vid_fullscreen", "Full screen"));
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "vid_vsync", "Vertical Synchronization"));
+               me.TD(me, 1, 1, e = makeXonoticCheckBox(0, "vid_fullscreen", _("Full screen")));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "vid_vsync", _("Vertical Synchronization")));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_gl20", "Use OpenGL 2.0 shaders (GLSL)"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "vid_gl20", _("Use OpenGL 2.0 shaders (GLSL)")));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "r_coronas_occlusionquery", "Use Occlusion Queries"));
+               me.TD(me, 1, 2, e = makeXonoticCheckBox(0, "r_coronas_occlusionquery", _("Use Occlusion Queries")));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, "Vertex Buffer Objects (VBOs)"));
+               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Vertex Buffer Objects (VBOs)")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "gl_vbo", "0", "Off"));
-               me.TD(me, 1, 2.1, e = makeXonoticRadioButton(1, "gl_vbo", "3", "Vertices, some Tris (compatible)"));
+               me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "gl_vbo", "0", _("Off")));
+               me.TD(me, 1, 2.1, e = makeXonoticRadioButton(1, "gl_vbo", "3", _("Vertices, some Tris (compatible)")));
        me.TR(me);
                me.TDempty(me, 0.2);
-               me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "gl_vbo", "2", "Vertices"));
-               me.TD(me, 1, 2.1, e = makeXonoticRadioButton(1, "gl_vbo", "1", "Vertices and Triangles"));
+               me.TD(me, 1, 0.9, e = makeXonoticRadioButton(1, "gl_vbo", "2", _("Vertices")));
+               me.TD(me, 1, 2.1, e = makeXonoticRadioButton(1, "gl_vbo", "1", _("Vertices and Triangles")));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Depth first:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Depth first:")));
                me.TD(me, 1, 2, e = makeXonoticTextSlider("r_depthfirst"));
-                       e.addValue(e, "Disabled", "0");
-                       e.addValue(e, "World", "1");
-                       e.addValue(e, "All", "2");
+                       e.addValue(e, _("Disabled"), "0");
+                       e.addValue(e, _("World"), "1");
+                       e.addValue(e, _("All"), "2");
                        e.configureXonoticTextSliderValues(e);
        me.TR(me);
                if(cvar_type("apple_multithreadedgl") & CVAR_TYPEFLAG_ENGINE)
-                       me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "apple_multithreadedgl", "Disable multithreaded OpenGL"));
+                       me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "apple_multithreadedgl", _("Disable multithreaded OpenGL")));
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "gl_finish", "Wait for GPU to finish each frame"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "gl_finish", _("Wait for GPU to finish each frame")));
 
        me.gotoRC(me, 0, 3.5); me.setFirstColumn(me, me.currentColumn);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Brightness:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Brightness:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(0.0, 0.5, 0.02, "v_brightness"));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Contrast:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Contrast:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(1.0, 3.0, 0.05, "v_contrast"));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Gamma:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Gamma:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(0.5, 2.0, 0.05, "v_gamma"));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Contrast boost:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Contrast boost:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(1.0, 5.0, 0.1, "v_contrastboost"));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Saturation:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Saturation:")));
                        setDependent(e, "vid_gl20", 1, 1);
                me.TD(me, 1, 2, e = makeXonoticSlider(0.5, 2.0, 0.05, "r_glsl_saturation"));
                        setDependent(e, "vid_gl20", 1, 1);
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "v_glslgamma", "Use GLSL to handle color control"));
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "v_glslgamma", _("Use GLSL to handle color control")));
                        setDependent(e, "vid_gl20", 1, 1);
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Ambient:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Ambient:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(0, 20.0, 1.0, "r_ambient"));
        me.TR(me);
-               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, "Intensity:"));
+               me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Intensity:")));
                me.TD(me, 1, 2, e = makeXonoticSlider(0.5, 2.0, 0.05, "r_hdr_scenebrightness"));
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, makeXonoticCommandButton("Apply immediately", '0 0 0', "menu_cmd setresolution; vid_restart; menu_restart; togglemenu; defer 0.1 \"menu_cmd videosettings\"", COMMANDBUTTON_APPLY));
+               me.TD(me, 1, me.columns, makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "menu_cmd setresolution; vid_restart; menu_restart; togglemenu; defer 0.1 \"menu_cmd videosettings\"", COMMANDBUTTON_APPLY));
 }
 #endif
index 560192ff1d6edfdb6021f796b8de44e7b74c1938..81eb68e39232bd09e078bcf9d9bb7d1990be6290 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticSingleplayerDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticSingleplayerDialog, fill, void(entity))
-       ATTRIB(XonoticSingleplayerDialog, title, string, "Singleplayer")
+       ATTRIB(XonoticSingleplayerDialog, title, string, _("Singleplayer"))
        ATTRIB(XonoticSingleplayerDialog, color, vector, SKINCOLOR_DIALOG_SINGLEPLAYER)
        ATTRIB(XonoticSingleplayerDialog, intendedWidth, float, 0.80)
        ATTRIB(XonoticSingleplayerDialog, rows, float, 24)
@@ -56,14 +56,14 @@ void XonoticSingleplayerDialog_fill(entity me)
 
        me.TR(me);
                me.TDempty(me, (me.columns - 3) / 2);
-               me.TD(me, 2, 3, e = makeXonoticBigButton("Instant action! (random map with bots)", '0 0 0'));
+               me.TD(me, 2, 3, e = makeXonoticBigButton(_("Instant action! (random map with bots)"), '0 0 0'));
                        e.onClick = InstantAction_LoadMap;
                        e.onClickEntity = NULL;
        me.TR(me);
        me.TR(me);
        me.TR(me);
                me.TD(me, 1, 1, btnPrev = makeXonoticButton("<<", '0 0 0'));
-               me.TD(me, 1, me.columns - 2, lblTitle = makeXonoticTextLabel(0.5, "???"));
+               me.TD(me, 1, me.columns - 2, lblTitle = makeXonoticTextLabel(0.5, _("???")));
                me.TD(me, 1, 1, btnNext = makeXonoticButton(">>", '0 0 0'));
        me.TR(me);
                me.TD(me, me.rows - 5, me.columns, me.campaignBox = makeXonoticCampaignList());
@@ -77,7 +77,7 @@ void XonoticSingleplayerDialog_fill(entity me)
                        me.campaignBox.campaignGo(me.campaignBox, 0);
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("Start Singleplayer!", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("Start Singleplayer!"), '0 0 0'));
                        e.onClick = CampaignList_LoadMap;
                        e.onClickEntity = me.campaignBox;
 }
index 5d377e6d0a1747d0884fa1f235fef802cc413e17..8e584b8a8a259866636932eccce69630a840747a 100644 (file)
@@ -1,7 +1,7 @@
 #ifdef INTERFACE
 CLASS(XonoticWinnerDialog) EXTENDS(XonoticDialog)
        METHOD(XonoticWinnerDialog, fill, void(entity))
-       ATTRIB(XonoticWinnerDialog, title, string, "Winner")
+       ATTRIB(XonoticWinnerDialog, title, string, _("Winner"))
        ATTRIB(XonoticWinnerDialog, color, vector, SKINCOLOR_DIALOG_SINGLEPLAYER)
        ATTRIB(XonoticWinnerDialog, intendedWidth, float, 0.32)
        ATTRIB(XonoticWinnerDialog, rows, float, 12)
@@ -18,7 +18,7 @@ void XonoticWinnerDialog_fill(entity me)
                me.TD(me, me.rows - 2, me.columns, e = makeXonoticImage("/gfx/winner", -1));
 
        me.gotoRC(me, me.rows - 1, 0);
-               me.TD(me, 1, me.columns, e = makeXonoticButton("OK", '0 0 0'));
+               me.TD(me, 1, me.columns, e = makeXonoticButton(_("OK"), '0 0 0'));
                        e.onClick = Dialog_Close;
                        e.onClickEntity = me;
 }
index e0908ee364d76d3b4666adfb3dbe1ad981cfcb36..7fb154c8a29ba3d4193e375626ec9ee57edfbe89 100644 (file)
@@ -2,7 +2,7 @@
 CLASS(XonoticTeamSelectDialog) EXTENDS(XonoticRootDialog)
        METHOD(XonoticTeamSelectDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
        METHOD(XonoticTeamSelectDialog, showNotify, void(entity))
-       ATTRIB(XonoticTeamSelectDialog, title, string, "Team Selection") // ;)
+       ATTRIB(XonoticTeamSelectDialog, title, string, _("Team Selection")) // ;)
        ATTRIB(XonoticTeamSelectDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
        ATTRIB(XonoticTeamSelectDialog, intendedWidth, float, 0.4)
        ATTRIB(XonoticTeamSelectDialog, rows, float, 5)
@@ -38,17 +38,17 @@ void XonoticTeamSelectDialog_fill(entity me)
 {
        entity e;
        me.TR(me);
-               me.TD(me, 2, 4, e = makeTeamButton("join 'best' team (auto-select)", '0 0 0', "cmd selectteam auto; cmd join"));
+               me.TD(me, 2, 4, e = makeTeamButton(_("join 'best' team (auto-select)"), '0 0 0', "cmd selectteam auto; cmd join"));
                        e.preferredFocusPriority = 1;
        me.TR(me);
        me.TR(me);
-               me.TD(me, 2, 1, me.team1 = makeTeamButton("red", '1 0.5 0.5', "cmd selectteam red; cmd join"));
-               me.TD(me, 2, 1, me.team2 = makeTeamButton("blue", '0.5 0.5 1', "cmd selectteam blue; cmd join"));
-               me.TD(me, 2, 1, me.team3 = makeTeamButton("yellow", '1 1 0.5', "cmd selectteam yellow; cmd join"));
-               me.TD(me, 2, 1, me.team4 = makeTeamButton("pink", '1 0.5 1', "cmd selectteam pink; cmd join"));
+               me.TD(me, 2, 1, me.team1 = makeTeamButton(_("red"), '1 0.5 0.5', "cmd selectteam red; cmd join"));
+               me.TD(me, 2, 1, me.team2 = makeTeamButton(_("blue"), '0.5 0.5 1', "cmd selectteam blue; cmd join"));
+               me.TD(me, 2, 1, me.team3 = makeTeamButton(_("yellow"), '1 1 0.5', "cmd selectteam yellow; cmd join"));
+               me.TD(me, 2, 1, me.team4 = makeTeamButton(_("pink"), '1 0.5 1', "cmd selectteam pink; cmd join"));
        me.TR(me);
        me.TR(me);
-               me.TD(me, 1, 4, makeXonoticCommandButton("spectate", '0 0 0', "cmd spectate", 1));
+               me.TD(me, 1, 4, makeXonoticCommandButton(_("spectate"), '0 0 0', "cmd spectate", 1));
 }
 #endif
 
diff --git a/qcsrc/menu/xonotic/gametypelist.c b/qcsrc/menu/xonotic/gametypelist.c
new file mode 100644 (file)
index 0000000..ec21c65
--- /dev/null
@@ -0,0 +1,85 @@
+#ifdef INTERFACE
+CLASS(XonoticGametypeList) EXTENDS(XonoticListBox)
+       METHOD(XonoticGametypeList, configureXonoticGametypeList, void(entity))
+       ATTRIB(XonoticGametypeList, rowsPerItem, float, 1)
+       METHOD(XonoticGametypeList, drawListBoxItem, void(entity, float, vector, float))
+       METHOD(XonoticGametypeList, resizeNotify, void(entity, vector, vector, vector, vector))
+       METHOD(XonoticGametypeList, setSelected, void(entity, float))
+       METHOD(XonoticGametypeList, loadCvars, void(entity))
+       METHOD(XonoticGametypeList, saveCvars, void(entity))
+
+       ATTRIB(XonoticGametypeList, realFontSize, vector, '0 0 0')
+       ATTRIB(XonoticGametypeList, realUpperMargin, float, 0)
+       ATTRIB(XonoticGametypeList, columnNameOrigin, float, 0)
+       ATTRIB(XonoticGametypeList, columnNameSize, float, 0)
+ENDCLASS(XonoticGametypeList)
+entity makeXonoticGametypeList();
+#endif
+
+#ifdef IMPLEMENTATION
+
+entity makeXonoticGametypeList(void)
+{
+       entity me;
+       me = spawnXonoticGametypeList();
+       me.configureXonoticGametypeList(me);
+       return me;
+}
+void XonoticGametypeList_configureXonoticGametypeList(entity me)
+{
+       me.loadCvars(me);
+       me.configureXonoticListBox(me);
+       me.nItems = GameType_GetCount();
+}
+void XonoticGametypeList_setSelected(entity me, float i)
+{
+       SUPER(XonoticGametypeList).setSelected(me, i);
+       me.saveCvars(me);
+}
+
+void XonoticGametypeList_loadCvars(entity me)
+{
+       float t;
+       t = MapInfo_CurrentGametype();
+       float i;
+       for(i = 0; i < GameType_GetCount(); ++i)
+               if(t == GameType_GetID(i))
+                       break;
+       if(i >= GameType_GetCount())
+       {
+               for(i = 0; i < GameType_GetCount(); ++i)
+                       if(t == MAPINFO_TYPE_DEATHMATCH)
+                               break;
+               if(i >= GameType_GetCount())
+                       i = 0;
+       }
+       me.setSelected(me, i);
+       // do we need this: me.parent.gameTypeChangeNotify(me.parent); // to make sure
+}
+void XonoticGametypeList_saveCvars(entity me)
+{
+       float t;
+       t = GameType_GetID(me.selectedItem);
+       if(t == MapInfo_CurrentGametype())
+               return;
+       MapInfo_SwitchGameType(t);
+       me.parent.gameTypeChangeNotify(me.parent);
+}
+void XonoticGametypeList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
+{
+       string s;
+       if(isSelected)
+               draw_Fill('0 0 0', '1 1 0', SKINCOLOR_LISTBOX_SELECTED, SKINALPHA_LISTBOX_SELECTED);
+       s = GameType_GetName(i);
+       draw_Text(me.realUpperMargin * eY + (me.columnNameOrigin + (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize)) * 0.5) * eX, s, me.realFontSize, '1 1 1', SKINALPHA_TEXT, 0);
+}
+void XonoticGametypeList_resizeNotify(entity me, vector relOrigin, vector relSize, vector absOrigin, vector absSize)
+{
+       SUPER(XonoticServerList).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
+       me.realFontSize_y = me.fontSize / (absSize_y * me.itemHeight);
+       me.realFontSize_x = me.fontSize / (absSize_x * (1 - me.controlWidth));
+       me.realUpperMargin = 0.5 * (1 - me.realFontSize_y);
+       me.columnNameOrigin = 0;
+       me.columnNameSize = 1;
+}
+#endif
index 3117c65e4800af30675dc597c3a97863d73b1d4e..f4a6c5a3e3dc40adbefdaf5d4eb1f7a75b94be4a 100644 (file)
@@ -47,7 +47,7 @@ void Xonotic_KeyBinds_Read()
        string s;
 
        Xonotic_KeyBinds_Count = 0;
-       fh = fopen("keybinds.txt", FILE_READ);
+       fh = fopen(language_filename("keybinds.txt"), FILE_READ);
        if(fh < 0)
                return;
        while((s = fgets(fh)))
@@ -137,6 +137,7 @@ void XonoticKeyBinder_keyGrabbed(entity me, float key, float ascii)
                }
        }
        localcmd("\nbind \"", keynumtostring(key), "\" \"", func, "\"\n");
+       localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
 }
 void XonoticKeyBinder_editUserbind(entity me, string theName, string theCommandPress, string theCommandRelease)
 {
@@ -197,7 +198,7 @@ void KeyBinder_Bind_Clear(entity btn, entity me)
                        //localcmd("\nunbind \"", keynumtostring(k), "\"\n");
                        localcmd("\nbind \"", keynumtostring(k), "\" \"", KEY_NOT_BOUND_CMD, "\"\n");
        }
-
+       localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
 }
 void XonoticKeyBinder_clickListBoxItem(entity me, float i, vector where)
 {
index 72e5faac36fa62d140a0d52b95e55853b2b24252..18fdcf5c087240599ec62cb516e1b04e3dbc11db 100644 (file)
@@ -19,10 +19,10 @@ ENDCLASS(MainWindow)
 
 void DemoButton_Click(entity me, entity other)
 {
-       if(me.text == "Do not press this button again!")
+       if(me.text == _("Do not press this button again!"))
                DialogOpenButton_Click(me, other);
        else
-               me.setText(me, "Do not press this button again!");
+               me.setText(me, _("Do not press this button again!"));
 }
 
 void MainWindow_configureMainWindow(entity me)
index 8b5ce6d6a7b46a3a9c58f0e1b090b47ee71c52c0..1390ff3b1a1c22abd115612719341a3ac234b0f1 100644 (file)
@@ -275,20 +275,22 @@ void MapList_LoadMap(entity btn, entity me)
        m = MapInfo_BSPName_ByID(i);
        if not(m)
        {
-               print("Huh? Can't play this (m is NULL). Refiltering so this won't happen again.\n");
+               print(_("Huh? Can't play this (m is NULL). Refiltering so this won't happen again.\n"));
+               me.refilter(me);
                return;
        }
        if(MapInfo_CheckMap(m))
        {
                localcmd("\nmenu_loadmap_prepare\n");
                if(cvar("menu_use_default_hostname"))
-                       localcmd("hostname \"", strdecolorize(cvar_string("_cl_name")), "'s Xonotic server\"\n");
+                       localcmd("hostname \"", sprintf(_("%s's Xonotic Server"), strdecolorize(cvar_string("_cl_name"))), "\"\n");
                MapInfo_LoadMap(m);
        }
        else
        {
-               print("Huh? Can't play this (invalid game type). Refiltering so this won't happen again.\n");
+               print(_("Huh? Can't play this (invalid game type). Refiltering so this won't happen again.\n"));
                me.refilter(me);
+               return;
        }
 }
 
index bbef3a6b1c2d6acdeb245a401e18f3d4b1afa00c..ef02224dfaf8bc332b45d4947b78f131fcb33e83 100644 (file)
@@ -47,7 +47,7 @@ void XonoticPlayerModelSelector_configureXonoticPlayerModelSelector(entity me)
        float sortbuf, glob, i;
        string fn;
 
-       glob = search_begin(get_model_datafilename(string_null, -1, "txt"), TRUE, TRUE);
+       glob = search_begin(language_filename(get_model_datafilename(string_null, -1, "txt")), TRUE, TRUE);
        if (glob < 0)
                return;
 
@@ -77,11 +77,11 @@ void XonoticPlayerModelSelector_configureXonoticPlayerModelSelector(entity me)
                bufstr_set(me.bufModels, BUFMODELS_COUNT*i+BUFMODELS_SKIN, ftos(get_model_parameters_modelskin));
                get_model_parameters_desc = strcat(get_model_parameters_desc, "\n");
                if(get_model_parameters_sex)
-                       get_model_parameters_desc = strcat(get_model_parameters_desc, "\nSex: ", get_model_parameters_sex);
+                       get_model_parameters_desc = strcat(get_model_parameters_desc, sprintf("\nSex: %s", get_model_parameters_sex));
                if(get_model_parameters_weight)
-                       get_model_parameters_desc = strcat(get_model_parameters_desc, "\nWeight: ", ftos(get_model_parameters_weight), " kg");
+                       get_model_parameters_desc = strcat(get_model_parameters_desc, sprintf("\nWeight: %g kg", get_model_parameters_weight));
                if(get_model_parameters_age)
-                       get_model_parameters_desc = strcat(get_model_parameters_desc, "\nAge: ", ftos(get_model_parameters_age));
+                       get_model_parameters_desc = strcat(get_model_parameters_desc, sprintf("\nAge: %g", get_model_parameters_age));
                while(substring(get_model_parameters_desc, -1, 1) == "\n")
                        get_model_parameters_desc = substring(get_model_parameters_desc, 0, -2);
                bufstr_set(me.bufModels, BUFMODELS_COUNT*i+BUFMODELS_DESC, get_model_parameters_desc);
@@ -171,7 +171,7 @@ void XonoticPlayerModelSelector_draw(entity me)
 
        if (me.numModels <= 0)
        {
-               draw_CenterText('0.5 0.5 0', "<no model found>", me.realFontSize, '1 1 1', 0.6, FALSE);
+               draw_CenterText('0.5 0.5 0', _("<no model found>"), me.realFontSize, '1 1 1', 0.6, FALSE);
                return;
        }
 
index efc00822d8f72456979fd721890afcfe4798e3af..e8c9db364e9d3caaa31f4ee904b82ebc08c33523 100644 (file)
@@ -3,7 +3,7 @@ CLASS(XonoticRootDialog) EXTENDS(XonoticDialog)
        // still to be customized by user
        /*
        ATTRIB(XonoticDialog, closable, float, 1)
-       ATTRIB(XonoticDialog, title, string, "Form1") // ;)
+       ATTRIB(XonoticDialog, title, string, _("Form1")) // ;)
        ATTRIB(XonoticDialog, color, vector, '1 0.5 1')
        ATTRIB(XonoticDialog, intendedWidth, float, 0)
        ATTRIB(XonoticDialog, rows, float, 3)
index 3d5d3e843cecb59fbc2a94d4bbecbc47ff68d455..3cd3338bc74f5541e31383cf11c09b7f23ee24ae 100644 (file)
@@ -107,6 +107,8 @@ float IsFavorite(string srv)
        if(srv == "")
                return FALSE;
        srv = netaddress_resolve(srv, 26000);
+       if(srv == "")
+               return FALSE;
        p = crypto_getidfp(srv);
        n = tokenize_console(cvar_string("net_slist_favorites"));
        for(i = 0; i < n; ++i)
@@ -352,9 +354,9 @@ void XonoticServerList_draw(entity me)
                if(me.ipAddressBox.focused || me.ipAddressBoxFocused < 0)
                {
                        if(IsFavorite(me.ipAddressBox.text))
-                               me.favoriteButton.setText(me.favoriteButton, "Remove");
+                               me.favoriteButton.setText(me.favoriteButton, _("Remove"));
                        else
-                               me.favoriteButton.setText(me.favoriteButton, "Bookmark");
+                               me.favoriteButton.setText(me.favoriteButton, _("Bookmark"));
                }
                me.ipAddressBoxFocused = me.ipAddressBox.focused;
        }
@@ -502,7 +504,7 @@ void XonoticServerList_resizeNotify(entity me, vector relOrigin, vector relSize,
        me.columnPingSize = me.realFontSize_x * 3;
        me.columnMapSize = me.realFontSize_x * 10;
        me.columnTypeSize = me.realFontSize_x * 4;
-       me.columnPlayersSize = me.realFontSize_x * 4;
+       me.columnPlayersSize = me.realFontSize_x * 5;
        me.columnNameSize = 1 - me.columnPlayersSize - me.columnMapSize - me.columnPingSize - me.columnIconsSize - me.columnTypeSize - 5 * me.realFontSize_x;
        me.columnPingOrigin = me.columnIconsOrigin + me.columnIconsSize + me.realFontSize_x;
        me.columnNameOrigin = me.columnPingOrigin + me.columnPingSize + me.realFontSize_x;
@@ -510,11 +512,11 @@ void XonoticServerList_resizeNotify(entity me, vector relOrigin, vector relSize,
        me.columnTypeOrigin = me.columnMapOrigin + me.columnMapSize + me.realFontSize_x;
        me.columnPlayersOrigin = me.columnTypeOrigin + me.columnTypeSize + me.realFontSize_x;
 
-       me.positionSortButton(me, me.sortButton1, me.columnPingOrigin, me.columnPingSize, "Ping", ServerList_PingSort_Click);
-       me.positionSortButton(me, me.sortButton2, me.columnNameOrigin, me.columnNameSize, "Host name", ServerList_NameSort_Click);
-       me.positionSortButton(me, me.sortButton3, me.columnMapOrigin, me.columnMapSize, "Map", ServerList_MapSort_Click);
-       me.positionSortButton(me, me.sortButton4, me.columnTypeOrigin, me.columnTypeSize, "Type", ServerList_TypeSort_Click);
-       me.positionSortButton(me, me.sortButton5, me.columnPlayersOrigin, me.columnPlayersSize, "Players", ServerList_PlayerSort_Click);
+       me.positionSortButton(me, me.sortButton1, me.columnPingOrigin, me.columnPingSize, _("Ping"), ServerList_PingSort_Click);
+       me.positionSortButton(me, me.sortButton2, me.columnNameOrigin, me.columnNameSize, _("Host name"), ServerList_NameSort_Click);
+       me.positionSortButton(me, me.sortButton3, me.columnMapOrigin, me.columnMapSize, _("Map"), ServerList_MapSort_Click);
+       me.positionSortButton(me, me.sortButton4, me.columnTypeOrigin, me.columnTypeSize, _("Type"), ServerList_TypeSort_Click);
+       me.positionSortButton(me, me.sortButton5, me.columnPlayersOrigin, me.columnPlayersSize, _("Players"), ServerList_PlayerSort_Click);
 
        float f;
        f = me.currentSortField;
@@ -707,8 +709,11 @@ float XonoticServerList_keyDown(entity me, float scan, float ascii, float shift)
        }
        else if(scan == K_MOUSE2 || scan == K_SPACE)
        {
-               main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem);
-               DialogOpenButton_Click_withCoords(me, main.serverInfoDialog, org, sz);
+               if(me.nItems != 0)
+               {
+                       main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem);
+                       DialogOpenButton_Click_withCoords(me, main.serverInfoDialog, org, sz);
+               }
        }
        else if(scan == K_INS || scan == K_MOUSE3 || scan == K_KP_INS)
        {
index 864b3054a5bb85dccbabb3b538ecf76bc0b8fb82..bb01f974cbf1d0c6312b57cd8ec40c1f0107edca 100644 (file)
@@ -102,10 +102,10 @@ void XonoticSkinList_getSkins(entity me)
        {
                s = search_getfilename(glob, i);
                bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_NAME, substring(s, 9, strlen(s) - 24)); // the * part
-               bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_TITLE, "<TITLE>");
-               bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_AUTHOR, "<AUTHOR>");
+               bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_TITLE, _("<TITLE>"));
+               bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_AUTHOR, _("<AUTHOR>"));
                bufstr_set(buf, i * SKINPARM_COUNT + SKINPARM_PREVIEW, strcat("/gfx/menu/", substring(s, 9, strlen(s) - 24), "/skinpreview"));
-               fh = fopen(s, FILE_READ);
+               fh = fopen(language_filename(s), FILE_READ);
                if(fh < 0)
                {
                        print("Warning: can't open skinvalues.txt file\n");
@@ -160,7 +160,7 @@ void XonoticSkinList_drawListBoxItem(entity me, float i, vector absSize, float i
        draw_Picture(me.columnPreviewOrigin * eX, s, me.columnPreviewSize * eX + eY, '1 1 1', 1);
        
        s = me.skinParameter(me, i, SKINPARM_NAME);
-       s = strcat(s, ": ", me.skinParameter(me, i, SKINPARM_TITLE));
+       s = sprintf(_("%s: %s"), s, me.skinParameter(me, i, SKINPARM_TITLE));
        s = draw_TextShortenToWidth(s, me.columnNameSize, 0, me.realFontSize);
        draw_Text(me.realUpperMargin1 * eY + (me.columnNameOrigin + 0.00 * (me.columnNameSize - draw_TextWidth(s, 0, me.realFontSize))) * eX, s, me.realFontSize, SKINCOLOR_SKINLIST_TITLE, SKINALPHA_TEXT, 0);
 
index 0e4b4e3720e8c0bece5fe57d26cf79620c6428ce..6ee8ca7c4d87d3a0081c27efdda456b82f91d85c 100644 (file)
@@ -47,10 +47,10 @@ void XonoticDecibelsSlider_saveCvars(entity me)
 string XonoticDecibelsSlider_valueToText(entity me, float v)
 {
        if(v < -33)
-               return "OFF";
+               return _("OFF");
        else if(v >= -0.1)
-               return "MAX";
-       return strcat(SUPER(XonoticDecibelsSlider).valueToText(me, v), " dB");
+               return _("MAX");
+       return sprintf(_("%s dB"), SUPER(XonoticDecibelsSlider).valueToText(me, v));
 }
 
 #endif
index e906242fe44fc90c3cdcc80bad6afa213e8c9317..ddedc4bab2901e2cd077a60c475aef525f223e80 100644 (file)
@@ -3,6 +3,7 @@ CLASS(XonoticPicmipSlider) EXTENDS(XonoticTextSlider)
        METHOD(XonoticPicmipSlider, configureXonoticPicmipSlider, void(entity))
        METHOD(XonoticPicmipSlider, draw, void(entity))
        METHOD(XonoticPicmipSlider, autofix, void(entity))
+       ATTRIB(XonoticPicmipSlider, have_s3tc, float, 0)
 ENDCLASS(XonoticPicmipSlider)
 entity makeXonoticPicmipSlider(); // note: you still need to call addValue and configureXonoticTextSliderValues!
 #endif
@@ -19,23 +20,26 @@ void XonoticPicmipSlider_configureXonoticPicmipSlider(entity me)
 {
        me.configureXonoticTextSlider(me, "gl_picmip");
        me.autofix(me);
+       me.have_s3tc = GL_Have_TextureCompression();
 }
-float texmemsize()
+float texmemsize(float s3tc)
 {
        return
        (
-                 2500 * pow(0.5, max(0, cvar("gl_picmip") + cvar("gl_picmip_other")))
-               + 1500 * pow(0.5, max(0, cvar("gl_picmip") + cvar("gl_picmip_world")))
-       ) * ((cvar("r_texture_dds_load") || cvar("gl_texturecompression")) ? 0.4 : 1.0); // TC: normalmaps 50%, other 25%, few incompressible, guessing 40% as conservative average
+                 2500 * pow(0.25, max(0, cvar("gl_picmip") + cvar("gl_picmip_other")))
+               + 1500 * pow(0.25, max(0, cvar("gl_picmip") + cvar("gl_picmip_world")))
+       ) * ((s3tc && (cvar("r_texture_dds_load") || cvar("gl_texturecompression"))) ? 0.2 : 1.0); // TC: normalmaps 50%, other 25%, few incompressible, guessing 40% as conservative average
 }
 void XonoticPicmipSlider_autofix(entity me)
 {
        float max_hard, max_soft;
+       if(cvar("menu_picmip_bypass"))
+               return;
        max_hard = cvar("sys_memsize_virtual");
        max_soft = cvar("sys_memsize_physical");
        if(max_hard > 0)
        {
-               while(me.value > 0 && texmemsize() > max_hard)
+               while(me.value > 0 && texmemsize(me.have_s3tc) > max_hard)
                        me.setValue(me, me.value - 1);
        }
        // TODO also check the soft limit!
index de34a410d9fb2ef9722efb6b9e28382f11b563dd..d5d013048e9c67b874487f84a7d2f15bacee8192 100644 (file)
@@ -62,7 +62,7 @@ entity makeXonoticResolutionSlider()
 }
 void XonoticResolutionSlider_addResolution(entity me, float w, float h, float pixelheight)
 {
-       me.addValue(me, strzone(strcat(ftos(w), "x", ftos(h))), strzone(strcat(ftos(w), " ", ftos(h), " ", ftos(pixelheight))));
+       me.addValue(me, strzone(sprintf(_("%dx%d"), w, h)), strzone(strcat(ftos(w), " ", ftos(h), " ", ftos(pixelheight))));
        // FIXME (in case you ever want to dynamically instantiate this): THIS IS NEVER FREED
 }
 void XonoticResolutionSlider_configureXonoticResolutionSlider(entity me)
@@ -83,11 +83,24 @@ void XonoticResolutionSlider_configureXonoticResolutionSlider(entity me)
                if(r == r0)
                        continue;
                r0 = r;
-               if(r_x < 640 || r_y < 400)
+               if(r_x < 640 || r_y < 480)
+                       continue;
+               if(r_x > 2 * r_y) // likely dualscreen resolution, skip this one
                        continue;
                me.addResolution(me, r_x, r_y, r_z);
        }
 
+       if(me.nValues == 0)
+       {
+               me.addResolution(me, 640, 480, 1);
+               me.addResolution(me, 800, 600, 1);
+               me.addResolution(me, 1024, 768, 1);
+               me.addResolution(me, 1280, 960, 1);
+               me.addResolution(me, 1280, 1024, 1);
+               me.addResolution(me, 1650, 1080, 1);
+               me.addResolution(me, 1920, 1080, 1);
+       }
+
        me.configureXonoticTextSliderValues(me);
 }
 void XonoticResolutionSlider_loadCvars(entity me)
index c968c60acc10154223c31c57bbb00d2d34137914..81b2bff697449f5c186578a0ff8631dfcc0ffb5e 100644 (file)
@@ -1,7 +1,17 @@
+float GL_CheckExtension(string ext)
+{
+       return (strstrofs(strcat(" ", cvar_string("gl_info_extensions"), " "), strcat(" ", ext, " "), 0) >= 0);
+}
+
+float GL_Have_TextureCompression()
+{
+       return (GL_CheckExtension("GL_EXT_texture_compression_s3tc") && GL_CheckExtension("GL_ARB_texture_compression"));
+}
+
 float tooltipdb;
 void loadTooltips()
 {
-       tooltipdb = db_load("tooltips.db");
+       tooltipdb = db_load(language_filename("tooltips.db"));
 }
 void unloadTooltips()
 {
@@ -250,7 +260,7 @@ void URI_Get_Callback(float id, float status, string data)
        }
        else
        {
-               print("Received HTTP request data for an invalid id ", ftos(id), ".\n");
+               print(sprintf(_("Received HTTP request data for an invalid id %d.\n"), id));
        }
 }
 
@@ -260,22 +270,22 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
 
        if(_Nex_ExtResponseSystem_UpdateTo)
        {
-               print("error: UpdateNotification_URI_Get_Callback has been called before\n");
+               dprint("error: UpdateNotification_URI_Get_Callback has been called before\n");
                return;
        }
        if(status != 0)
        {
-               print(sprintf("error receiving update notification: status is %d\n", status));
+               print(sprintf(_("error receiving update notification: status is %d\n"), status));
                return;
        }
        if(substring(data, 0, 1) == "<")
        {
-               print("error: received HTML instead of an update notification\n");
+               print(_("error: received HTML instead of an update notification\n"));
                return;
        }
        if(strstrofs(data, "\r", 0) != -1)
        {
-               print("error: received carriage returns from update notification server\n");
+               print(_("error: received carriage returns from update notification server\n"));
                return;
        }
 
@@ -296,7 +306,7 @@ void UpdateNotification_URI_Get_Callback(float id, float status, string data)
                {
                        // update needed
                        if(n >= 2)
-                               print(sprintf("Update can be downloaded at:\n%s\n", argv(1)));
+                               print(sprintf(_("Update can be downloaded at:\n%s\n"), argv(1)));
                }
 
                _Nex_ExtResponseSystem_UpdateTo = strzone(_Nex_ExtResponseSystem_UpdateTo);
@@ -317,7 +327,7 @@ float preMenuInit()
                draw_reset_cropped();
 
                sz = eX * 0.025 + eY * 0.025 * (draw_scale_x / draw_scale_y);
-               draw_CenterText('0.5 0.5 0' - 1.25 * sz_y * eY, "Autogenerating mapinfo for newly added maps...", sz, '1 1 1', 1, 0);
+               draw_CenterText('0.5 0.5 0' - 1.25 * sz_y * eY, _("Autogenerating mapinfo for newly added maps..."), sz, '1 1 1', 1, 0);
 
                boxA = '0.05 0.5 0' + 0.25 * sz_y * eY;
                boxB = '0.95 0.5 0' + 1.25 * sz_y * eY;
@@ -404,7 +414,7 @@ void preMenuDraw()
                // TODO rather turn this into a dialog
                fs = ((1/draw_scale_x) * eX + (1/draw_scale_y) * eY) * 12;
                line = eY * fs_y;
-               sz_x = draw_TextWidth("  http://www.xonotic.com/  ", 0, fs);
+               sz_x = draw_TextWidth("  http://www.xonotic.org/  ", 0, fs);
                sz_y = 3 * fs_y;
 
                draw_alpha = sin(time * 0.112 - 0.3) * 10;
@@ -459,29 +469,175 @@ 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);
+       can_dds = GL_Have_TextureCompression();
        if(have_dds && (have_jpg || have_tga))
        {
                // both? Let's only use good quality precompressed files
-               cvar_set("gl_texturecompression", "0");
-               return 1;
+               // but ONLY if we actually support it!
+               if(can_dds)
+               {
+                       cvar_set("gl_texturecompression", "0");
+                       return 1;
+               }
+               else
+               {
+                       cvar_set("gl_texturecompression", "0");
+                       cvar_set("r_texture_dds_load", "0");
+                       return 0;
+               }
        }
        else if(have_dds)
        {
                // DDS only? We probably always want texture compression
                cvar_set("gl_texturecompression", "1");
                cvar_set("r_texture_dds_load", "1");
+               if(!can_dds)
+                       print(_("^1ERROR: Texture compression is required but not supported.\n^1Expect visual problems.\n"));
                return 0;
        }
        else
        {
                // TGA only? Allow runtime compression
-               cvar_set("gl_texturecompression", cvar_string("r_texture_dds_load"));
-               return 2;
+               if(can_dds)
+               {
+                       cvar_set("gl_texturecompression", cvar_string("r_texture_dds_load"));
+                       return 2;
+               }
+               else
+               {
+                       cvar_set("gl_texturecompression", "0");
+                       cvar_set("r_texture_dds_load", "0");
+                       return 0;
+               }
        }
 }
+
+// note: include only those that should be in the menu!
+#define GAMETYPES \
+       GAMETYPE(MAPINFO_TYPE_ARENA, _("Arena")) \
+       GAMETYPE(MAPINFO_TYPE_ASSAULT, _("Assault")) \
+       GAMETYPE(MAPINFO_TYPE_CTF, _("Capture The Flag")) \
+       GAMETYPE(MAPINFO_TYPE_CA, _("Clan Arena")) \
+       GAMETYPE(MAPINFO_TYPE_DEATHMATCH, _("Deathmatch")) \
+       GAMETYPE(MAPINFO_TYPE_DOMINATION, _("Domination")) \
+       GAMETYPE(MAPINFO_TYPE_FREEZETAG, _("Freeze Tag")) \
+       GAMETYPE(MAPINFO_TYPE_KEEPAWAY, _("Keepaway")) \
+       GAMETYPE(MAPINFO_TYPE_KEYHUNT, _("Key Hunt")) \
+       GAMETYPE(MAPINFO_TYPE_LMS, _("Last Man Standing")) \
+       GAMETYPE(MAPINFO_TYPE_NEXBALL, _("Nexball")) \
+       GAMETYPE(MAPINFO_TYPE_ONSLAUGHT, _("Onslaught")) \
+       GAMETYPE(MAPINFO_TYPE_RACE, _("Race")) \
+       GAMETYPE(MAPINFO_TYPE_CTS, _("Race CTS")) \
+       GAMETYPE(MAPINFO_TYPE_RUNEMATCH, _("Runematch")) \
+       GAMETYPE(MAPINFO_TYPE_TEAM_DEATHMATCH, _("Team Deathmatch")) \
+       /* nothing */
+
+float GameType_GetID(float cnt)
+{
+       float i;
+       i = 0;
+#define GAMETYPE(id,name) if(i++ == cnt) return id;
+       GAMETYPES
+#undef GAMETYPE
+       return 0;
+}
+string GameType_GetName(float cnt)
+{
+       float i;
+       i = 0;
+#define GAMETYPE(id,name) if(i++ == cnt) return name;
+       GAMETYPES
+#undef GAMETYPE
+       return _("@!#%'n Tuba Throwing");
+}
+float GameType_GetCount()
+{
+       float i;
+       i = 0;
+#define GAMETYPE(id,name) ++i;
+       GAMETYPES
+#undef GAMETYPE
+       return i;
+}
+
+string language_filename(string s)
+{
+       string fn;
+       float fh;
+       fn = cvar_string("prvm_language");
+       if(fn == "" || fn == "dump")
+               return s;
+       fn = strcat(s, ".", fn);
+       if((fh = fopen(fn, FILE_READ)) >= 0)
+       {
+               fclose(fh);
+               return fn;
+       }
+       return s;
+}
+
+void dialog_hudpanel_common_notoggle(entity me, string panelname)
+{
+       float i;
+       entity e;
+
+       me.TR(me);
+               me.TD(me, 1, 1.4, e = makeXonoticTextLabel(0, _("Background:")));
+                       me.TD(me, 1, 1.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg"))));
+                               e.addValue(e, _("Default"), "");
+                               e.addValue(e, _("Disable"), "0");
+                               e.addValue(e, strzone(strcat("border_", panelname)), strzone(strcat("border_", panelname)));
+                               e.configureXonoticTextSliderValues(e);
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Color:")));
+               me.TD(me, 2, 2.4, e = makeXonoticColorpickerString(strzone(strcat("hud_panel_", panelname, "_bg_color")), "hud_panel_bg_color"));
+                       setDependentStringNotEqual(e, strzone(strcat("hud_panel_", panelname, "_bg_color")), "");
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.2, e = makeXonoticCheckBoxString("", "1 1 1", strzone(strcat("hud_panel_", panelname, "_bg_color")), _("Use default")));
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Border size:")));
+                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_border"))));
+                               e.addValue(e, _("Default"), "");
+                               e.addValue(e, _("Disable"), "0");
+                               for(i = 1; i <= 10; ++i)
+                                       e.addValue(e, strzone(ftos_decimals(i * 2, 0)), strzone(ftos(i * 2)));
+                               e.configureXonoticTextSliderValues(e);
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Alpha:")));
+                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_alpha"))));
+                               e.addValue(e, _("Default"), "");
+                               for(i = 1; i <= 10; ++i)
+                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
+                               e.configureXonoticTextSliderValues(e);
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Team Color:")));
+                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_color_team"))));
+                               e.addValue(e, _("Default"), "");
+                               e.addValue(e, _("Disable"), "0");
+                               for(i = 1; i <= 10; ++i)
+                                       e.addValue(e, strzone(ftos_decimals(i/10, 1)), strzone(ftos(i/10)));
+                               e.configureXonoticTextSliderValues(e);
+       me.TR(me);
+               me.TDempty(me, 0.4);
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "hud_configure_teamcolorforced", _("Test the team color in HUD configure mode")));
+       me.TR(me);
+               me.TDempty(me, 0.2);
+               me.TD(me, 1, 1.2, e = makeXonoticTextLabel(0, _("Padding:")));
+                       me.TD(me, 1, 2.6, e = makeXonoticTextSlider(strzone(strcat("hud_panel_", panelname, "_bg_padding"))));
+                               e.addValue(e, _("Default"), "");
+                               for(i = 0; i <= 10; ++i)
+                                       e.addValue(e, strzone(ftos_decimals(i - 5, 0)), strzone(ftos(i - 5)));
+                               e.configureXonoticTextSliderValues(e);
+}
index ace912dc21394bbcde6a5a6e9398eb443eecbd7a..2cdfe87c7924b167dc92899b7beb41901a11a2ea 100644 (file)
@@ -1,3 +1,6 @@
+float GL_CheckExtension(string ext);
+float GL_Have_TextureCompression();
+
 void forAllDescendants(entity root, void(entity, entity) funcPre, void(entity, entity) funcPost, entity pass);
 void saveAllCvars(entity root);
 void loadAllCvars(entity root);
@@ -31,3 +34,19 @@ float URI_GET_CURL_END = 9;
 void Curl_URI_Get_Callback(float id, float status, string data);
 
 void URI_Get_Callback(float id, float status, string data);
+
+// game type list box stuff (does not NEED to contain all game types, other
+// types stay available via console)
+float GameType_GetID(float cnt);
+string GameType_GetName(float cnt);
+float GameType_GetCount();
+
+void dialog_hudpanel_common_notoggle(entity me, string panelname);
+#define DIALOG_HUDPANEL_COMMON_NOTOGGLE() \
+       dialog_hudpanel_common_notoggle(me, panelname)
+#define DIALOG_HUDPANEL_COMMON() \
+       me.TR(me); \
+               me.TD(me, 1, 3, e = makeXonoticCheckBox(0, strzone(strcat("hud_panel_", panelname)), _("Enable panel"))); \
+       DIALOG_HUDPANEL_COMMON_NOTOGGLE()
+
+string language_filename(string s);
index 1da6ad3ec6732043e3ad6abcd755b5d2993990e5..d00c60b09d8b47134f9f0a18c94ac7d007bfa08d 100644 (file)
@@ -1,3 +1,5 @@
+.float anticheat_jointime;
+
 void mean_accumulate(entity e, .float a, .float c, float mean, float value, float weight)
 {
        if(weight == 0)
@@ -67,14 +69,14 @@ void anticheat_physics()
        {
                if(time < self.anticheat_div0_evade_offset)
                        self.anticheat_div0_evade_v_angle = self.v_angle;
-               MEAN_ACCUMULATE(anticheat_div0_evade, 1 - (self.anticheat_div0_evade_forward_initial * v_forward), 1);
+               MEAN_ACCUMULATE(anticheat_div0_evade, 0.5 - 0.5 * (self.anticheat_div0_evade_forward_initial * v_forward), 1);
        }
 
-       MEAN_ACCUMULATE(anticheat_div0_strafebot_old, movement_oddity(self.movement, self.anticheat_div0_strafebot_movement_prev), max(0, sys_frametime - frametime));
+       MEAN_ACCUMULATE(anticheat_div0_strafebot_old, movement_oddity(self.movement, self.anticheat_div0_strafebot_movement_prev), 1);
        self.anticheat_div0_strafebot_movement_prev = self.movement;
 
        if(vlen(self.anticheat_div0_strafebot_forward_prev))
-               MEAN_ACCUMULATE(anticheat_div0_strafebot_new, 1 - (self.anticheat_div0_strafebot_forward_prev * v_forward), max(0, sys_frametime - frametime));
+               MEAN_ACCUMULATE(anticheat_div0_strafebot_new, 0.5 - 0.5 * (self.anticheat_div0_strafebot_forward_prev * v_forward), 1);
        self.anticheat_div0_strafebot_forward_prev = v_forward;
 
        // generic speedhack detection: correlate anticheat_speedhack_movetime (UPDATED BEFORE THIS) and server time
@@ -88,7 +90,7 @@ void anticheat_physics()
                self.anticheat_speedhack_offset = f;
        else
        {
-               MEAN_ACCUMULATE(anticheat_speedhack, fabs(f - self.anticheat_speedhack_offset), 1);
+               MEAN_ACCUMULATE(anticheat_speedhack, max(0, f - self.anticheat_speedhack_offset), 1);
                self.anticheat_speedhack_offset += (f - self.anticheat_speedhack_offset) * frametime * 0.1;
        }
 
@@ -151,14 +153,26 @@ void anticheat_prethink()
        self.anticheat_div0_evade_offset = 0;
 }
 
+string anticheat_display(float f, float tmin, float mi, float ma)
+{
+       string s;
+       s = ftos(f);
+       if(f <= mi)
+               return strcat(s, ":N");
+       if(f >= ma)
+               return strcat(s, ":Y");
+       return strcat(s, ":-");
+}
+
 void anticheat_report()
 {
        if(!autocvar_sv_eventlog)
                return;
-       GameLogEcho(strcat(":anticheat:speedhack:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_speedhack))));
-       GameLogEcho(strcat(":anticheat:div0_strafebot_old:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_div0_strafebot_old))));
-       GameLogEcho(strcat(":anticheat:div0_strafebot_new:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_div0_strafebot_new))));
-       GameLogEcho(strcat(":anticheat:div0_evade:", ftos(self.playerid), ":", ftos(MEAN_EVALUATE(anticheat_div0_evade))));
+       GameLogEcho(strcat(":anticheat:_time:", ftos(self.playerid), ":", ftos(servertime - self.anticheat_jointime)));
+       GameLogEcho(strcat(":anticheat:speedhack:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_speedhack), 240, 0.1, 0.15)));
+       GameLogEcho(strcat(":anticheat:div0_strafebot_old:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_div0_strafebot_old), 120, 0.3, 0.4)));
+       GameLogEcho(strcat(":anticheat:div0_strafebot_new:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_div0_strafebot_new), 120, 0.3, 0.4)));
+       GameLogEcho(strcat(":anticheat:div0_evade:", ftos(self.playerid), ":", anticheat_display(MEAN_EVALUATE(anticheat_div0_evade), 120, 0.1, 0.2)));
 }
 
 void anticheat_serverframe()
@@ -169,6 +183,7 @@ void anticheat_serverframe()
 void anticheat_init()
 {
        self.anticheat_speedhack_offset = 0;
+       self.anticheat_jointime = servertime;
 }
 
 void anticheat_shutdown()
index 0d7da73572a3083af09aff6a296b55afbe4fabf2..05b2cc750232e5fbc65a5136decf6d524c864fee 100644 (file)
@@ -71,7 +71,11 @@ void assault_objective_decrease_use() {
        }
 
        if(other.assault_sprite)
+       {
                WaypointSprite_Disown(other.assault_sprite, waypointsprite_deadlifetime);
+               if(other.classname == "func_assault_destructible")
+                       other.sprite = world;
+       }
        else
                return; // already activated! cannot activate again!
 
@@ -148,7 +152,11 @@ void target_objective_decrease_activate()
        for(ent = world; (ent = find(ent, target, self.targetname)); )
        {
                if(ent.assault_sprite != world)
+               {
                        WaypointSprite_Disown(ent.assault_sprite, waypointsprite_deadlifetime);
+                       if(ent.classname == "func_assault_destructible")
+                               ent.sprite = world;
+               }
 
                spr = WaypointSprite_SpawnFixed("<placeholder>", 0.5 * (ent.absmin + ent.absmax), ent, assault_sprite);
                spr.assault_decreaser = self;
@@ -156,7 +164,12 @@ void target_objective_decrease_activate()
                spr.classname = "sprite_waypoint";
                WaypointSprite_UpdateRule(spr, assault_attacker_team, SPRITERULE_TEAMPLAY);
                if(ent.classname == "func_assault_destructible")
+               {
                        WaypointSprite_UpdateSprites(spr, "as-defend", "as-destroy", "as-destroy");
+                       WaypointSprite_UpdateMaxHealth(spr, ent.max_health);
+                       WaypointSprite_UpdateHealth(spr, ent.health);
+                       ent.sprite = spr;
+               }
                else
                        WaypointSprite_UpdateSprites(spr, "as-defend", "as-push", "as-push");
                WaypointSprite_UpdateTeamRadar(spr, RADARICON_OBJECTIVE, '1 0.5 0');
index c5beab269911b3a761d0bd7fa9785b870a12bc32..e791e71440ad7e890abb8d57359f7760f1349525 100644 (file)
@@ -82,37 +82,38 @@ float autocvar_g_balance_armor_rot;
 float autocvar_g_balance_armor_rotlinear;
 float autocvar_g_balance_armor_rotstable;
 float autocvar_g_balance_armor_start;
-float autocvar_g_balance_campingrifle_auto_reload_on_switch;
-float autocvar_g_balance_campingrifle_bursttime;
-float autocvar_g_balance_campingrifle_magazinecapacity;
-float autocvar_g_balance_campingrifle_primary_ammo;
-float autocvar_g_balance_campingrifle_primary_animtime;
-float autocvar_g_balance_campingrifle_primary_bulletconstant;
-float autocvar_g_balance_campingrifle_primary_bullethail;
-float autocvar_g_balance_campingrifle_primary_burstcost;
-float autocvar_g_balance_campingrifle_primary_damage;
-float autocvar_g_balance_campingrifle_primary_force;
-float autocvar_g_balance_campingrifle_primary_headshotaddeddamage;
-float autocvar_g_balance_campingrifle_primary_lifetime;
-float autocvar_g_balance_campingrifle_primary_refire;
-float autocvar_g_balance_campingrifle_primary_speed;
-float autocvar_g_balance_campingrifle_primary_spread;
-float autocvar_g_balance_campingrifle_primary_tracer;
-float autocvar_g_balance_campingrifle_reloadtime;
-float autocvar_g_balance_campingrifle_secondary;
-float autocvar_g_balance_campingrifle_secondary_ammo;
-float autocvar_g_balance_campingrifle_secondary_animtime;
-float autocvar_g_balance_campingrifle_secondary_bulletconstant;
-float autocvar_g_balance_campingrifle_secondary_bullethail;
-float autocvar_g_balance_campingrifle_secondary_burstcost;
-float autocvar_g_balance_campingrifle_secondary_damage;
-float autocvar_g_balance_campingrifle_secondary_force;
-float autocvar_g_balance_campingrifle_secondary_headshotaddeddamage;
-float autocvar_g_balance_campingrifle_secondary_lifetime;
-float autocvar_g_balance_campingrifle_secondary_refire;
-float autocvar_g_balance_campingrifle_secondary_speed;
-float autocvar_g_balance_campingrifle_secondary_spread;
-float autocvar_g_balance_campingrifle_secondary_tracer;
+float autocvar_g_balance_sniperrifle_auto_reload_on_switch;
+float autocvar_g_balance_sniperrifle_bursttime;
+float autocvar_g_balance_sniperrifle_magazinecapacity;
+float autocvar_g_balance_sniperrifle_primary_ammo;
+float autocvar_g_balance_sniperrifle_primary_animtime;
+float autocvar_g_balance_sniperrifle_primary_bulletconstant;
+float autocvar_g_balance_sniperrifle_primary_bullethail;
+float autocvar_g_balance_sniperrifle_primary_burstcost;
+float autocvar_g_balance_sniperrifle_primary_damage;
+float autocvar_g_balance_sniperrifle_primary_force;
+float autocvar_g_balance_sniperrifle_primary_headshotaddeddamage;
+float autocvar_g_balance_sniperrifle_primary_lifetime;
+float autocvar_g_balance_sniperrifle_primary_refire;
+float autocvar_g_balance_sniperrifle_primary_speed;
+float autocvar_g_balance_sniperrifle_primary_spread;
+float autocvar_g_balance_sniperrifle_primary_tracer;
+float autocvar_g_balance_sniperrifle_reloadtime;
+float autocvar_g_balance_sniperrifle_secondary;
+float autocvar_g_balance_sniperrifle_secondary_ammo;
+float autocvar_g_balance_sniperrifle_secondary_animtime;
+float autocvar_g_balance_sniperrifle_secondary_bulletconstant;
+float autocvar_g_balance_sniperrifle_secondary_bullethail;
+float autocvar_g_balance_sniperrifle_secondary_burstcost;
+float autocvar_g_balance_sniperrifle_secondary_damage;
+float autocvar_g_balance_sniperrifle_secondary_force;
+float autocvar_g_balance_sniperrifle_secondary_headshotaddeddamage;
+float autocvar_g_balance_sniperrifle_secondary_lifetime;
+float autocvar_g_balance_sniperrifle_secondary_reload;
+float autocvar_g_balance_sniperrifle_secondary_refire;
+float autocvar_g_balance_sniperrifle_secondary_speed;
+float autocvar_g_balance_sniperrifle_secondary_spread;
+float autocvar_g_balance_sniperrifle_secondary_tracer;
 float autocvar_g_balance_cloaked_alpha;
 float autocvar_g_balance_crylink_primary_ammo;
 float autocvar_g_balance_crylink_primary_animtime;
@@ -121,6 +122,7 @@ float autocvar_g_balance_crylink_primary_bounces;
 float autocvar_g_balance_crylink_primary_damage;
 float autocvar_g_balance_crylink_primary_edgedamage;
 float autocvar_g_balance_crylink_primary_force;
+float autocvar_g_balance_crylink_primary_joindelay;
 float autocvar_g_balance_crylink_primary_joinexplode;
 float autocvar_g_balance_crylink_primary_joinexplode_damage;
 float autocvar_g_balance_crylink_primary_joinexplode_edgedamage;
@@ -146,6 +148,7 @@ float autocvar_g_balance_crylink_secondary_bounces;
 float autocvar_g_balance_crylink_secondary_damage;
 float autocvar_g_balance_crylink_secondary_edgedamage;
 float autocvar_g_balance_crylink_secondary_force;
+float autocvar_g_balance_crylink_secondary_joindelay;
 float autocvar_g_balance_crylink_secondary_joinexplode;
 float autocvar_g_balance_crylink_secondary_joinexplode_damage;
 float autocvar_g_balance_crylink_secondary_joinexplode_edgedamage;
@@ -388,6 +391,7 @@ float autocvar_g_balance_laser_primary_damage;
 float autocvar_g_balance_laser_primary_delay;
 float autocvar_g_balance_laser_primary_edgedamage;
 float autocvar_g_balance_laser_primary_force;
+float autocvar_g_balance_laser_primary_force_other_scale;
 float autocvar_g_balance_laser_primary_force_velocitybias;
 float autocvar_g_balance_laser_primary_force_zscale;
 float autocvar_g_balance_laser_primary_lifetime;
@@ -400,6 +404,7 @@ float autocvar_g_balance_laser_secondary_animtime;
 float autocvar_g_balance_laser_secondary_damage;
 float autocvar_g_balance_laser_secondary_edgedamage;
 float autocvar_g_balance_laser_secondary_force;
+float autocvar_g_balance_laser_secondary_force_other_scale;
 float autocvar_g_balance_laser_secondary_force_velocitybias;
 float autocvar_g_balance_laser_secondary_force_zscale;
 float autocvar_g_balance_laser_secondary_lifetime;
@@ -619,6 +624,7 @@ float autocvar_g_balance_tuba_refire;
 float autocvar_g_balance_uzi_bulletconstant;
 float autocvar_g_balance_uzi_burst;
 float autocvar_g_balance_uzi_burst_ammo;
+float autocvar_g_balance_uzi_burst_animtime;
 float autocvar_g_balance_uzi_burst_refire;
 float autocvar_g_balance_uzi_burst_refire2;
 float autocvar_g_balance_uzi_burst_spread;
@@ -719,9 +725,12 @@ float autocvar_g_freezetag_frozen_force;
 float autocvar_g_freezetag_point_leadlimit;
 float autocvar_g_freezetag_point_limit;
 float autocvar_g_freezetag_revive_extra_size;
-float autocvar_g_freezetag_revive_time;
+float autocvar_g_freezetag_revive_speed;
+float autocvar_g_freezetag_revive_clearspeed;
 float autocvar_g_freezetag_warmup;
 #define autocvar_g_friendlyfire cvar("g_friendlyfire")
+#define autocvar_g_friendlyfire_virtual cvar("g_friendlyfire_virtual")
+#define autocvar_g_friendlyfire_virtual_force cvar("g_friendlyfire_virtual_force")
 float autocvar_g_full_getstatus_responses;
 float autocvar_g_fullbrightitems;
 float autocvar_g_fullbrightplayers;
@@ -737,19 +746,23 @@ float autocvar_g_jetpack_attenuation;
 float autocvar_g_jetpack_fuel;
 float autocvar_g_jetpack_maxspeed_side;
 float autocvar_g_jetpack_maxspeed_up;
-float autocvar_g_keepaway_ballcarrier_alpha;
+float autocvar_g_keepaway_ballcarrier_effects;
 float autocvar_g_keepaway_ballcarrier_damage;
 float autocvar_g_keepaway_ballcarrier_force;
 float autocvar_g_keepaway_ballcarrier_highspeed;
 float autocvar_g_keepaway_ballcarrier_selfdamage;
 float autocvar_g_keepaway_ballcarrier_selfforce;
-float autocvar_g_keepaway_bckillscore;
 float autocvar_g_keepaway_noncarrier_damage;
 float autocvar_g_keepaway_noncarrier_force;
 float autocvar_g_keepaway_noncarrier_selfdamage;
 float autocvar_g_keepaway_noncarrier_selfforce;
 float autocvar_g_keepaway_noncarrier_warn;
+float autocvar_g_keepaway_score_bckill;
+float autocvar_g_keepaway_score_killac;
+float autocvar_g_keepaway_score_timepoints;
+float autocvar_g_keepaway_score_timeinterval;
 float autocvar_g_keepawayball_damageforcescale;
+float autocvar_g_keepawayball_effects;
 float autocvar_g_keepawayball_respawntime;
 float autocvar_g_keepawayball_trail_color;
 float autocvar_g_keyhunt_point_leadlimit;
@@ -789,7 +802,9 @@ float autocvar_g_midair_shieldtime;
 float autocvar_g_minstagib_ammo_drop;
 float autocvar_g_minstagib_extralives;
 float autocvar_g_minstagib_speed_highspeed;
+float autocvar_g_mirrordamage;
 #define autocvar_g_mirrordamage cvar("g_mirrordamage")
+#define autocvar_g_mirrordamage_virtual cvar("g_mirrordamage_virtual")
 float autocvar_g_monster_zombie_attack_run_damage;
 float autocvar_g_monster_zombie_attack_run_delay;
 float autocvar_g_monster_zombie_attack_run_force;
@@ -854,6 +869,7 @@ float autocvar_g_player_alpha;
 float autocvar_g_player_brightness;
 float autocvar_g_playerclip_collisions;
 string autocvar_g_playerstats_uri;
+float autocvar_g_playerstats_debug;
 float autocvar_g_powerup_shield;
 float autocvar_g_powerup_strength;
 float autocvar_g_powerup_superhealth;
@@ -1177,3 +1193,5 @@ float autocvar_timelimit_suddendeath;
 #define autocvar_utf8_enable cvar("utf8_enable")
 float autocvar_waypoint_benchmark;
 float autocvar_welcome_message_time;
+float autocvar_sv_gameplayfix_gravityunaffectedbyticrate;
+float autocvar_g_trueaim_minrange;
index 1911daf9e6a3ad2f5504995fac11f68b3256f5f1..9ef109e2b585e3c76053c7b183fbc49da22543ff 100644 (file)
@@ -353,18 +353,19 @@ float bot_aim(float shotspeed, float shotspeedupward, float maxshottime, float a
        {
                f = bot_aimdir(v - shotorg, r);
                //dprint("AIM: ");dprint(vtos(self.bot_aimtargorigin));dprint(" + ");dprint(vtos(self.bot_aimtargvelocity));dprint(" * ");dprint(ftos(self.bot_aimlatency + vlen(self.bot_aimtargorigin - shotorg) / shotspeed));dprint(" = ");dprint(vtos(v));dprint(" : aimdir = ");dprint(vtos(normalize(v - shotorg)));dprint(" : ");dprint(vtos(shotdir));dprint("\n");
-               traceline(shotorg, shotorg + shotdir * 10000, FALSE, self);
-               if (trace_ent.takedamage)
-               if (trace_fraction < 1)
-               if (!bot_shouldattack(trace_ent))
-                       return FALSE;
+               //traceline(shotorg, shotorg + shotdir * 10000, FALSE, self);
+               //if (trace_ent.takedamage)
+               //if (trace_fraction < 1)
+               //if (!bot_shouldattack(trace_ent))
+               //      return FALSE;
                traceline(shotorg, self.bot_aimtargorigin, FALSE, self);
                if (trace_fraction < 1)
                if (trace_ent != self.enemy)
                if (!bot_shouldattack(trace_ent))
                        return FALSE;
        }
-       if (r > maxshottime * shotspeed)
-               return FALSE;
-       return f;
+
+       //if (r > maxshottime * shotspeed)
+       //      return FALSE;
+       return TRUE;
 };
index d8287df1696934aa3481f4cfccf2c4240e697c4e..b7ee13b3721414edadc473d23dd3090b943ad7a3 100644 (file)
@@ -232,12 +232,14 @@ void havocbot_bunnyhop(vector dir)
                return;
 
        // Don't jump when using some weapons
+       /*
        if(self.aistatus & AI_STATUS_ATTACKING)
-       if(self.weapon & WEP_CAMPINGRIFLE)
+       if(self.weapon == WEP_SNIPERRIFLE)
                return;
 
        if(self.goalcurrent.classname == "player")
                return;
+       */
 
        maxspeed = autocvar_sv_maxspeed;
 
@@ -338,6 +340,7 @@ void havocbot_bunnyhop(vector dir)
        }
 
        // Release jump button
+       if(!cvar("sv_pogostick"))
        if(self.flags & FL_ONGROUND == 0)
        {
                if(self.velocity_z < 0 || vlen(self.velocity)<maxspeed)
@@ -890,7 +893,7 @@ void havocbot_chooseenemy()
 
                // I want to do a second scan if no enemy was found or I don't have weapons
                // TODO: Perform the scan when using the rifle (requires changes on the rifle code)
-               if(best || self.weapons) // || self.weapon == WEP_CAMPINGRIFLE
+               if(best || self.weapons) // || self.weapon == WEP_SNIPERRIFLE
                        break;
                if(i)
                        break;
@@ -944,28 +947,12 @@ void havocbot_chooseweapon()
                return;
 
        // Workaround for rifle reloading (..)
-       if(self.weapon == WEP_CAMPINGRIFLE)
-       if(i < autocvar_g_balance_campingrifle_reloadtime + 1)
+       if(self.weapon == WEP_SNIPERRIFLE)
+       if(i < autocvar_g_balance_sniperrifle_reloadtime + 1)
                return;
 
        local float w;
-       local float rocket  ; rocket   =-1000;
-       local float nex     ; nex      =-1000;
-       local float hagar   ; hagar    =-1000;
-       local float grenade ; grenade  =-1000;
-       local float mine    ; mine     =-1000;
-       local float electro ; electro  =-1000;
-       local float crylink ; crylink  =-1000;
-       local float uzi     ; uzi      =-1000;
-       local float shotgun ; shotgun  =-1000;
-       local float campingrifle ; campingrifle  =-1000;
-       local float laser   ; laser    =-1000;
-       local float minstanex ; minstanex =-1000;
-       local float bestscore; bestscore = 0;
-       local float bestweapon; bestweapon=self.switchweapon;
        local float distance; distance=bound(10,vlen(self.origin-self.enemy.origin)-200,10000);
-       local float maxdelaytime=0.5;
-       local float spreadpenalty=10;
 
        // Should it do a weapon combo?
        local float af, ct, combo_time, combo;
@@ -1200,7 +1187,7 @@ vector havocbot_dodge()
 {
        // LordHavoc: disabled because this is too expensive
        return '0 0 0';
-       /*
+#if 0
        local entity head;
        local vector dodge, v, n;
        local float danger, bestdanger, vl, d;
@@ -1245,5 +1232,5 @@ vector havocbot_dodge()
                head = head.chain;
        }
        return dodge;
-       */
+#endif
 };
index fea11ec930d644bd47feadd9804851e1581f73df..36c23473202d47d7f2e094103b0fccda9bfd3e5d 100644 (file)
@@ -2,15 +2,8 @@ void race_send_recordtime(float msg);
 void race_SendRankings(float pos, float prevpos, float del, float msg);
 
 void send_CSQC_teamnagger() {
-       WriteByte(0, SVC_TEMPENTITY);
-       WriteByte(0, TE_CSQC_TEAMNAGGER);
-}
-
-void send_CSQC_cr_maxbullets(entity e) {
-       msg_entity = e;
-       WriteByte(MSG_ONE, SVC_TEMPENTITY);
-       WriteByte(MSG_ONE, TE_CSQC_CR_MAXBULLETS);
-       WriteByte(MSG_ONE, autocvar_g_balance_campingrifle_magazinecapacity);
+       WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
+       WriteByte(MSG_BROADCAST, TE_CSQC_TEAMNAGGER);
 }
 
 void Announce(string snd) {
@@ -1072,6 +1065,8 @@ void PutClientInServer (void)
                self.cnt = self.switchweapon;
                self.weapon = 0;
 
+        self.wish_reload = 0;
+
                if(!self.alivetime)
                        self.alivetime = time;
        } else if(self.classname == "observer" || (g_ca && !allowed_to_spawn)) {
@@ -1112,8 +1107,10 @@ float ClientInit_SendEntity(entity to, float sf)
        WriteCoord(MSG_ENTITY, self.ebouncefactor); // g_balance_grenadelauncher_bouncefactor
        WriteCoord(MSG_ENTITY, self.ebouncestop); // g_balance_grenadelauncher_bouncestop
        WriteByte(MSG_ENTITY, autocvar_g_balance_nex_secondary); // client has to know if it should zoom or not
-       WriteByte(MSG_ENTITY, autocvar_g_balance_campingrifle_secondary); // client has to know if it should zoom or not
+       WriteByte(MSG_ENTITY, autocvar_g_balance_sniperrifle_secondary); // client has to know if it should zoom or not
        WriteByte(MSG_ENTITY, serverflags); // client has to know if it should zoom or not
+       WriteByte(MSG_ENTITY, autocvar_g_balance_sniperrifle_magazinecapacity); // rifle max bullets
+       WriteCoord(MSG_ENTITY, autocvar_g_trueaim_minrange);
        return TRUE;
 }
 
@@ -1371,7 +1368,7 @@ void ClientKill (void)
        {
                // do nothing
        }
-    else if(g_freezetag && self.freezetag_frozen == 1)
+    else if(self.freezetag_frozen)
     {
         // do nothing
     }
@@ -1741,8 +1738,6 @@ 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();
 
-       send_CSQC_cr_maxbullets(self);
-
        CheatInitClient();
 
        PlayerStats_AddPlayer(self);
@@ -2048,7 +2043,7 @@ void player_powerups (void)
                self.modelflags &~= MF_ROCKET;
        }
 
-       self.effects &~= (EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
+       self.effects &~= (EF_DIMLIGHT | EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT | EF_FLAME | EF_NODEPTHTEST);
 
        if(!self.modelindex || self.deadflag) // don't apply the flags if the player is gibbed
                return;
@@ -2901,7 +2896,7 @@ void PlayerPreThink (void)
        }
 
        if(!zoomstate_set)
-               SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_CAMPINGRIFLE && autocvar_g_balance_campingrifle_secondary == 0));
+               SetZoomState(self.BUTTON_ZOOM || (self.BUTTON_ATCK2 && self.weapon == WEP_NEX) || (self.BUTTON_ATCK2 && self.weapon == WEP_SNIPERRIFLE && autocvar_g_balance_sniperrifle_secondary == 0));
 
        float oldspectatee_status;
        oldspectatee_status = self.spectatee_status;
index e2feca927b94472af9ff963e1c01d141be5d2d01..a2773fedfd5a00ad6b7dfe4cf605aeecd88fd444 100644 (file)
@@ -23,7 +23,7 @@ When you press the jump key
 */
 void PlayerJump (void)
 {
-       if(g_freezetag && self.freezetag_frozen)
+       if(self.freezetag_frozen)
                return; // no jumping in freezetag when frozen
 
        float mjumpheight;
@@ -796,8 +796,6 @@ void SV_PlayerPhysics()
                bot_think();
        }
        
-       MUTATOR_CALLHOOK(PlayerPhysics);
-
        self.items &~= IT_USING_JETPACK;
 
        if(self.classname == "player")
@@ -830,6 +828,13 @@ void SV_PlayerPhysics()
        if (self.movetype == MOVETYPE_NONE)
                return;
 
+       // when we get here, disableclientprediction cannot be 2
+       self.disableclientprediction = 0;
+       if(time < self.ladder_time)
+               self.disableclientprediction = 1;
+
+       MUTATOR_CALLHOOK(PlayerPhysics);
+
        maxspd_mod = 1;
 
        swampspd_mod = 1;
@@ -989,14 +994,21 @@ void SV_PlayerPhysics()
                // on a spawnfunc_func_ladder or swimming in spawnfunc_func_water
                self.flags &~= FL_ONGROUND;
 
+               float g;
+               g = autocvar_sv_gravity * frametime;
+               if(self.gravity)
+                       g *= self.gravity;
+               if(autocvar_sv_gameplayfix_gravityunaffectedbyticrate)
+               {
+                       g *= 0.5;
+                       self.velocity_z += g;
+               }
+
                self.velocity = self.velocity * (1 - frametime * autocvar_sv_friction);
                makevectors(self.v_angle);
                //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z;
                wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z;
-               if (self.gravity)
-                       self.velocity_z = self.velocity_z + self.gravity * autocvar_sv_gravity * frametime;
-               else
-                       self.velocity_z = self.velocity_z + autocvar_sv_gravity * frametime;
+               self.velocity_z += g;
                if (self.ladder_entity.classname == "func_water")
                {
                        f = vlen(wishvel);
index 342cbbc3d69e4a8e6e9a011c246e14d892f24a09..ca0b2d4a16f0753e9e7529d7d7f4268a3b277b53 100644 (file)
@@ -325,11 +325,14 @@ void SpawnThrownWeapon (vector org, float w)
                {
                        if(self.weapons & W_WeaponBit(j))
                                if(W_IsWeaponThrowable(j))
-                                       W_ThrowNewWeapon(self, j, FALSE, self.origin, randomvec() * 175 + '0 0 325');
+                                       W_ThrowNewWeapon(self, j, FALSE, org, randomvec() * 175 + '0 0 325');
                }
        }
        else
-               W_ThrowWeapon(randomvec() * 125 + '0 0 200', org - self.origin, FALSE);
+       {
+               if(W_IsWeaponThrowable(self.weapon))
+                       W_ThrowNewWeapon(self, self.weapon, FALSE, org, randomvec() * 125 + '0 0 200');
+       }
 }
 
 void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
@@ -387,7 +390,6 @@ void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float
 
 void ClientKill_Now_TeamChange();
 void freezetag_CheckWinner();
-void freezetag_Unfreeze();
 
 void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
 {
@@ -631,9 +633,6 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                frag_target = self;
                MUTATOR_CALLHOOK(PlayerDies);
 
-               if(g_freezetag)
-            return;
-
                if(self.flagcarried)
                {
                        if(attacker.classname != "player" && attacker.classname != "gib")
@@ -646,8 +645,31 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                if(self.ballcarried && g_nexball)
                        DropBall(self.ballcarried, self.origin, self.velocity);
                Portal_ClearAllLater(self);
-               // clear waypoints
+
+               if(clienttype(self) == CLIENTTYPE_REAL)
+               {
+                       stuffcmd(self, "-zoom\n");
+                       self.fixangle = TRUE;
+                       //msg_entity = self;
+                       //WriteByte (MSG_ONE, SVC_SETANGLE);
+                       //WriteAngle (MSG_ONE, self.v_angle_x);
+                       //WriteAngle (MSG_ONE, self.v_angle_y);
+                       //WriteAngle (MSG_ONE, 80);
+               }
+
+               if(defer_ClientKill_Now_TeamChange) // TODO does this work with FreezeTag?
+                       ClientKill_Now_TeamChange();
+
+               if(g_arena)
+                       Spawnqueue_Unmark(self);
+
+               if(g_freezetag)
+                       return;
+
+               // when we get here, player actually dies
+               // clear waypoints (do this AFTER FreezeTag)
                WaypointSprite_PlayerDead();
+
                // make the corpse upright (not tilted)
                self.angles_x = 0;
                self.angles_z = 0;
@@ -669,12 +691,12 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                waves = 0;
                sdelay = cvar(strcat("g_", GetGametype(), "_respawn_delay"));
                if(!sdelay)
-        {
-            if(g_cts)
-                sdelay = 0; // no respawn delay in CTS
-            else
-                sdelay = autocvar_g_respawn_delay;
-        }
+               {
+                       if(g_cts)
+                               sdelay = 0; // no respawn delay in CTS
+                       else
+                               sdelay = autocvar_g_respawn_delay;
+               }
                waves = cvar(strcat("g_", GetGametype(), "_respawn_waves"));
                if(!waves)
                        waves = autocvar_g_respawn_waves;
@@ -703,31 +725,15 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                // set up to fade out later
                SUB_SetFade (self, time + 6 + random (), 1);
 
-               if(clienttype(self) == CLIENTTYPE_REAL)
-               {
-                       self.fixangle = TRUE;
-                       //msg_entity = self;
-                       //WriteByte (MSG_ONE, SVC_SETANGLE);
-                       //WriteAngle (MSG_ONE, self.v_angle_x);
-                       //WriteAngle (MSG_ONE, self.v_angle_y);
-                       //WriteAngle (MSG_ONE, 80);
-               }
-
-               if(g_arena)
-                       Spawnqueue_Unmark(self);
-
-               if(defer_ClientKill_Now_TeamChange)
-                       ClientKill_Now_TeamChange();
-
                if(sv_gentle > 0 || autocvar_ekg) {
                        // remove corpse
                        PlayerCorpseDamage (inflictor, attacker, 100.0, deathtype, hitloc, force);
                }
 
                // reset fields the weapons may use just in case
-        for (j = WEP_FIRST; j <= WEP_LAST; ++j)
+               for (j = WEP_FIRST; j <= WEP_LAST; ++j)
                {
-            weapon_action(j, WR_RESETPLAYER);
+                       weapon_action(j, WR_RESETPLAYER);
                        ATTACK_FINISHED_FOR(self, j) = 0;
                }
        }
index 6de63b9377fd76893498adebe0507247737e3fe1..864dd77fce788cc1696e7bbdee82ac3309748a89 100644 (file)
@@ -1,8 +1,6 @@
 void W_Reload()
 {
-       if(self.switchweapon == self.weapon)
-       if(self.weaponentity.state == WS_READY)
-               weapon_action(self.weapon, WR_RELOAD);
+    self.wish_reload = 1;
 }
 
 // switch between weapons
@@ -236,6 +234,20 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
 float W_IsWeaponThrowable(float w)
 {
        float wb, wa;
+
+       if (!autocvar_g_pickup_items)
+               return 0;
+       if (g_weaponarena)
+               return 0;
+       if (g_lms)
+               return 0;
+       if (g_ca)
+               return 0;
+       if (g_cts)
+               return 0;
+       if (g_nexball && w == WEP_GRENADE_LAUNCHER)
+               return 0;
+
        wb = W_WeaponBit(w);
        if(!wb)
                return 0;
@@ -265,25 +277,13 @@ void W_ThrowWeapon(vector velo, vector delta, float doreduce)
                return; // just in case
        if(MUTATOR_CALLHOOK(ForbidThrowCurrentWeapon))
                return;
-       if (g_weaponarena)
-               return;
-       if (g_lms)
-               return;
-       if (g_nexball && w == WEP_GRENADE_LAUNCHER)
-               return;
-       if (!autocvar_g_pickup_items)
-               return;
-       if (g_ca)
-               return;
-    if (g_cts)
-        return;
        if(!autocvar_g_weapon_throwable)
                return;
        if(autocvar_g_weapon_stay == 1)
                return;
-       if(!W_IsWeaponThrowable(w))
+       if(self.weaponentity.state != WS_READY)
                return;
-       if(self.deadflag == DEAD_NO && self.weaponentity.state != WS_READY)
+       if(!W_IsWeaponThrowable(w))
                return;
 
        wb = W_WeaponBit(w);
@@ -295,13 +295,10 @@ void W_ThrowWeapon(vector velo, vector delta, float doreduce)
        a = W_ThrowNewWeapon(self, w, doreduce, self.origin + delta, velo);
        if not(a)
                return;
-       if(self.health >= 1)
-       {
-               if(a == "")
-                       sprint(self, strcat("You dropped the ^2", W_Name(w), "\n"));
-               else
-                       sprint(self, strcat("You dropped the ^2", W_Name(w), " with ", a, "\n"));
-       }
+       if(a == "")
+               sprint(self, strcat("You dropped the ^2", W_Name(w), "\n"));
+       else
+               sprint(self, strcat("You dropped the ^2", W_Name(w), " with ", a, "\n"));
 };
 
 // Bringed back weapon frame
index 4f5e7604448fc0e7458a91be39f81fc4808f9f20..057c5cb1dc767fde25d85b66a61ca8ee519cbf32 100644 (file)
@@ -138,7 +138,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
        local float oldsolid;
        vector vecs, dv;
        oldsolid = ent.dphitcontentsmask;
-       if(ent.weapon == WEP_CAMPINGRIFLE)
+       if(ent.weapon == WEP_SNIPERRIFLE)
                ent.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_CORPSE;
        else
                ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
@@ -158,6 +158,10 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector m
        v_right = vr;
        v_up = vu;
 
+       // un-adjust trueaim if shotend is too close
+       if(vlen(w_shotend - (ent.origin + ent.view_ofs)) < autocvar_g_trueaim_minrange)
+               w_shotend = ent.origin + ent.view_ofs + s_forward * autocvar_g_trueaim_minrange;
+
        // track max damage
        if(accuracy_canbegooddamage(ent))
                accuracy_add(ent, ent.weapon, maxdamage, 0);
index 86a57d460b42a5d952bc09785dad450ec23b2648..970c86af429ecf3c4ef267ca4ef62b145e1afcad 100644 (file)
@@ -612,7 +612,8 @@ float client_cefc_accumulator;
 float client_cefc_accumulatortime;
 #endif
 
-.float campingrifle_bulletcounter;
+.float sniperrifle_bulletcounter;
+.float wish_reload;
 
 #define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
 // when doing this, hagar can go through clones
@@ -658,5 +659,7 @@ float serverflags;
 .float team_forced; // can be a team number to force a team, or 0 for default action, or -1 for forced spectator
 
 .float freezetag_frozen;
-.float freezetag_beginrevive_time;
 .float freezetag_revive_progress;
+
+.entity muzzle_flash;
+.float misc_bulletcounter;     // replaces uzi & hlac bullet counter.
index 44605ddeee793899a83ad425d6ed0182a4a856e2..3af433aceb075b966993512f0f42f330906bc487 100644 (file)
@@ -122,6 +122,11 @@ void func_breakable_behave_destroyed()
 void func_breakable_behave_restore()
 {
        self.health = self.max_health;
+       if(self.sprite)
+       {
+               WaypointSprite_UpdateMaxHealth(self.sprite, self.max_health);
+               WaypointSprite_UpdateHealth(self.sprite, self.health);
+       }
        self.takedamage = DAMAGE_AIM;
        self.event_damage = func_breakable_damage;
        self.state = 0;
@@ -180,9 +185,12 @@ void func_breakable_damage(entity inflictor, entity attacker, float damage, floa
        if(self.team)
                if(attacker.team == self.team)
                        return;
+       self.health = self.health - damage;
        if(self.sprite)
+       {
                WaypointSprite_Ping(self.sprite);
-       self.health = self.health - damage;
+               WaypointSprite_UpdateHealth(self.sprite, self.health);
+       }
        func_breakable_colormod();
 
        if(self.health <= 0)
index 0d0c90d0d829b227da455fe0eabe28c439193375..e1ee5706856c05e98fd49c717c20bb6dee0277eb 100644 (file)
@@ -120,14 +120,12 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype)
                {
                        // teamkill
                        PlayerScore_Add(attacker, SP_KILLS, -1); // or maybe add a teamkills field?
-                       PlayerStats_Event(attacker, PLAYERSTATS_KILLS, -1);
                }
        }
        else
        {
                // regular frag
                PlayerScore_Add(attacker, SP_KILLS, 1);
-               PlayerStats_Event(attacker, PLAYERSTATS_KILLS, 1);
        }
 
        PlayerScore_Add(targ, SP_DEATHS, 1);
@@ -203,6 +201,8 @@ void GiveFrags (entity attacker, entity targ, float f, float deathtype)
                        {
                                if(!lms_next_place)
                                        lms_next_place = player_count;
+                               else
+                                       lms_next_place = min(lms_next_place, player_count);
                                PlayerScore_Add(targ, SP_LMS_RANK, lms_next_place); // won't ever spawn again
                                --lms_next_place;
                        }
@@ -369,6 +369,8 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                        // TODO: make these print a newline if they dont
                                        Send_CSQC_Centerprint(attacker, "", "", KILL_FIRST_BLOOD, MSG_KILL);
                                        Send_CSQC_Centerprint(targ, "", "", KILL_FIRST_VICTIM, MSG_KILL);
+                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD, 1);
+                                       PlayerStats_Event(targ, PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM, 1);
                                }
 
                                if((autocvar_sv_fragmessage_information_typefrag) && (targ.BUTTON_CHAT)) {
@@ -414,36 +416,43 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                                {
                                        Send_KillNotification(a, "", "", KILL_SPREE_3, MSG_SPREE);
                                        AnnounceTo(attacker, "03kills");
+                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3, 1);
                                }
                                else if (attacker.killcount == 5)
                                {
                                        Send_KillNotification(a, "", "", KILL_SPREE_5, MSG_SPREE);
                                        AnnounceTo(attacker, "05kills");
+                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5, 1);
                                }
                                else if (attacker.killcount == 10)
                                {
                                        Send_KillNotification(a, "", "", KILL_SPREE_10, MSG_SPREE);
                                        AnnounceTo(attacker, "10kills");
+                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10, 1);
                                }
                                else if (attacker.killcount == 15)
                                {
                                        Send_KillNotification(a, "", "", KILL_SPREE_15, MSG_SPREE);
                                        AnnounceTo(attacker, "15kills");
+                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15, 1);
                                }
                                else if (attacker.killcount == 20)
                                {
                                        Send_KillNotification(a, "", "", KILL_SPREE_20, MSG_SPREE);
                                        AnnounceTo(attacker, "20kills");
+                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20, 1);
                                }
                                else if (attacker.killcount == 25)
                                {
                                        Send_KillNotification(a, "", "", KILL_SPREE_25, MSG_SPREE);
                                        AnnounceTo(attacker, "25kills");
+                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25, 1);
                                }
                                else if (attacker.killcount == 30)
                                {
                                        Send_KillNotification(a, "", "", KILL_SPREE_30, MSG_SPREE);
                                        AnnounceTo(attacker, "30kills");
+                                       PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30, 1);
                                }
                                LogDeath("frag", deathtype, attacker, targ);
                        }
@@ -461,6 +470,7 @@ void Obituary (entity attacker, entity inflictor, entity targ, float deathtype)
                        GiveFrags(targ, targ, -1, deathtype);
                        if(PlayerScore_Add(targ, SP_SCORE, 0) == -5) {
                                AnnounceTo(targ, "botlike");
+                               PlayerStats_Event(attacker, PLAYERSTATS_ACHIEVEMENT_BOTLIKE, 1);
                        }
                        Send_KillNotification(s, msg, "", deathtype, MSG_KILL_ACTION);
 
@@ -582,6 +592,29 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                                        else
                                                                damage = autocvar_g_friendlyfire * damage;
                                                        // mirrordamage will be used LATER
+
+                                                       if(autocvar_g_mirrordamage_virtual)
+                                                       {
+                                                               vector v;
+                                                               v = healtharmor_applydamage(attacker.armorvalue, autocvar_g_balance_armor_blockpercent, mirrordamage);
+                                                               attacker.dmg_take += v_x;
+                                                               attacker.dmg_save += v_y;
+                                                               attacker.dmg_inflictor = inflictor;
+                                                               mirrordamage = 0;
+                                                               mirrorforce = 0;
+                                                       }
+
+                                                       if(autocvar_g_friendlyfire_virtual)
+                                                       {
+                                                               vector v;
+                                                               v = healtharmor_applydamage(targ.armorvalue, autocvar_g_balance_armor_blockpercent, damage);
+                                                               targ.dmg_take += v_x;
+                                                               targ.dmg_save += v_y;
+                                                               targ.dmg_inflictor = inflictor;
+                                                               damage = 0;
+                                if(!autocvar_g_friendlyfire_virtual_force)
+                                    force = '0 0 0';
+                                                       }
                                                }
                                                else
                                                        damage = 0;
@@ -623,12 +656,11 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                        if (DEATH_ISWEAPON(deathtype, WEP_LASER))
                        {
                                damage = 0;
+                               mirrordamage = 0;
                                if (targ != attacker)
                                {
                                        if ((targ.health >= 1) && (targ.classname == "player"))
                                                centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, "Secondary fire inflicts no damage!"));
-                                       damage = 0;
-                                       mirrordamage = 0;
                                        force = '0 0 0';
                                        // keep mirrorforce
                                        attacker = targ;
@@ -757,7 +789,9 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                {
                                        if(damage > 0)
                                        {
-                                               if(attacker.weapon != WEP_ELECTRO && attacker.weapon != WEP_LASER || ((attacker.weapon == WEP_ELECTRO && autocvar_g_balance_electro_lightning || attacker.weapon == WEP_LASER) && attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time))
+                                               if(attacker.weapon != WEP_LASER
+                                               && (attacker.weapon != WEP_ELECTRO || !autocvar_g_balance_electro_lightning)
+                                               && attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time)
                                                {
                                                        if(targ.BUTTON_CHAT)
                                                                attacker.typehitsound += 1;
@@ -788,8 +822,12 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                }
                                else
                                {
-                                       if(deathtype != DEATH_FIRE)
+                                       if(deathtype != DEATH_FIRE
+                                       && attacker.prevhitsound + autocvar_sv_hitsound_antispam_time < time)
+                                       {
                                                attacker.typehitsound += 1;
+                                               attacker.prevhitsound = time;
+                                       }
                                        if(mirrordamage > 0)
                                                if(time > attacker.teamkill_complain)
                                                {
@@ -858,17 +896,18 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
        {
                attacker = attacker_save;
                if(g_minstagib)
-                       if(mirrordamage > 0)
+               if(mirrordamage > 0)
+               {
+                       // just lose extra LIVES, don't kill the player for mirror damage
+                       if(attacker.armorvalue > 0)
                        {
-                               // just lose extra LIVES, don't kill the player for mirror damage
-                               if(attacker.armorvalue > 0)
-                               {
-                                       attacker.armorvalue = attacker.armorvalue - 1;
-                                       centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, "^3Remaining extra lives: ",ftos(attacker.armorvalue)));
-                                       attacker.hitsound += 1;
-                               }
-                               mirrordamage = 0;
+                               attacker.armorvalue = attacker.armorvalue - 1;
+                               centerprint(attacker, strcat(DAMAGE_CENTERPRINT_SPACER, "^3Remaining extra lives: ",ftos(attacker.armorvalue)));
+                               attacker.hitsound += 1;
                        }
+                       mirrordamage = 0;
+               }
+
                force = normalize(attacker.origin + attacker.view_ofs - hitloc) * mirrorforce;
                Damage(attacker, inflictor, attacker, mirrordamage, DEATH_MIRRORDAMAGE, attacker.origin, force);
        }
@@ -998,33 +1037,47 @@ float RadiusDamage (entity inflictor, entity attacker, float coredamage, float e
                                                // laser force adjustments :P
                                                if(DEATH_WEAPONOF(deathtype) == WEP_LASER)
                                                {
-                                                       vector vel;
-
-                                                       float force_zscale;
-                                                       float force_velocitybiasramp;
-                                                       float force_velocitybias;
-
-                                                       force_velocitybiasramp = autocvar_sv_maxspeed;
-                                                       if(deathtype & HITTYPE_SECONDARY)
-                                                       {
-                                                               force_zscale = autocvar_g_balance_laser_secondary_force_zscale;
-                                                               force_velocitybias = autocvar_g_balance_laser_secondary_force_velocitybias;
-                                                       }
-                                                       else
-                                                       {
-                                                               force_zscale = autocvar_g_balance_laser_primary_force_zscale;
-                                                               force_velocitybias = autocvar_g_balance_laser_primary_force_velocitybias;
-                                                       }
-
-                                                       vel = targ.velocity;
-                                                       vel_z = 0;
-                                                       vel = normalize(vel) * bound(0, vlen(vel) / force_velocitybiasramp, 1) * force_velocitybias;
-                                                       force =
-                                                               vlen(force)
-                                                               *
-                                                               normalize(normalize(force) + vel);
-
-                                                       force_z *= force_zscale;
+                            if (targ == attacker)
+                            {
+                                vector vel;
+
+                                float force_zscale;
+                                float force_velocitybiasramp;
+                                float force_velocitybias;
+
+                                force_velocitybiasramp = autocvar_sv_maxspeed;
+                                if(deathtype & HITTYPE_SECONDARY)
+                                {
+                                    force_zscale = autocvar_g_balance_laser_secondary_force_zscale;
+                                    force_velocitybias = autocvar_g_balance_laser_secondary_force_velocitybias;
+                                }
+                                else
+                                {
+                                    force_zscale = autocvar_g_balance_laser_primary_force_zscale;
+                                    force_velocitybias = autocvar_g_balance_laser_primary_force_velocitybias;
+                                }
+
+                                vel = targ.velocity;
+                                vel_z = 0;
+                                vel = normalize(vel) * bound(0, vlen(vel) / force_velocitybiasramp, 1) * force_velocitybias;
+                                force =
+                                    vlen(force)
+                                    *
+                                    normalize(normalize(force) + vel);
+
+                                force_z *= force_zscale;
+                            }
+                            else
+                            {
+                                if(deathtype & HITTYPE_SECONDARY)
+                                {
+                                    force *= autocvar_g_balance_laser_secondary_force_other_scale;
+                                }
+                                else
+                                {
+                                    force *= autocvar_g_balance_laser_primary_force_other_scale;
+                                }
+                            }
                                                }
 
                                                //if (targ == attacker)
@@ -1197,6 +1250,10 @@ void Fire_ApplyDamage(entity e)
        if(e.watertype != CONTENT_LAVA)
                e.fire_endtime = 0;
 
+       // ice stops fire
+       if(e.freezetag_frozen)
+               e.fire_endtime = 0;
+
        t = min(frametime, e.fire_endtime - time);
        d = e.fire_damagepersec * t;
 
index ef379b9bc53bc0048d76bd335c4307c28f1b9735..dd6d73effd8aae382ae92c4d40bf16807faa9b2b 100644 (file)
@@ -332,6 +332,9 @@ void FireGrapplingHook (void)
        if((arena_roundbased && time < warmup) || (time < game_starttime))
                return;
 
+    if(self.freezetag_frozen)
+        return;
+
        makevectors(self.v_angle);
 
        s = self.cvar_cl_gunalign;
@@ -370,7 +373,7 @@ void FireGrapplingHook (void)
        //missile.glow_size = 120;
        missile.touch = GrapplingHookTouch;
        missile.think = GrapplingHookThink;
-       missile.nextthink = time + 0.1;
+       missile.nextthink = time;
 
        missile.effects = /*EF_FULLBRIGHT | EF_ADDITIVE |*/ EF_LOWPRECISION;
 
index 47f3a5a699b8daa78b7d9a896304a5ae681a6a0c..8ba71e4655822bc988c645cf0e354dd51a3d06ff 100644 (file)
@@ -698,6 +698,33 @@ void LODmodel_attach()
                        SetCustomizer(self, LOD_customize, LOD_uncustomize);
 }
 
+void ApplyMinMaxScaleAngles(entity e)
+{
+       if(e.angles_x != 0 || e.angles_z != 0 || self.avelocity_x != 0 || self.avelocity_z != 0) // "weird" rotation
+       {
+               e.maxs = '1 1 1' * vlen(
+                       '1 0 0' * max(-e.mins_x, e.maxs_x) +
+                       '0 1 0' * max(-e.mins_y, e.maxs_y) +
+                       '0 0 1' * max(-e.mins_z, e.maxs_z)
+               );
+               e.mins = -e.maxs;
+       }
+       else if(e.angles_y != 0 || self.avelocity_y != 0) // yaw only is a bit better
+       {
+               e.maxs_x = vlen(
+                       '1 0 0' * max(-e.mins_x, e.maxs_x) +
+                       '0 1 0' * max(-e.mins_y, e.maxs_y)
+               );
+               e.maxs_y = e.maxs_x;
+               e.mins_x = -e.maxs_x;
+               e.mins_y = -e.maxs_x;
+       }
+       if(e.scale)
+               setsize(e, e.mins * e.scale, e.maxs * e.scale);
+       else
+               setsize(e, e.mins, e.maxs);
+}
+
 void SetBrushEntityModel()
 {
        if(self.model != "")
@@ -707,10 +734,7 @@ void SetBrushEntityModel()
                InitializeEntity(self, LODmodel_attach, INITPRIO_FINDTARGET);
        }
        setorigin(self, self.origin);
-       if(self.scale)
-               setsize(self, self.mins * self.scale, self.maxs * self.scale);
-       else
-               setsize(self, self.mins, self.maxs);
+       ApplyMinMaxScaleAngles(self);
 }
 
 void SetBrushEntityModelNoLOD()
@@ -721,10 +745,7 @@ void SetBrushEntityModelNoLOD()
                setmodel(self, self.model); // no precision needed
        }
        setorigin(self, self.origin);
-       if(self.scale)
-               setsize(self, self.mins * self.scale, self.maxs * self.scale);
-       else
-               setsize(self, self.mins, self.maxs);
+       ApplyMinMaxScaleAngles(self);
 }
 
 /*
index e2a123adc445f1a7eb0291001bf828357d6db770..67fb91fc2b91c45a64c57bcbb999c66bfea8c370 100644 (file)
@@ -311,31 +311,32 @@ void cvar_changes_init()
                BADCVAR("g_forced_team_pink");
 
                // mapinfo
-               BADCVAR("timelimit");
                BADCVAR("fraglimit");
-               BADCVAR("leadlimit");
-               BADCVAR("g_tdm_teams");
-               BADCVAR("g_keyhunt_teams");
-               BADCVAR("g_domination_default_teams");
-               BADCVAR("g_race_qualifying_timelimit");
-               BADCVAR("g_lms");
                BADCVAR("g_arena");
-               BADCVAR("g_ca");
                BADCVAR("g_assault");
+               BADCVAR("g_ca");
                BADCVAR("g_ctf");
+               BADCVAR("g_cts");
                BADCVAR("g_dm");
                BADCVAR("g_domination");
+               BADCVAR("g_domination_default_teams");
                BADCVAR("g_freezetag");
+               BADCVAR("g_keepaway");
                BADCVAR("g_keyhunt");
                BADCVAR("g_keyhunt_teams");
+               BADCVAR("g_keyhunt_teams");
+               BADCVAR("g_lms");
+               BADCVAR("g_nexball");
                BADCVAR("g_onslaught");
                BADCVAR("g_race");
-               BADCVAR("g_cts");
+               BADCVAR("g_race_qualifying_timelimit");
                BADCVAR("g_runematch");
                BADCVAR("g_tdm");
-               BADCVAR("g_nexball");
-               BADCVAR("g_keepaway");
+               BADCVAR("g_tdm_teams");
+               BADCVAR("leadlimit");
+               BADCVAR("nextmap");
                BADCVAR("teamplay");
+               BADCVAR("timelimit");
 
                // long
                BADCVAR("hostname");
@@ -363,22 +364,33 @@ void cvar_changes_init()
                // does nothing visible
                BADCVAR("captureleadlimit_override");
                BADCVAR("g_arena_point_leadlimit");
+               BADCVAR("g_balance_kill_delay");
                BADCVAR("g_ca_point_leadlimit");
+               BADCVAR("g_ctf_captimerecord_always");
                BADCVAR("g_ctf_capture_leadlimit");
+               BADCVAR("g_ctf_flag_capture_effects");
+               BADCVAR("g_ctf_flag_glowtrails");
+               BADCVAR("g_ctf_flag_pickup_effects");
                BADCVAR("g_domination_point_leadlimit");
+               BADCVAR("g_forced_respawn");
                BADCVAR("g_keyhunt_point_leadlimit");
                BADCVAR("g_nexball_goalleadlimit");
                BADCVAR("g_runematch_point_leadlimit");
                BADCVAR("leadlimit_and_fraglimit");
                BADCVAR("leadlimit_override");
-               BADCVAR("sv_checkforpacketsduringsleep");
                BADCVAR("pausable");
+               BADCVAR("sv_checkforpacketsduringsleep");
                BADCVAR("sv_timeout");
+               BADCVAR("welcome_message_time");
                BADPREFIX("crypto_");
                BADPREFIX("g_chat_");
+               BADPREFIX("g_ctf_captimerecord_");
+               BADPREFIX("g_maplist_votable_");
                BADPREFIX("net_");
                BADPREFIX("prvm_");
+               BADPREFIX("skill_");
                BADPREFIX("sv_fragmessage_");
+               BADPREFIX("sv_maxidle_");
                BADPREFIX("sv_vote_");
                BADPREFIX("timelimit_");
 
@@ -455,6 +467,7 @@ void cvar_changes_init()
                BADCVAR("timelimit_override");
                BADCVAR("g_warmup");
                BADPREFIX("g_warmup_");
+               BADCVAR("teamplay_mode");
 
                if(autocvar_g_minstagib)
                {
@@ -805,7 +818,7 @@ void spawnfunc_worldspawn (void)
        addstat(STAT_FUEL, AS_INT, ammo_fuel);
        addstat(STAT_SHOTORG, AS_INT, stat_shotorg);
        addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit);
-       addstat(STAT_BULLETS_LOADED, AS_INT, campingrifle_bulletcounter);
+       addstat(STAT_BULLETS_LOADED, AS_INT, sniperrifle_bulletcounter);
        addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);
 
        addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
@@ -1510,11 +1523,6 @@ void DumpStats(float final)
                fputs(file, ":end\n");
                fclose(file);
        }
-
-       // send statistics
-       FOR_EACH_CLIENT(e)
-               PlayerStats_AddGlobalInfo(e);
-       PlayerStats_Shutdown();
 }
 
 void FixIntermissionClient(entity e)
@@ -1583,6 +1591,13 @@ void NextLevel()
 
        DumpStats(TRUE);
 
+       // send statistics
+       entity e;
+       PlayerStats_EndMatch(1);
+       FOR_EACH_CLIENT(e)
+               PlayerStats_AddGlobalInfo(e);
+       PlayerStats_Shutdown();
+
        if(autocvar_sv_eventlog)
                GameLogEcho(":gameover");
 
@@ -2927,6 +2942,7 @@ void SV_Shutdown()
                print("Saving persistent data...\n");
                Ban_SaveBans();
 
+               PlayerStats_EndMatch(0);
                FOR_EACH_CLIENT(e)
                        PlayerStats_AddGlobalInfo(e);
                PlayerStats_Shutdown();
index 113e9f427df5b8105d918b7483e482142b3d4deb..849dcdab45197e62877c96d5bf124b1bd4443589 100644 (file)
@@ -915,8 +915,15 @@ void readplayerstartcvars()
 
        g_weaponarena = 0;
        s = cvar_string("g_weaponarena");
-       if (s == "0")
+       if (s == "0" || s == "")
        {
+               if(g_lms || g_ca)
+                       s = "most";
+       }
+
+       if (s == "off")
+       {
+               // forcibly turn off weaponarena
        }
        else if (s == "all")
        {
@@ -981,6 +988,40 @@ void readplayerstartcvars()
        if (g_weaponarena)
        {
                start_weapons = g_weaponarena;
+               if(!(g_lms || g_ca))
+                       start_items |= IT_UNLIMITED_AMMO;
+       }
+       else if (g_minstagib)
+       {
+               start_health = 100;
+               start_armorvalue = 0;
+               start_weapons = WEPBIT_MINSTANEX;
+               weapon_action(WEP_MINSTANEX, WR_PRECACHE);
+               g_minstagib_invis_alpha = cvar("g_minstagib_invis_alpha");
+
+               if (g_minstagib_invis_alpha <= 0)
+                       g_minstagib_invis_alpha = -1;
+       }
+       else
+       {
+               for (i = WEP_FIRST; i <= WEP_LAST; ++i)
+               {
+                       e = get_weaponinfo(i);
+                       if(want_weapon("g_start_weapon_", e, FALSE))
+                               start_weapons |= e.weapons;
+               }
+       }
+
+       if(!cvar("g_use_ammunition"))
+               start_items |= IT_UNLIMITED_AMMO;
+
+       if(g_minstagib)
+       {
+               start_ammo_cells = cvar("g_minstagib_ammo_start");
+               start_ammo_fuel = cvar("g_start_ammo_fuel");
+       }
+       else if(start_items & IT_UNLIMITED_WEAPON_AMMO)
+       {
                for (j = WEP_FIRST; j <= WEP_LAST; ++j)
                {
                        e = get_weaponinfo(j);
@@ -998,32 +1039,16 @@ void readplayerstartcvars()
                                        start_ammo_fuel = 999;
                        }
                }
-               start_items |= IT_UNLIMITED_AMMO;
-       }
-       else if (g_minstagib)
-       {
-               start_health = 100;
-               start_armorvalue = 0;
-               start_weapons = WEPBIT_MINSTANEX;
-               weapon_action(WEP_MINSTANEX, WR_PRECACHE);
-               start_ammo_cells = cvar("g_minstagib_ammo_start");
-               g_minstagib_invis_alpha = cvar("g_minstagib_invis_alpha");
-               start_ammo_fuel = cvar("g_start_ammo_fuel");
-
-               if (g_minstagib_invis_alpha <= 0)
-                       g_minstagib_invis_alpha = -1;
        }
        else
        {
-               if (g_lms || g_ca)
+               if(g_lms || g_ca)
                {
                        start_ammo_shells = cvar("g_lms_start_ammo_shells");
                        start_ammo_nails = cvar("g_lms_start_ammo_nails");
                        start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
                        start_ammo_cells = cvar("g_lms_start_ammo_cells");
                        start_ammo_fuel = cvar("g_lms_start_ammo_fuel");
-                       start_health = cvar("g_lms_start_health");
-                       start_armorvalue = cvar("g_lms_start_armor");
                }
                else
                {
@@ -1033,13 +1058,12 @@ void readplayerstartcvars()
                        start_ammo_cells = cvar("g_start_ammo_cells");
                        start_ammo_fuel = cvar("g_start_ammo_fuel");
                }
+       }
 
-               for (i = WEP_FIRST; i <= WEP_LAST; ++i)
-               {
-                       e = get_weaponinfo(i);
-                       if(want_weapon("g_start_weapon_", e, FALSE))
-                               start_weapons |= e.weapons;
-               }
+       if (g_lms || g_ca)
+       {
+               start_health = cvar("g_lms_start_health");
+               start_armorvalue = cvar("g_lms_start_armor");
        }
 
        if (inWarmupStage)
@@ -1080,22 +1104,6 @@ void readplayerstartcvars()
                warmup_start_ammo_fuel = max(warmup_start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
        }
 
-       if(!cvar("g_use_ammunition"))
-       {
-               start_ammo_shells = cvar("g_pickup_shells_max");
-               start_ammo_nails = cvar("g_pickup_nails_max");
-               start_ammo_rockets = cvar("g_pickup_rockets_max");
-               start_ammo_cells = cvar("g_pickup_cells_max");
-               start_ammo_fuel = cvar("g_pickup_fuel_max");
-               start_items |= IT_UNLIMITED_AMMO;
-               warmup_start_ammo_shells = cvar("g_pickup_shells_max");
-               warmup_start_ammo_nails = cvar("g_pickup_nails_max");
-               warmup_start_ammo_rockets = cvar("g_pickup_rockets_max");
-               warmup_start_ammo_cells = cvar("g_pickup_cells_max");
-               warmup_start_ammo_fuel = cvar("g_pickup_fuel_max");
-               //warmup_start_items |= IT_UNLIMITED_AMMO;
-       }
-
        if (g_jetpack)
                start_items |= IT_JETPACK;
 
@@ -2545,10 +2553,7 @@ float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, f
 
         // rule 6: we must not end up in trigger_hurt
         if (tracebox_hits_trigger_hurt(start, e.mins, e.maxs, enddown))
-        {
-            dprint("trigger_hurt! ouch! and nothing else could find it!\n");
             continue;
-        }
 
         break;
     }
index b7c523dcbbfd0853c80bab058559b380fb104f0d..aa581228bd474fc32a12bc885291d0ae9a0c9775 100644 (file)
@@ -94,6 +94,10 @@ MUTATOR_HOOKABLE(FilterItem);
        // checks if the current item may be spawned (self.items and self.weapons may be read and written to, as well as the ammo_ fields)
        // return error to request removal
 
+MUTATOR_HOOKABLE(TurretSpawn);
+       // return error to request removal
+       // INPUT: self - turret
+       
 MUTATOR_HOOKABLE(OnEntityPreSpawn);
        // return error to prevent entity spawn, or modify the entity
 
index a1cc9deb6c6b0ed39e1f4707b56912797f8e9de5..d09bbeecf6bfbb4f91ccf34c1c01821c001120fc 100644 (file)
@@ -2,6 +2,7 @@ void freezetag_Initialize()
 {
        precache_model("models/ice/ice.md3");
        warmup = time + autocvar_g_start_delay + autocvar_g_freezetag_warmup;
+       ScoreRules_freezetag();
 }
 
 void freezetag_CheckWinner()
@@ -22,6 +23,7 @@ void freezetag_CheckWinner()
 
        entity e, winner;
        string teamname;
+       winner = world;
 
        FOR_EACH_PLAYER(e)
        {
@@ -34,7 +36,6 @@ void freezetag_CheckWinner()
 
        if(winner != world) // just in case a winner wasn't found
        {
-               TeamScore_AddToTeam(winner.team, ST_SCORE, +1);
                if(winner.team == COLOR_TEAM1)
                        teamname = "^1Red Team";
                else if(winner.team == COLOR_TEAM2)
@@ -47,20 +48,27 @@ void freezetag_CheckWinner()
                        centerprint(e, strcat(teamname, "^5 wins the round, all other teams were frozen.\n"));
                }
                bprint(teamname, "^5 wins the round since all the other teams were frozen.\n");
+               TeamScore_AddToTeam(winner.team, ST_SCORE, +1);
        }
 
        next_round = time + 5;
 }
 
+// this is needed to allow the player to turn his view around (fixangle can't
+// be used to freeze his view, as that also changes the angles), while not
+// turning that ice object with the player
 void freezetag_Ice_Think()
 {
        setorigin(self, self.owner.origin - '0 0 16');
        self.nextthink = time;
 }
 
-void freezetag_Freeze()
+void freezetag_Freeze(entity attacker)
 {
+       if(self.freezetag_frozen)
+               return;
        self.freezetag_frozen = 1;
+       self.freezetag_revive_progress = 0;
 
        entity ice;
        ice = spawn();
@@ -71,7 +79,11 @@ void freezetag_Freeze()
        ice.frame = floor(random() * 21); // ice model has 20 different looking frames
        setmodel(ice, "models/ice/ice.md3");
 
-       self.movement = '0 0 0';
+       entity oldself;
+       oldself = self;
+       self = ice;
+       freezetag_Ice_Think();
+       self = oldself;
 
        // add waypoint
        WaypointSprite_Spawn("freezetag_frozen", 0, 0, self, '0 0 64', world, self.team, self, waypointsprite_attached, TRUE);
@@ -79,11 +91,30 @@ void freezetag_Freeze()
        {
                WaypointSprite_UpdateTeamRadar(self.waypointsprite_attached, RADARICON_WAYPOINT, '0.25 0.90 1');
        }
+
+       if(attacker == self)
+       {
+               // you froze your own dumb self
+               // counted as "suicide" already
+               PlayerScore_Add(self, SP_SCORE, -1);
+       }
+       else if(attacker.classname == "player")
+       {
+               // got frozen by an enemy
+               // counted as "kill" and "death" already
+               PlayerScore_Add(self, SP_SCORE, -1);
+               PlayerScore_Add(attacker, SP_SCORE, +1);
+       }
+       else
+       {
+               // nothing - got frozen by the game type rules themselves
+       }
 }
 
-void freezetag_Unfreeze()
+void freezetag_Unfreeze(entity attacker)
 {
        self.freezetag_frozen = 0;
+       self.freezetag_revive_progress = 0;
 
        // remove the ice block
        entity ice;
@@ -116,7 +147,7 @@ MUTATOR_HOOKFUNCTION(freezetag_RemovePlayer)
        if(totalspawned > 2) // only check for winners if we had more than two players (one of them left, don't let the other player win just because of that)
                freezetag_CheckWinner();
 
-       freezetag_Unfreeze();
+       freezetag_Unfreeze(world);
 
        return 1;
 }
@@ -135,7 +166,7 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDies)
                        --pinkalive;
                --totalalive;
 
-        freezetag_Freeze();
+        freezetag_Freeze(frag_attacker);
        }
 
     if(frag_attacker.classname == STR_PLAYER)
@@ -163,7 +194,7 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDies)
 
 MUTATOR_HOOKFUNCTION(freezetag_PlayerSpawn)
 {
-    freezetag_Unfreeze(); // start by making sure that all ice blocks are removed
+    freezetag_Unfreeze(world); // start by making sure that all ice blocks are removed
 
        if(totalspawned == 1 && time > game_starttime) // only one player active on server, start a new match immediately
        if(!next_round && warmup && (time < warmup - autocvar_g_freezetag_warmup || time > warmup)) // not awaiting next round
@@ -174,7 +205,7 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerSpawn)
        if(warmup && time > warmup) // spawn too late, freeze player
        {
                centerprint(self, "^1You spawned after the round started, you'll spawn as frozen.\n");
-               freezetag_Freeze();
+               freezetag_Freeze(world);
        }
 
        return 1;
@@ -188,64 +219,86 @@ MUTATOR_HOOKFUNCTION(freezetag_GiveFragsForKill)
 
 MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink)
 {
-    vector revive_extra_size;
-    revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
+       float n;
+       vector revive_extra_size;
 
-    float teammate_nearby;
-    FOR_EACH_PLAYER(other) if(self != other)
-    {
-        if(other.freezetag_frozen == 0)
-        {
-            if(other.team == self.team)
-            {
-                teammate_nearby = boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax);
-                if(teammate_nearby)
-                    break;
-            }
-        }
-    }
+       revive_extra_size = '1 1 1' * autocvar_g_freezetag_revive_extra_size;
 
-    if(teammate_nearby && self.freezetag_frozen == 1) // OK, there is at least one teammate reviving us
-    {
-        if(self.freezetag_beginrevive_time == -9999) // initialize values if this is the first frame of revival
-        {
-            self.freezetag_beginrevive_time = time;
-            self.freezetag_revive_progress = 0;
-        }
-        else
-        {
-            self.freezetag_revive_progress = (time - self.freezetag_beginrevive_time) / autocvar_g_freezetag_revive_time;
-            if(time - self.freezetag_beginrevive_time >= autocvar_g_freezetag_revive_time)
-            {
-                freezetag_Unfreeze();
-
-                centerprint(self, strcat("^5You were revived by ^7", other.netname, ".\n"));
-                centerprint(other, strcat("^5You revived ^7", self.netname, ".\n"));
-                bprint("^7", other.netname, "^5 revived ^7", self.netname, ".\n");
-
-                self.freezetag_beginrevive_time = -9999;
-                self.freezetag_revive_progress = 0;
-            }
-        }
-        // now find EVERY teammate within reviving radius, set their revive_progress values correct
-        FOR_EACH_PLAYER(other) if(self != other)
-        {
-            if(other.freezetag_frozen == 0)
-            {
-                if(other.team == self.team)
-                {
-                    teammate_nearby = boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax);
-                    if(teammate_nearby)
-                        other.freezetag_revive_progress = self.freezetag_revive_progress;
-                }
-            }
-        }
-    }
-    else if(!teammate_nearby) // only if no teammate is nearby will we reset
-    {
-        self.freezetag_beginrevive_time = -9999;
-        self.freezetag_revive_progress = 0;
-    }
+       entity o;
+       o = world;
+       n = 0;
+       FOR_EACH_PLAYER(other) if(self != other)
+       {
+               if(other.freezetag_frozen == 0)
+               {
+                       if(other.team == self.team)
+                       {
+                               if(boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax))
+                               {
+                                       if(!o)
+                                               o = other;
+                                       ++n;
+                               }
+                       }
+               }
+       }
+
+       if(n && self.freezetag_frozen) // OK, there is at least one teammate reviving us
+       {
+               self.freezetag_revive_progress = bound(0, self.freezetag_revive_progress + frametime * autocvar_g_freezetag_revive_speed, 1);
+
+               if(self.freezetag_revive_progress >= 1)
+               {
+                       freezetag_Unfreeze(self);
+
+                       // EVERY team mate nearby gets a point (even if multiple!)
+                       FOR_EACH_PLAYER(other) if(self != other)
+                       {
+                               if(other.freezetag_frozen == 0)
+                               {
+                                       if(other.team == self.team)
+                                       {
+                                               if(boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax))
+                                               {
+                                                       PlayerScore_Add(other, SP_FREEZETAG_REVIVALS, +1);
+                                                       PlayerScore_Add(other, SP_SCORE, +1);
+                                               }
+                                       }
+                               }
+                       }
+
+                       if(n > 1)
+                               centerprint(self, strcat("^5You were revived by ^7", o.netname, "^5 et al.\n"));
+                       else
+                               centerprint(self, strcat("^5You were revived by ^7", o.netname, "^5.\n"));
+                       centerprint(o, strcat("^5You revived ^7", self.netname, "^5.\n"));
+                       if(n > 1)
+                               bprint("^7", o.netname, "^5 et al revived ^7", self.netname, "^5.\n");
+                       else
+                               bprint("^7", o.netname, "^5 revived ^7", self.netname, "^5.\n");
+               }
+
+               // now find EVERY teammate within reviving radius, set their revive_progress values correct
+               FOR_EACH_PLAYER(other) if(self != other)
+               {
+                       if(other.freezetag_frozen == 0)
+                       {
+                               if(other.team == self.team)
+                               {
+                                       if(boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax))
+                                               other.freezetag_revive_progress = self.freezetag_revive_progress;
+                               }
+                       }
+               }
+       }
+       else if(!n && self.freezetag_frozen) // only if no teammate is nearby will we reset
+       {
+               self.freezetag_revive_progress = bound(0, self.freezetag_revive_progress - frametime * autocvar_g_freezetag_revive_clearspeed, 1);
+       }
+       else if(!n)
+       {
+               self.freezetag_revive_progress = 0; // thawing nobody
+       }
 
        return 1;
 }
@@ -253,7 +306,10 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink)
 MUTATOR_HOOKFUNCTION(freezetag_PlayerPhysics)
 {
        if(self.freezetag_frozen)
+       {
                self.movement = '0 0 0';
+               self.disableclientprediction = 1;
+       }
        return 1;
 }
 
index 9fb47afbb354310890b7319fdc28555497ce36e4..a23169c37346758fb1c7adbec38f8586f74d30f7 100644 (file)
@@ -2,6 +2,7 @@ void ka_SpawnBall(void);
 void ka_TouchEvent(void);
 void ka_RespawnBall(void);
 void ka_DropEvent(entity);
+void ka_TimeScoring(void);
 
 float ka_ballcarrier_waypointsprite_visible_for_player(entity);
 
@@ -28,26 +29,26 @@ void ka_Reset() // used to clear the ballcarrier whenever the match switches fro
        ka_RespawnBall();
 }
 
-void ka_SpawnBall() // loads various values for the ball
+void ka_SpawnBall() // loads various values for the ball, runs only once at start of match
 {
        if(!g_keepaway) { return; }
        
        entity e;
        e = spawn();
        e.model = "models/orbs/orbblue.md3";    
-       e.scale = 1;
        precache_model(e.model);
        setmodel(e, e.model);
        setsize(e, '-16 -16 -20', '16 16 20'); // 20 20 20 was too big, player is only 16 16 24... gotta cheat with the Z (20) axis so that the particle isn't cut off
        e.classname = "keepawayball";
        e.damageforcescale = autocvar_g_keepawayball_damageforcescale;
        e.takedamage = DAMAGE_YES;
+       e.solid = SOLID_TRIGGER;
+       e.movetype = MOVETYPE_BOUNCE;
        e.glow_color = autocvar_g_keepawayball_trail_color;
        e.glow_trail = TRUE;
-       e.movetype = MOVETYPE_BOUNCE;
-       e.touch = ka_TouchEvent;
        e.flags = FL_ITEM;
        e.reset = ka_Reset;
+       e.touch = ka_TouchEvent;
        e.owner = world;
 
        InitializeEntity(e, ka_RespawnBall, INITPRIO_SETLOCATION); // is this the right priority? Neh, I have no idea.. Well-- it works! So. 
@@ -55,15 +56,16 @@ void ka_SpawnBall() // loads various values for the ball
 
 void ka_RespawnBall() // runs whenever the ball needs to be relocated
 {
+       if(gameover) { return; }
        vector oldballorigin = self.origin;
-
+       
        if(MoveToRandomMapLocation(self, DPCONTENTS_SOLID | DPCONTENTS_CORPSE | DPCONTENTS_PLAYERCLIP, DPCONTENTS_SLIME | DPCONTENTS_LAVA | DPCONTENTS_SKY | DPCONTENTS_BODY | DPCONTENTS_DONOTENTER, Q3SURFACEFLAG_SKY, 10, 1024, 256))
        {
                makevectors(self.angles);
                self.movetype = MOVETYPE_BOUNCE;
                self.velocity = '0 0 200';
                self.angles = '0 0 0';
-               self.solid = SOLID_TRIGGER;
+               self.effects = autocvar_g_keepawayball_effects;
                self.think = ka_RespawnBall;
                self.nextthink = time + autocvar_g_keepawayball_respawntime;
                
@@ -84,6 +86,7 @@ void ka_RespawnBall() // runs whenever the ball needs to be relocated
 
 void ka_TouchEvent() // runs any time that the ball comes in contact with something
 {
+       if(gameover) { return; }
        if(!self) { return; }
        if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
        { // The ball fell off the map, respawn it since players can't get to it
@@ -103,24 +106,22 @@ void ka_TouchEvent() // runs any time that the ball comes in contact with someth
        self.owner = other;
        other.ballcarried = self;
        setattachment(self, other, "");
-       setorigin(self, '3 0 20');
+       setorigin(self, '0 0 0');
        
-       // make the ball invisible/unable to do anything
+       // make the ball invisible/unable to do anything/set up time scoring
        self.velocity = '0 0 0';
        self.movetype = MOVETYPE_NONE;
-       self.touch = SUB_Null;
        self.effects |= EF_NODRAW;
-       self.think = SUB_Null;
-       self.nextthink = 0;
+       self.touch = SUB_Null;
+       self.think = ka_TimeScoring;
+       self.nextthink = time + autocvar_g_keepaway_score_timeinterval;
        self.takedamage = DAMAGE_NO;
 
        // apply effects to player
        other.glow_color = autocvar_g_keepawayball_trail_color;
        other.glow_trail = TRUE;
-       other.effects |= EF_DIMLIGHT;
-       other.alpha = autocvar_g_keepaway_ballcarrier_alpha;
-       other.exteriorweaponentity.alpha = autocvar_g_keepaway_ballcarrier_alpha;
-
+       other.effects |= autocvar_g_keepaway_ballcarrier_effects;
+       
        // messages and sounds
        Send_KillNotification(other.netname, "", "", KA_PICKUPBALL, MSG_KA);
        WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
@@ -149,11 +150,10 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        // reset the ball
        setattachment(ball, world, "");
        ball.movetype = MOVETYPE_BOUNCE;
-       ball.solid = SOLID_TRIGGER; // is this needed? 
        ball.wait = time + 1; 
+       ball.touch = ka_TouchEvent;
        ball.think = ka_RespawnBall;
        ball.nextthink = time + autocvar_g_keepawayball_respawntime;
-       ball.touch = ka_TouchEvent;
        ball.takedamage = DAMAGE_YES;
        ball.effects &~= EF_NODRAW; 
        setorigin(ball, plyr.origin + '0 0 10');
@@ -162,11 +162,9 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
        ball.owner = world;
        
        // reset the player effects
-       plyr.effects &~= EF_DIMLIGHT;
-       plyr.alpha = default_player_alpha;
-       plyr.exteriorweaponentity.alpha = default_weapon_alpha; 
        plyr.glow_trail = FALSE;
-       
+       plyr.effects &~= autocvar_g_keepaway_ballcarrier_effects;
+
        // messages and sounds
        Send_KillNotification(plyr.netname, "", "", KA_DROPBALL, MSG_KA);
        WriteByte(MSG_BROADCAST, SVC_CENTERPRINT);
@@ -187,20 +185,24 @@ void ka_DropEvent(entity plyr) // runs any time that a player is supposed to los
 float ka_ballcarrier_waypointsprite_visible_for_player(entity e) // runs on waypoints which are attached to ballcarriers, updates once per frame 
 {
        if(e.ballcarried)
-       {
                if(other.classname == "spectator") 
                        return FALSE; // we don't want spectators of the ballcarrier to see the attached waypoint on the top of their screen
-               else if(g_minstagib && (e.items & IT_STRENGTH))
-                       return FALSE; // if the ballcarrier has invisibility, don't draw the waypoint as this is the function of invisibility in keepaway
-       }
+               
+       // TODO: Make the ballcarrier lack a waypointsprite whenever they have the invisibility powerup
 
        return TRUE;
 }
 
-MUTATOR_HOOKFUNCTION(ka_RemovePlayer)
+void ka_TimeScoring()
 {
-       if(self.ballcarried) { ka_DropEvent(self); } // a player with the ball has left the match, drop it
-       return 0;
+       if(self.owner.ballcarried)
+       { // add points for holding the ball after a certain amount of time
+               if(autocvar_g_keepaway_score_timepoints)
+                       PlayerScore_Add(self.owner, SP_SCORE, autocvar_g_keepaway_score_timepoints);
+                       
+               PlayerScore_Add(self.owner, SP_KEEPAWAY_TIME, (autocvar_g_keepaway_score_timeinterval / 1)); // interval is divided by 1 so that time always shows "seconds"
+               self.nextthink = time + autocvar_g_keepaway_score_timeinterval;
+       }
 }
 
 MUTATOR_HOOKFUNCTION(ka_Scoring)
@@ -209,15 +211,15 @@ MUTATOR_HOOKFUNCTION(ka_Scoring)
        {
                if(frag_target.ballcarried) { // add to amount of times killing carrier
                        PlayerScore_Add(frag_attacker, SP_KEEPAWAY_CARRIERKILLS, 1);
-                       if(autocvar_g_keepaway_bckillscore) // add bckills to the score
-                               PlayerScore_Add(frag_attacker, SP_KEEPAWAY_SCORE, 1);
+                       if(autocvar_g_keepaway_score_bckill) // add bckills to the score
+                               PlayerScore_Add(frag_attacker, SP_SCORE, autocvar_g_keepaway_score_bckill);
                }
                else if(!frag_attacker.ballcarried)
                        if(autocvar_g_keepaway_noncarrier_warn)
                                centerprint_atprio(frag_attacker, (CENTERPRIO_SPAM + 5), "Killing people while you don't have the ball gives no points!");
 
                if(frag_attacker.ballcarried) // add to amount of kills while ballcarrier
-                       PlayerScore_Add(frag_attacker, SP_KEEPAWAY_SCORE, 1);
+                       PlayerScore_Add(frag_attacker, SP_SCORE, autocvar_g_keepaway_score_killac);
        }
 
        if(self.ballcarried) { ka_DropEvent(self); } // a player with the ball has died, drop it
@@ -227,7 +229,7 @@ MUTATOR_HOOKFUNCTION(ka_Scoring)
 MUTATOR_HOOKFUNCTION(ka_GiveFragsForKill)
 {
        frag_score = 0; // no frags counted in keepaway
-       return 0;
+       return 1; // you deceptive little bugger ;3 This needs to be true in order for this function to even count. 
 }
 
 MUTATOR_HOOKFUNCTION(ka_PlayerPreThink)
@@ -277,62 +279,32 @@ MUTATOR_HOOKFUNCTION(ka_PlayerDamage) // for changing damage and force values th
        return 0;
 }
 
+MUTATOR_HOOKFUNCTION(ka_RemovePlayer)
+{
+       if(self.ballcarried) { ka_DropEvent(self); } // a player with the ball has left the match, drop it
+       return 0;
+}
+
 MUTATOR_HOOKFUNCTION(ka_PlayerPowerups)
 {
-       if(self.ballcarried)
-       { 
-               // if the player has the ball, force ballcarrier alpha upon them
-               self.alpha = autocvar_g_keepaway_ballcarrier_alpha;
-               self.exteriorweaponentity.alpha = autocvar_g_keepaway_ballcarrier_alpha;
+       // In the future this hook is supposed to allow me to do some extra stuff with waypointsprites and invisibility powerup
+       // So bare with me until I can fix a certain bug with ka_ballcarrier_waypointsprite_visible_for_player() 
        
-               // if we're in minstagib and a ballcarrier has just picked up invisibility, 
-               // notify all the other players that the ballcarrier no longer has a waypoint
-               if(g_minstagib)
-               {
-                       if(olditems & IT_STRENGTH) 
-                       {
-                               if(time > self.strength_finished) 
-                               {       // this only runs ONCE right after the player loses invisibility
-                                       bprint(self.netname, "^7 isn't invisible from radar anymore.\n");
-                               }
-                       }
-                       else 
-                       {
-                               if(time < self.strength_finished)
-                               {       // this only runs ONCE right after the player gains invisibility
-                                       bprint(self.netname, "^7 has picked up invisibility and can no longer be seen on radar!\n");
-                               }
-                       }
-               }
-       }
-       else if(g_minstagib)
-       {
-               // if we're in minstagib and a noncarrier has invisibility, assure that we apply the invisibility effects normally
-               if(olditems & IT_STRENGTH) 
-               {
-                       self.alpha = g_minstagib_invis_alpha;
-                       self.exteriorweaponentity.alpha = g_minstagib_invis_alpha;
-               }
-       }
-       else
-       {
-               // if we're a normal player with no powerups that edit alpha make sure the alpha is default. 
-               // (normal powerups just use EF_ADDITIVE)
-               self.alpha = default_player_alpha;
-               self.exteriorweaponentity.alpha = default_weapon_alpha;
-       }
+       self.effects &~= autocvar_g_keepaway_ballcarrier_effects;
+
+       if(self.ballcarried)
+               self.effects |= autocvar_g_keepaway_ballcarrier_effects;
        
        return 0;
 }
 
 MUTATOR_DEFINITION(gamemode_keepaway)
 {
-       // I don't quite understand these orders, perhaps someone could enlighten me?
        MUTATOR_HOOK(MakePlayerObserver, ka_RemovePlayer, CBC_ORDER_ANY);
        MUTATOR_HOOK(ClientDisconnect, ka_RemovePlayer, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerDies, ka_Scoring, CBC_ORDER_ANY);
        MUTATOR_HOOK(GiveFragsForKill, ka_GiveFragsForKill, CBC_ORDER_ANY);
-       MUTATOR_HOOK(PlayerPreThink, ka_PlayerPreThink, CBC_ORDER_FIRST);
+       MUTATOR_HOOK(PlayerPreThink, ka_PlayerPreThink, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerDamage_Calculate, ka_PlayerDamage, CBC_ORDER_ANY);
        MUTATOR_HOOK(PlayerPowerups, ka_PlayerPowerups, CBC_ORDER_ANY);
 
index 7904e30ef1efab3ce7ed4dba8214781522401020..6b04eea9d6a06e648420feb83de200e4316fd529 100644 (file)
@@ -3,6 +3,7 @@ string playerstats_last;
 string events_last;
 .float playerstats_addedglobalinfo;
 float playerstats_requested;
+.string playerstats_id;
 
 void PlayerStats_Init()
 {
@@ -17,16 +18,37 @@ void PlayerStats_Init()
                playerstats_waitforme = FALSE; // must wait for it at match end
        
        PlayerStats_AddEvent(PLAYERSTATS_ALIVETIME);
-       PlayerStats_AddEvent(PLAYERSTATS_KILLS);
+       PlayerStats_AddEvent(PLAYERSTATS_WINS);
+       PlayerStats_AddEvent(PLAYERSTATS_MATCHES);
+       PlayerStats_AddEvent(PLAYERSTATS_JOINS);
+       PlayerStats_AddEvent(PLAYERSTATS_SCOREBOARD_VALID);
+
+       PlayerStats_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3);
+       PlayerStats_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5);
+       PlayerStats_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10);
+       PlayerStats_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15);
+       PlayerStats_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20);
+       PlayerStats_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25);
+       PlayerStats_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30);
+       PlayerStats_AddEvent(PLAYERSTATS_ACHIEVEMENT_BOTLIKE);
+       PlayerStats_AddEvent(PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD);
+       PlayerStats_AddEvent(PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM);
 }
 
 void PlayerStats_AddPlayer(entity e)
 {
-       if(!e.crypto_idfp || playerstats_db < 0)
+       if(playerstats_db < 0)
                return;
+
+       if(e.crypto_idfp != "")
+               e.playerstats_id = strzone(e.crypto_idfp);
+       else if(clienttype(e) == CLIENTTYPE_BOT)
+               e.playerstats_id = strzone(sprintf("bot#%d", e.playerid));
+       else
+               e.playerstats_id = strzone(sprintf("player#%d", e.playerid));
        
        string key;
-       key = sprintf("%s:*", e.crypto_idfp);
+       key = sprintf("%s:*", e.playerstats_id);
        
        string p;
        p = db_get(playerstats_db, key);
@@ -39,7 +61,7 @@ void PlayerStats_AddPlayer(entity e)
                }
                else
                        db_put(playerstats_db, key, "#");
-               playerstats_last = strzone(e.crypto_idfp);
+               playerstats_last = strzone(e.playerstats_id);
        }
 }
 
@@ -68,12 +90,12 @@ void PlayerStats_AddEvent(string event_id)
 
 void PlayerStats_Event(entity e, string event_id, float value)
 {
-       if(!e.crypto_idfp || playerstats_db < 0)
+       if(!e.playerstats_id || playerstats_db < 0)
                return;
        
        string key;
        float val;
-       key = sprintf("%s:%s", e.crypto_idfp, event_id);
+       key = sprintf("%s:%s", e.playerstats_id, event_id);
        val = stof(db_get(playerstats_db, key));
        val += value;
        db_put(playerstats_db, key, ftos(val));
@@ -122,11 +144,18 @@ void PlayerStats_Shutdown()
                        {
                                float v;
                                v = stof(db_get(playerstats_db, sprintf("%s:%s", p, e)));
-                               bufstr_set(b, i++, sprintf("e %s %f", e, v));
+                               if(v != 0)
+                                       bufstr_set(b, i++, sprintf("e %s %g", e, v));
                        }
                }
                bufstr_set(b, i++, "");
 
+               if(autocvar_g_playerstats_debug)
+               {
+                       for(i = 0; i < buf_getsize(b); ++i)
+                               print(bufstr_get(b, i), "\n");
+               }
+
                if(crypto_uri_postbuf(uri, URI_GET_PLAYERSTATS_SENT, "text/plain", "\n", b, 0))
                        playerstats_requested = TRUE;
                else
@@ -146,14 +175,38 @@ void PlayerStats_AddGlobalInfo(entity p)
 {
        if(playerstats_db < 0)
                return;
-       if(!p.crypto_idfp || playerstats_db < 0)
+       if(!p.playerstats_id || playerstats_db < 0)
                return;
        p.playerstats_addedglobalinfo = TRUE;
 
        // add global info!
        if(p.alivetime)
                PlayerStats_Event(p, PLAYERSTATS_ALIVETIME, time - p.alivetime);
+
+       if(p.alivetime)
+               PlayerStats_Event(p, PLAYERSTATS_ALIVETIME, time - p.alivetime);
        
-       if(p.cvar_cl_allow_uid2name == 1)
-               db_put(playerstats_db, sprintf("%s:_netname", p.crypto_idfp), p.netname);
+       if(p.cvar_cl_allow_uid2name == 1 || clienttype(p) == CLIENTTYPE_BOT)
+               db_put(playerstats_db, sprintf("%s:_netname", p.playerstats_id), p.netname);
+
+       if(p.alivetime > 0)
+               PlayerStats_Event(p, PLAYERSTATS_JOINS, 1);
+
+       strunzone(p.playerstats_id);
+       p.playerstats_id = string_null;
+}
+
+void PlayerStats_EndMatch(float finished)
+{
+       entity p;
+       FOR_EACH_PLAYER(p)
+       {
+               PlayerScore_PlayerStats(p);
+               PlayerStats_Event(p, PLAYERSTATS_SCOREBOARD_VALID, 1);
+               if(finished)
+               {
+                       PlayerStats_Event(p, PLAYERSTATS_WINS, p.winning);
+                       PlayerStats_Event(p, PLAYERSTATS_MATCHES, 1);
+               }
+       }
 }
index fea546a123d5e4719bbac67b2fd6d1739563f4a9..2d004c1207b4580929de5325c5543341d42741b1 100644 (file)
@@ -1,6 +1,23 @@
 // time the player was alive and kicking
-string PLAYERSTATS_ALIVETIME = "alivetime";
-string PLAYERSTATS_KILLS     = "kills";
+string PLAYERSTATS_ALIVETIME  = "alivetime";
+string PLAYERSTATS_WINS = "wins";
+string PLAYERSTATS_MATCHES = "matches";
+string PLAYERSTATS_JOINS = "joins";
+string PLAYERSTATS_SCOREBOARD_VALID = "scoreboardvalid";
+
+string PLAYERSTATS_TOTAL = "total-";
+string PLAYERSTATS_SCOREBOARD = "scoreboard-";
+
+string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3 = "achievement-kill-spree-3";
+string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5 = "achievement-kill-spree-5";
+string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10 = "achievement-kill-spree-10";
+string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15 = "achievement-kill-spree-15";
+string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20 = "achievement-kill-spree-20";
+string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25 = "achievement-kill-spree-25";
+string PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30 = "achievement-kill-spree-30";
+string PLAYERSTATS_ACHIEVEMENT_BOTLIKE = "achievement-botlike";
+string PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD = "achievement-firstblood";
+string PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM = "achievement-firstvictim";
 
 // delay map switch until this is set
 float playerstats_waitforme;
@@ -25,3 +42,6 @@ void PlayerStats_Sent_URI_Get_Callback(float id, float status, string data);
 
 // call this whenever a player leaves
 void PlayerStats_AddGlobalInfo(entity p);
+
+// call this at the end of the match
+void PlayerStats_EndMatch(float finished);
index 2c5e2b14490498ef2f8190f3530c92e77e450796..79f2ffc7ce6418fde3634e5ca88fbf51dd368dca 100644 (file)
@@ -150,6 +150,11 @@ void ScoreInfo_SetLabel_PlayerScore(float i, string label, float scoreflags)
                scores_primary = scores[i];
                scores_flags_primary = scoreflags;
        }
+       if(label != "")
+       {
+               PlayerStats_AddEvent(strcat(PLAYERSTATS_TOTAL, label));
+               PlayerStats_AddEvent(strcat(PLAYERSTATS_SCOREBOARD, label));
+       }
 }
 
 void ScoreInfo_SetLabel_TeamScore(float i, string label, float scoreflags)
@@ -245,6 +250,7 @@ void PlayerScore_Clear(entity player)
 
        if(teamscores_entities_count)
                return;
+
        if(g_lms) return;
        if(g_arena || g_ca) return;
        if(g_race && !g_race_qualifying) return;
@@ -330,6 +336,8 @@ float PlayerScore_Add(entity player, float scorefield, float score)
        if(score)
                if(scores_label[scorefield] != "")
                        s.SendFlags |= pow(2, scorefield);
+       PlayerStats_Event(s.owner, strcat(PLAYERSTATS_TOTAL, scores_label[scorefield]), score);
+       s.(scores_accumulated[scorefield]) += score;
        return (s.(scores[scorefield]) += score);
 }
 
@@ -864,3 +872,14 @@ void Score_NicePrint(entity to)
        }
 }
 
+void PlayerScore_PlayerStats(entity p)
+{
+       entity s;
+       float i;
+       s = p.scorekeeper;
+
+       for(i = 0; i < MAX_SCORE; ++i)
+               if(s.(scores[i]) != 0)
+                       if(scores_label[i] != "")
+                               PlayerStats_Event(s.owner, strcat(PLAYERSTATS_SCOREBOARD, scores_label[i]), s.(scores[i]));
+}
index 3ac0b03b5577dd49cf5dbb5eea7e1ad7e2fd02e6..f94b683323dfb8b57d974c7d2b2dd683ace5d90b 100644 (file)
@@ -2,6 +2,8 @@ entity scores_initialized; // non-world when scores labels/rules have been set
 .float scores[MAX_SCORE];
 .float teamscores[MAX_TEAMSCORE];
 
+.float scores_accumulated[MAX_SCORE]; // for player stats only
+
 /**
  * Attaches a PlayerScore entity to a player. Use that in ClientConnect.
  * Remember to detach it in ClientDisconnect!
index a4c993d83f1cd1fc4117f2517aa29b388205fa88..18c780d8147a2499d6869c02c9b9b448af361c96 100644 (file)
@@ -34,7 +34,6 @@ void ScoreRules_basics_end()
 }
 void ScoreRules_generic()
 {
-       CheckAllowedTeams(world);
        if(teams_matter)
        {
                CheckAllowedTeams(world);
@@ -192,13 +191,23 @@ void ScoreRules_nexball(float teams)
 #define SP_KEEPAWAY_PICKUPS 4
 #define SP_KEEPAWAY_CARRIERKILLS 5
 #define SP_KEEPAWAY_DROPS 6
-#define SP_KEEPAWAY_SCORE 7
+#define SP_KEEPAWAY_TIME 7
 void ScoreRules_keepaway()
 {
-       ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY, 0, FALSE); // SFL_SORT_PRIO_PRIMARY
-       ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_SCORE,               "score",                SFL_SORT_PRIO_PRIMARY);
-       ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_PICKUPS,             "pickups",              0);
+       ScoreRules_basics(0, SFL_SORT_PRIO_PRIMARY, 0, TRUE); // SFL_SORT_PRIO_PRIMARY
+       ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_PICKUPS,                     "pickups",              0);
        ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_CARRIERKILLS,        "bckills",              0);
-       ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_DROPS,               "drops",                SFL_LOWER_IS_BETTER);
+       ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_DROPS,                       "drops",                SFL_LOWER_IS_BETTER);
+       ScoreInfo_SetLabel_PlayerScore(SP_KEEPAWAY_TIME,                        "time",                 SFL_SORT_PRIO_SECONDARY);
+       ScoreRules_basics_end();
+}
+
+// FreezeTag stuff
+#define SP_FREEZETAG_REVIVALS 4
+void ScoreRules_freezetag()
+{
+       CheckAllowedTeams(world);
+       ScoreRules_basics(((c4>=0) ? 4 : (c3>=0) ? 3 : 2), SFL_SORT_PRIO_PRIMARY, SFL_SORT_PRIO_PRIMARY, TRUE); // SFL_SORT_PRIO_PRIMARY
+       ScoreInfo_SetLabel_PlayerScore(SP_FREEZETAG_REVIVALS,           "revivals",             0);
        ScoreRules_basics_end();
 }
index c73f0355f8ad6ba1bd927e53c68e3e457e060d32..aebea7523f66fea9e67d93ee485024bffeb9ff36 100644 (file)
@@ -2,7 +2,7 @@
 void CreatureFrame (void)
 {
        local entity oldself;
-       local float dm, maxspeed;
+       local float dm;
        oldself = self;
        self = findfloat(world, iscreature, TRUE);
        while (self)
@@ -67,9 +67,10 @@ void CreatureFrame (void)
                                self.dmg = 2;
                        }
                        // check for falling damage
+                       float velocity_len = vlen(self.velocity);
                        if(!self.hook.state && !g_ca && !(g_cts && !autocvar_g_cts_selfdamage))
                        {
-                               dm = vlen(self.oldvelocity) - vlen(self.velocity); // dm is now the velocity DECREASE. Velocity INCREASE should never cause a sound or any damage.
+                               dm = vlen(self.oldvelocity) - velocity_len; // dm is now the velocity DECREASE. Velocity INCREASE should never cause a sound or any damage.
                                if (self.deadflag)
                                        dm = (dm - autocvar_g_balance_falldamage_deadminspeed) * autocvar_g_balance_falldamage_factor;
                                else
@@ -78,15 +79,14 @@ void CreatureFrame (void)
                                        Damage (self, world, world, dm, DEATH_FALL, self.origin, '0 0 0');
                        }
 
-                       maxspeed = autocvar_g_maxspeed;
-                       if(maxspeed > 0 && vlen(self.velocity) > maxspeed)
+                       if(autocvar_g_maxspeed > 0 && velocity_len > autocvar_g_maxspeed)
                                Damage (self, world, world, 100000, DEATH_SHOOTING_STAR, self.origin, '0 0 0');
 
                        // play stupid sounds
                        if (g_footsteps)
                        if (!gameover)
                        if (self.flags & FL_ONGROUND)
-                       if (vlen(self.velocity) > autocvar_sv_maxspeed * 0.6)
+                       if (velocity_len > autocvar_sv_maxspeed * 0.6)
                        if (!self.deadflag)
                        if (time < self.lastground + 0.2)
                        {
index 3089ab650a83b33f449bdea80375ae6cfc63692b..f3afdf580c26b0ff2890ff28107c6c77ab1db964 100644 (file)
@@ -536,6 +536,7 @@ void spawnfunc_func_pendulum()
 
        self.blocked = generic_plat_blocked;
 
+       self.avelocity_z = 0.0000001;
        if not(InitMovingBrushTrigger())
                return;
 
@@ -1433,8 +1434,10 @@ void spawnfunc_func_door_rotating()
        self.angles = '0 0 0';
 
        self.max_health = self.health;
+       self.avelocity = self.movedir;
        if not(InitMovingBrushTrigger())
                return;
+       self.velocity = '0 0 0';
        //self.effects |= EF_LOWPRECISION;
        self.classname = "door_rotating";
 
index 44036ade494e9b437934f93438fdd5ead1dab8ab..11bf880e60bf102b1d992c25698e8ff471973fbd 100644 (file)
@@ -23,7 +23,7 @@ void spawnfunc_weapon_plasmagun()    { spawnfunc_weapon_hagar();        }
 void spawnfunc_ammo_cells()          { spawnfunc_item_rockets();        }
 
 // Rail -> Rifle
-void spawnfunc_weapon_railgun()      { spawnfunc_weapon_campingrifle(); }
+void spawnfunc_weapon_railgun()      { spawnfunc_weapon_sniperrifle();  }
 void spawnfunc_ammo_slugs()          { spawnfunc_item_bullets();        }
 
 // BFG -> Crylink
index 80344a9e1f211bd2501911c7dc6272f39659264b..843af3d5ad64fad215932d91c7c25a7300febf92 100644 (file)
@@ -19,15 +19,15 @@ TFL_AIM_GROUND
 vector turret_stdproc_aim_generic()
 {
 
-    vector pre_pos,prep;
-    float distance,impact_time,i,mintime;
+    vector pre_pos, prep;
+    float distance, impact_time, i, mintime;
 
     turret_tag_fire_update();
 
     if(self.aim_flags & TFL_AIM_SIMPLE)
         return real_origin(self.enemy);
 
-       mintime = max(self.attack_finished_single - time,0) + sys_frametime ;
+       mintime = max(self.attack_finished_single - time,0) + sys_frametime;
 
     // Baseline
     pre_pos = real_origin(self.enemy);
index b7af33af82e506cc657ceee10e3cd6573fbb42d5..c7f25a4467825f6b9c6eefbd7ba9f4fc96b73289 100644 (file)
@@ -287,8 +287,6 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo
     // thorw head slightly off aim when hit?
     if (self.damage_flags & TFL_DMG_HEADSHAKE)
     {
-        //baseent.tur_aimoff_x += (random() * damage);
-        //baseent.tur_aimoff_y += ((random()*0.75) * damage);
         self.tur_head.angles_x = self.tur_head.angles_x + (-0.5 + random()) * damage;
         self.tur_head.angles_y = self.tur_head.angles_y + (-0.5 + random()) * damage;
     }
@@ -296,11 +294,8 @@ void turret_stdproc_damage (entity inflictor, entity attacker, float damage, flo
     if (self.turrcaps_flags & TFL_TURRCAPS_MOVE)
         self.velocity = self.velocity + vforce;
 
-    // FIXME: Better damage feedback
-    // Start burning when we have 10% or less health left
-    //if (self.health < (self.tur_health * 0.1))
-    //    self.effects = EF_FLAME;
-
+    // FIXME: Better damage feedback?
+    
     if (self.health <= 0)
     {
         self.event_damage           = SUB_Null;
index 4a2e886af863bdca739e41c43786dc5f684bc5ab..7d023e99ef199d9049f3954a9779e4847fa61881 100644 (file)
@@ -637,6 +637,10 @@ void turret_think()
     if (self.ammo < self.ammo_max)
         self.ammo = min(self.ammo + self.ammo_recharge, self.ammo_max);
 
+    if (self.health < (self.tur_health * 0.5))
+               if(random() < 0.25)
+                       te_spark(self.origin + '0 0 40', randomvec() * 256 + '0 0 256', 16);
+                       
     // Inactive turrets needs to run the think loop,
     // So they can handle animation and wake up if need be.
     if not (self.tur_active)
@@ -873,6 +877,7 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
     {
         e = spawn();
 
+        /*
         setorigin(e,'0 0 0');
         setmodel(e,"models/turrets/plasma.md3");
         vector v;
@@ -883,6 +888,7 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
             //crash();
         }
         setmodel(e,"");
+        */
 
         e.classname = "turret_manager";
         e.think = turrets_manager_think;
@@ -1129,6 +1135,10 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
 // Offsets & origins
     if (!self.tur_shotorg)   self.tur_shotorg = '50 0 50';
 
+// Gane hooks
+       if(MUTATOR_CALLHOOK(TurretSpawn))
+               return 0;
+
 // End of default & sanety checks, start building the turret.
 
 // Spawn extra bits
@@ -1234,7 +1244,7 @@ float turret_stdproc_init (string cvar_base_name, float csqc_shared, string base
         activator = ee;
         self.use();
     }
-
+       
        turret_stdproc_respawn();
     return 1;
 }
index 601a934c5b206eaecc2833aedc5af1048a3e7ec1..03b0c40ad91cc49b873ee48344a18c250d6eeb0a 100644 (file)
@@ -2,19 +2,6 @@ void spawnfunc_turret_fusionreactor();
 void turret_fusionreactor_dinit();
 void turret_fusionreactor_fire();
 
-float turret_fusionreactor_firecheck()
-{
-    if (self.enemy == world) return 0;
-    if not (self.enemy.ammo_flags & TFL_AMMO_RECIVE) return 0;
-    if not (self.enemy.ammo_flags & TFL_AMMO_ENERGY) return 0;
-    if (self.ammo < self.shot_dmg) return 0;
-    if (self.enemy.ammo >= self.enemy.ammo_max) return 0;
-    if (self.tur_dist_aimpos > self.target_range) return 0;
-    if (self.tur_dist_aimpos < self.target_range_min) return 0;
-
-    return 1;
-}
-
 void turret_fusionreactor_fire()
 {
     vector fl_org;
@@ -22,20 +9,51 @@ void turret_fusionreactor_fire()
     self.enemy.ammo = min(self.enemy.ammo + self.shot_dmg,self.enemy.ammo_max);
     fl_org = 0.5 * (self.enemy.absmin + self.enemy.absmax);
     te_smallflash(fl_org);
-    //te_lightning1(world,self.origin,self.enemy.origin);
 }
 
 void turret_fusionreactor_postthink()
 {
-    float f;
-    f = self.ammo / self.ammo_max;
-    self.tur_head.avelocity = '0 250 0' * f;
+    self.tur_head.avelocity = '0 250 0' * (self.ammo / self.ammo_max);
 }
 
+/*
 void turret_fusionreactor_respawnhook()
 {
     self.tur_head.avelocity = '0 50 0';
 }
+*/
+
+/**
+** Preforms pre-fire checks for fusionreactor
+**/
+float turret_fusionreactor_firecheck()
+{
+       if (self.attack_finished_single > time) 
+               return 0;
+
+       if (self.enemy.deadflag != DEAD_NO)
+               return 0;
+
+       if (self.enemy == world)
+               return 0;
+
+       if (self.ammo < self.shot_dmg)
+               return 0;
+
+       if (self.enemy.ammo >= self.enemy.ammo_max)
+               return 0;
+       
+       if (vlen(self.enemy.origin - self.origin) > self.target_range)
+               return 0;                               
+       
+       if(self.team != self.enemy.team)
+               return 0;
+       
+       if not (self.enemy.ammo_flags & TFL_AMMO_ENERGY)
+               return 0;    
+       
+       return 1;
+}
 
 void turret_fusionreactor_dinit()
 {
@@ -48,7 +66,7 @@ void turret_fusionreactor_dinit()
     self.shoot_flags         = TFL_SHOOT_HITALLVALID;
     self.aim_flags           = TFL_AIM_NO;
     self.track_flags         = TFL_TRACK_NO;
-    self.turret_respawnhook  = turret_fusionreactor_respawnhook;
+    // self.turret_respawnhook  = turret_fusionreactor_respawnhook;
 
     if (turret_stdproc_init("fusreac_std",0,"models/turrets/base.md3","models/turrets/reactor.md3") == 0)
     {
index 5d37db4929d115b40b30d0b634162066e0d005b4..d1d48c46cdb82b4f5d90746ea7ab8c5d42afe041 100644 (file)
@@ -618,16 +618,16 @@ void walker_attack()
     sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", VOL_BASE, ATTN_NORM);
     fireBallisticBullet (self.tur_shotorg, self.tur_shotdir_updated,self.shot_spread, self.shot_speed, 5, self.shot_dmg, 0, self.shot_force, DEATH_TURRET, 0, 1, autocvar_g_balance_uzi_bulletconstant);
     endFireBallisticBullet();
-    if (self.uzi_bulletcounter == 2)
+    if (self.misc_bulletcounter == 2)
     {
 
                UziFlash();
                setattachment(self.muzzle_flash, self.tur_head, "tag_fire");
 
-        self.uzi_bulletcounter = 0;
+        self.misc_bulletcounter = 0;
     }
 
-    self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
+    self.misc_bulletcounter = self.misc_bulletcounter + 1;
     self.tur_head.frame    = self.tur_head.frame + 1;
 }
 
index fa0781fa786519e736ef39d86fa7a9da1d7d7730..6743f73d2305aeffc3ae4b66c623945bcd5c06e6 100644 (file)
@@ -255,17 +255,17 @@ void spiderbot_miniguns_do()
         {
             // Fire bullets, alternating trails left<->right
             self = self.owner;
-            if(self.uzi_bulletcounter == 1)
+            if(self.misc_bulletcounter == 1)
             {
                 spiderbot_minigun_fire(self.vehicle.gun1, 0);
                 spiderbot_minigun_fire(self.vehicle.gun2, 1);
-                self.uzi_bulletcounter = 0;
+                self.misc_bulletcounter = 0;
             }
             else
             {
                 spiderbot_minigun_fire(self.vehicle.gun1, 1);
                 spiderbot_minigun_fire(self.vehicle.gun2, 0);
-                self.uzi_bulletcounter += 1;
+                self.misc_bulletcounter += 1;
             }
 
             self = self.vehicle;
index 5730744037ea4908168572f68da0afb4bc9fded6..930a413d58c487dbd4be050e2994c0ccd662f4dc 100644 (file)
@@ -16,6 +16,6 @@
 #include "w_hook.qc"
 #include "w_hlac.qc"
 #include "w_tuba.qc"
-#include "w_campingrifle.qc"
+#include "w_sniperrifle.qc"
 #include "w_fireball.qc"
 #include "w_seeker.qc"
diff --git a/qcsrc/server/w_campingrifle.qc b/qcsrc/server/w_campingrifle.qc
deleted file mode 100644 (file)
index 777f0d1..0000000
+++ /dev/null
@@ -1,333 +0,0 @@
-#ifdef REGISTER_WEAPON
-REGISTER_WEAPON(CAMPINGRIFLE, w_campingrifle, IT_NAILS, 7, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "campingrifle", "campingrifle", "Sniper Rifle");
-#else
-#ifdef SVQC
-//Camping rifle Primary mode: manually operated bolt*, Secondary: full automatic**
-//* Manually operating the bolt means that all the power of the gas is used to propell the bullet. In this mode the bolt is prevented from moving backwards in response to the firing of the bullet.
-//** In fully automatic mode some of the gas is used to extract and reload the next cartrige, thus there is less power and range.
-
-.float campingrifle_accumulator;
-
-float W_CampingRifle_CheckMaxBullets(float checkammo)
-{
-       float maxbulls;
-       maxbulls = autocvar_g_balance_campingrifle_magazinecapacity;
-       if(!maxbulls)
-               maxbulls = 8; // match HUD
-       if(checkammo)
-               if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-                       maxbulls = min(maxbulls, floor(self.ammo_nails / min(autocvar_g_balance_campingrifle_primary_ammo, autocvar_g_balance_campingrifle_secondary_ammo)));
-       if(self.campingrifle_bulletcounter > maxbulls || !autocvar_g_balance_campingrifle_magazinecapacity)
-               self.campingrifle_bulletcounter = maxbulls;
-       return (self.campingrifle_bulletcounter == maxbulls);
-}
-
-void W_CampingRifle_ReloadedAndReady()
-{
-       float t;
-       self.campingrifle_bulletcounter = autocvar_g_balance_campingrifle_magazinecapacity;
-       W_CampingRifle_CheckMaxBullets(TRUE);
-       t = ATTACK_FINISHED(self) - autocvar_g_balance_campingrifle_reloadtime - 1;
-       ATTACK_FINISHED(self) = t;
-       w_ready();
-}
-
-float W_CampingRifle_Reload()
-{
-       float t;
-
-       W_CampingRifle_CheckMaxBullets(TRUE);
-
-       if(self.ammo_nails < min(autocvar_g_balance_campingrifle_primary_ammo, autocvar_g_balance_campingrifle_secondary_ammo)) // when we get here, bulletcounter must be 0 or -1
-       {
-               print("cannot reload... not enough bullets\n");
-               self.campingrifle_bulletcounter = -1; // reload later
-               W_SwitchToOtherWeapon(self);
-               return 0;
-       }
-       
-       if (self.campingrifle_bulletcounter >= autocvar_g_balance_campingrifle_magazinecapacity)
-               return 0;
-
-       if (self.weaponentity)
-       {
-               if (self.weaponentity.wframe == WFRAME_RELOAD)
-                       return 0;
-
-               // allow to switch away while reloading, but this will cause a new reload!
-               self.weaponentity.state = WS_READY;
-       }
-
-       sound (self, CHAN_WEAPON2, "weapons/campingrifle_reload.wav", VOL_BASE, ATTN_NORM);
-
-       t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_campingrifle_reloadtime + 1;
-       ATTACK_FINISHED(self) = t;
-
-       weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_campingrifle_reloadtime, W_CampingRifle_ReloadedAndReady);
-
-       self.campingrifle_bulletcounter = -1;
-
-       return 1;
-}
-
-void W_CampingRifle_CheckReloadAndReady()
-{
-       w_ready();
-       if(self.campingrifle_bulletcounter <= 0)
-               if(W_CampingRifle_Reload())
-                       return;
-}
-
-void W_CampingRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAddedDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant)
-{
-       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_nails -= pAmmo;
-
-       if(deathtype & HITTYPE_SECONDARY)
-               W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, "weapons/campingrifle_fire2.wav", CHAN_WEAPON, autocvar_g_balance_campingrifle_secondary_damage + autocvar_g_balance_campingrifle_secondary_headshotaddeddamage);
-       else
-               W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, "weapons/campingrifle_fire.wav", CHAN_WEAPON, autocvar_g_balance_campingrifle_primary_damage + autocvar_g_balance_campingrifle_primary_headshotaddeddamage);
-
-       pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 2000, 1);
-
-       if(self.BUTTON_ZOOM) // if zoomed, shoot from the eye
-       {
-               w_shotdir = v_forward;
-               w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward;
-       }
-
-       if(deathtype & HITTYPE_SECONDARY)
-               fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (autocvar_g_balance_campingrifle_secondary_tracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
-       else
-               fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (autocvar_g_balance_campingrifle_primary_tracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
-       endFireBallisticBullet();
-
-       if (autocvar_g_casings >= 2)
-               SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
-       
-       self.campingrifle_bulletcounter = self.campingrifle_bulletcounter - 1;
-       W_CampingRifle_CheckMaxBullets(TRUE);
-}
-
-void W_CampingRifle_Attack()
-{
-       W_CampingRifle_FireBullet(autocvar_g_balance_campingrifle_primary_spread, autocvar_g_balance_campingrifle_primary_damage, autocvar_g_balance_campingrifle_primary_headshotaddeddamage, autocvar_g_balance_campingrifle_primary_force, autocvar_g_balance_campingrifle_primary_speed, autocvar_g_balance_campingrifle_primary_lifetime, autocvar_g_balance_campingrifle_primary_ammo, WEP_CAMPINGRIFLE, autocvar_g_balance_campingrifle_primary_bulletconstant);
-}
-
-void W_CampingRifle_Attack2()
-{
-       W_CampingRifle_FireBullet(autocvar_g_balance_campingrifle_secondary_spread, autocvar_g_balance_campingrifle_secondary_damage, autocvar_g_balance_campingrifle_secondary_headshotaddeddamage, autocvar_g_balance_campingrifle_secondary_force, autocvar_g_balance_campingrifle_secondary_speed, autocvar_g_balance_campingrifle_secondary_lifetime, autocvar_g_balance_campingrifle_secondary_ammo, WEP_CAMPINGRIFLE | HITTYPE_SECONDARY, autocvar_g_balance_campingrifle_secondary_bulletconstant);
-}
-
-void spawnfunc_weapon_campingrifle (void)
-{
-       weapon_defaultspawnfunc(WEP_CAMPINGRIFLE);
-}
-
-.void(void) campingrifle_bullethail_attackfunc;
-.float campingrifle_bullethail_frame;
-.float campingrifle_bullethail_animtime;
-.float campingrifle_bullethail_refire;
-void W_CampingRifle_BulletHail_Continue()
-{
-       float r, sw, af;
-       W_CampingRifle_CheckReloadAndReady();
-       if(self.campingrifle_bulletcounter < 0)
-               return; // reloading, so we are done
-       sw = self.switchweapon; // make it not detect weapon changes as reason to abort firing
-       af = ATTACK_FINISHED(self);
-       self.switchweapon = self.weapon;
-       ATTACK_FINISHED(self) = time;
-       print(ftos(self.ammo_nails), "\n");
-       r = weapon_prepareattack(self.campingrifle_bullethail_frame == WFRAME_FIRE2, self.campingrifle_bullethail_refire);
-       if(self.switchweapon == self.weapon)
-               self.switchweapon = sw;
-       if(r)
-       {
-               self.campingrifle_bullethail_attackfunc();
-               weapon_thinkf(self.campingrifle_bullethail_frame, self.campingrifle_bullethail_animtime, W_CampingRifle_BulletHail_Continue);
-               print("thinkf set\n");
-       }
-       else
-       {
-               ATTACK_FINISHED(self) = af; // reset attack_finished if we didn't fire, so the last shot enforces the refire time
-               print("out of ammo... ", ftos(self.weaponentity.state), "\n");
-       }
-}
-
-void W_CampingRifle_BulletHail(float mode, void(void) AttackFunc, float fr, float animtime, float refire)
-{
-       // if we get here, we have at least one bullet to fire
-       AttackFunc();
-       if(mode)
-       {
-               // continue hail
-               self.campingrifle_bullethail_attackfunc = AttackFunc;
-               self.campingrifle_bullethail_frame = fr;
-               self.campingrifle_bullethail_animtime = animtime;
-               self.campingrifle_bullethail_refire = refire;
-               weapon_thinkf(fr, animtime, W_CampingRifle_BulletHail_Continue);
-       }
-       else
-       {
-               // just one shot
-               weapon_thinkf(fr, animtime, W_CampingRifle_CheckReloadAndReady);
-       }
-}
-
-.float bot_secondary_campingriflemooth;
-float w_campingrifle(float req)
-{
-       float full;
-       if (req == WR_AIM)
-       {
-               self.BUTTON_ATCK=FALSE;
-               self.BUTTON_ATCK2=FALSE;
-               if(vlen(self.origin-self.enemy.origin) > 1000)
-                       self.bot_secondary_campingriflemooth = 0;
-               if(self.bot_secondary_campingriflemooth == 0)
-               {
-                       if(bot_aim(autocvar_g_balance_campingrifle_primary_speed, 0, autocvar_g_balance_campingrifle_primary_lifetime, TRUE))
-                       {
-                               self.BUTTON_ATCK = TRUE;
-                               if(random() < 0.01) self.bot_secondary_campingriflemooth = 1;
-                       }
-               }
-               else
-               {
-                       if(bot_aim(autocvar_g_balance_campingrifle_secondary_speed, 0, autocvar_g_balance_campingrifle_secondary_lifetime, TRUE))
-                       {
-                               self.BUTTON_ATCK2 = TRUE;
-                               if(random() < 0.03) self.bot_secondary_campingriflemooth = 0;
-                       }
-               }
-       }
-       else if (req == WR_THINK)
-       {
-               if(self.campingrifle_bulletcounter < 0) // forced reload (e.g. because interrupted)
-               {
-                       if(self.switchweapon == self.weapon)
-                       if(self.weaponentity.state == WS_READY)
-                               W_CampingRifle_Reload();
-               }
-               else
-               {
-                       self.campingrifle_accumulator = bound(time - autocvar_g_balance_campingrifle_bursttime, self.campingrifle_accumulator, time);
-                       if (self.BUTTON_ATCK)
-                       if (weapon_prepareattack_check(0, autocvar_g_balance_campingrifle_primary_refire))
-                       if (time >= self.campingrifle_accumulator + autocvar_g_balance_campingrifle_primary_burstcost)
-                       {
-                               weapon_prepareattack_do(0, autocvar_g_balance_campingrifle_primary_refire);
-                               W_CampingRifle_BulletHail(autocvar_g_balance_campingrifle_primary_bullethail, W_CampingRifle_Attack, WFRAME_FIRE1, autocvar_g_balance_campingrifle_primary_animtime, autocvar_g_balance_campingrifle_primary_refire);
-                               self.campingrifle_accumulator += autocvar_g_balance_campingrifle_primary_burstcost;
-                       }
-                       if (self.BUTTON_ATCK2)
-                       {       
-                               if (autocvar_g_balance_campingrifle_secondary)
-                               {
-                                       if (weapon_prepareattack_check(1, autocvar_g_balance_campingrifle_secondary_refire))
-                                       if (time >= self.campingrifle_accumulator + autocvar_g_balance_campingrifle_secondary_burstcost)
-                                       {
-                                               weapon_prepareattack_do(1, autocvar_g_balance_campingrifle_secondary_refire);
-                                               W_CampingRifle_BulletHail(autocvar_g_balance_campingrifle_secondary_bullethail, W_CampingRifle_Attack2, WFRAME_FIRE2, autocvar_g_balance_campingrifle_secondary_animtime, autocvar_g_balance_campingrifle_primary_refire);
-                                               self.campingrifle_accumulator += autocvar_g_balance_campingrifle_secondary_burstcost;
-                                       }
-                               }
-                       }
-               }
-       }
-       else if (req == WR_PRECACHE)
-       {
-               precache_model ("models/weapons/g_campingrifle.md3");
-               precache_model ("models/weapons/v_campingrifle.md3");
-               precache_model ("models/weapons/h_campingrifle.iqm");
-               precache_sound ("weapons/campingrifle_reload.wav");
-               precache_sound ("weapons/campingrifle_fire.wav");
-               precache_sound ("weapons/campingrifle_fire2.wav");
-       }
-       else if (req == WR_SETUP)
-       {
-               weapon_setup(WEP_CAMPINGRIFLE);
-
-               full = W_CampingRifle_CheckMaxBullets(TRUE);
-               if(autocvar_g_balance_campingrifle_auto_reload_on_switch)
-                       if(!full)
-                               self.campingrifle_bulletcounter = -1;
-       }
-       else if (req == WR_CHECKAMMO1)
-               return self.ammo_nails >= autocvar_g_balance_campingrifle_primary_ammo;
-       else if (req == WR_CHECKAMMO2)
-               return self.ammo_nails >= autocvar_g_balance_campingrifle_secondary_ammo;
-       else if (req == WR_RELOAD)
-       {
-               W_CampingRifle_Reload();
-       }
-       else if (req == WR_RESETPLAYER)
-       {
-               self.campingrifle_accumulator = time - autocvar_g_balance_campingrifle_bursttime;
-               self.campingrifle_bulletcounter = autocvar_g_balance_campingrifle_magazinecapacity;
-               W_CampingRifle_CheckMaxBullets(FALSE);
-       }
-       return TRUE;
-};
-#endif
-#ifdef CSQC
-float w_campingrifle(float req)
-{
-       if(req == WR_IMPACTEFFECT)
-       {
-               vector org2;
-               org2 = w_org + w_backoff * 2;
-               pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1);
-               if(!w_issilent)
-               {
-                       if(w_random < 0.2)
-                               sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
-                       else if(w_random < 0.4)
-                               sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
-                       else if(w_random < 0.5)
-                               sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
-               }
-       }
-       else if(req == WR_PRECACHE)
-       {
-               precache_sound("weapons/ric1.wav");
-               precache_sound("weapons/ric2.wav");
-               precache_sound("weapons/ric3.wav");
-       }
-       else if (req == WR_SUICIDEMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_SECONDARY)
-                       w_deathtypestring = "%s shot themself automatically";
-               else
-                       w_deathtypestring = "%s sniped themself somehow";
-       }
-       else if (req == WR_KILLMESSAGE)
-       {
-               if(w_deathtype & HITTYPE_SECONDARY)
-               {
-                       if(w_deathtype & HITTYPE_BOUNCE)
-                               w_deathtypestring = "%s failed to hide from %s's bullet hail";
-                       else
-                               w_deathtypestring = "%s died in %s's bullet hail";
-               }
-               else
-               {
-                       if(w_deathtype & HITTYPE_BOUNCE)
-                       {
-                               // TODO special headshot message here too?
-                               w_deathtypestring = "%s failed to hide from %s's rifle";
-                       }
-                       else
-                       {
-                               if(w_deathtype & HITTYPE_HEADSHOT)
-                                       w_deathtypestring = "%s got hit in the head by %s";
-                               else
-                                       w_deathtypestring = "%s was sniped by %s";
-                       }
-               }
-       }
-       return TRUE;
-}
-#endif
-#endif
index 24f434044a9b466b816b8cc0244fcd6d7d88f17f..2d9ecfd8b31085d0fb0ea2eb2d4294d56d3826a0 100644 (file)
@@ -23,6 +23,7 @@ void W_GiveWeapon (entity e, float wep, string name)
 }
 
 .float railgundistance;
+.vector railgunforce;
 void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, float deathtype)
 {
        local vector hitloc, force, endpoint, dir;
@@ -67,6 +68,7 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f
                trace_ent.railgunhitloc = end;
                trace_ent.railgunhitsolidbackup = trace_ent.solid;
                trace_ent.railgundistance = vlen(WarpZone_UnTransformOrigin(WarpZone_trace_transform, trace_endpos) - start);
+               trace_ent.railgunforce = WarpZone_TransformVelocity(WarpZone_trace_transform, force);
 
                // stop if this is a wall
                if (trace_ent.solid == SOLID_BSP)
@@ -130,7 +132,7 @@ void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, f
 
                // apply the damage
                if (ent.takedamage)
-                       Damage (ent, self, self, bdamage * f, deathtype, hitloc, force * ffs);
+                       Damage (ent, self, self, bdamage * f, deathtype, hitloc, ent.railgunforce * ffs);
 
                // create a small explosion to throw gibs around (if applicable)
                //setorigin (explosion, hitloc);
@@ -182,7 +184,7 @@ void W_BallisticBullet_Hit (void)
 
                if(headshot)
                        f *= q;
-               if(DEATH_WEAPONOF(self.projectiledeathtype) == WEP_CAMPINGRIFLE)
+               if(DEATH_WEAPONOF(self.projectiledeathtype) == WEP_SNIPERRIFLE)
                {
                        if(headshot)
                                AnnounceTo(self.owner, "headshot");
index 4495b720c54e02eecd3ab2ca62e772aa31771adb..151b508f4105b7bb336391678c137c2bbc9cfe9e 100644 (file)
@@ -397,6 +397,7 @@ void W_Crylink_Attack (void)
                        proj.fade_rate = 1 / autocvar_g_balance_crylink_primary_other_fadetime;
                        proj.nextthink = time + autocvar_g_balance_crylink_primary_other_lifetime + autocvar_g_balance_crylink_primary_other_fadetime;
                }
+               proj.teleport_time = time + autocvar_g_balance_crylink_primary_joindelay;
                proj.cnt = autocvar_g_balance_crylink_primary_bounces;
                //proj.scale = 1 + 1 * proj.cnt;
 
@@ -484,6 +485,7 @@ void W_Crylink_Attack2 (void)
                        proj.fade_rate = 1 / autocvar_g_balance_crylink_secondary_line_fadetime;
                        proj.nextthink = time + autocvar_g_balance_crylink_secondary_line_lifetime + autocvar_g_balance_crylink_secondary_line_fadetime;
                }
+               proj.teleport_time = time + autocvar_g_balance_crylink_secondary_joindelay;
                proj.cnt = autocvar_g_balance_crylink_secondary_bounces;
                //proj.scale = 1 + 1 * proj.cnt;
 
@@ -542,7 +544,7 @@ float w_crylink(float req)
                }
                else
                {
-                       if (self.crylink_waitrelease)
+                       if (self.crylink_waitrelease && (!self.crylink_lastgroup || time > self.crylink_lastgroup.teleport_time))
                        {
                                // fired and released now!
                                if(self.crylink_lastgroup)
@@ -550,7 +552,6 @@ float w_crylink(float req)
                                        vector pos;
                                        entity linkjoineffect;
 
-
                                        if(self.crylink_waitrelease == 1)
                                        {
                                                pos = W_Crylink_LinkJoin(self.crylink_lastgroup, autocvar_g_balance_crylink_primary_joinspread * autocvar_g_balance_crylink_primary_speed, autocvar_g_balance_crylink_primary_jointime);
@@ -567,8 +568,6 @@ float w_crylink(float req)
                                        linkjoineffect.nextthink = time + w_crylink_linkjoin_time;
                                        linkjoineffect.owner = self;
                                        setorigin(linkjoineffect, pos);
-
-
                                }
                                self.crylink_waitrelease = 0;
                                if(!w_crylink(WR_CHECKAMMO1) && !w_crylink(WR_CHECKAMMO2))
index 1ae02b1613e47c5f1e7ba97a347688cd0a35b2ce..e46f749c79fdf0526f8031f2dc9c12360317ecbc 100644 (file)
@@ -232,7 +232,7 @@ void lgbeam_think()
                remove(self);
                return;
        }
-       if (self.owner.weaponentity.state != WS_INUSE || (self.owner.ammo_cells <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK || (g_freezetag && self.owner.freezetag_frozen))
+       if (self.owner.weaponentity.state != WS_INUSE || (self.owner.ammo_cells <= 0 && !(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)) || self.owner.deadflag != DEAD_NO || !self.owner.BUTTON_ATCK || self.owner.freezetag_frozen)
        {
                if(self == self.owner.lgbeam)
                        self.owner.lgbeam = world;
@@ -295,6 +295,7 @@ void W_Electro_Attack3 (void)
        entity beam, oldself;
 
        self.lgbeam = beam = spawn();
+       beam.classname = "lgbeam";
        beam.solid = SOLID_NOT;
        beam.think = lgbeam_think;
        beam.owner = self;
@@ -377,6 +378,15 @@ float w_electro(float req)
        {
                if (self.BUTTON_ATCK)
                {
+                       if(autocvar_g_balance_electro_lightning)
+                               if(self.BUTTON_ATCK_prev)
+                               {
+                                       // prolong the animtime while the gun is being fired
+                                       if(self.animstate_startframe == self.anim_shoot_x && self.animstate_numframes == self.anim_shoot_y)
+                                               weapon_thinkf(WFRAME_DONTCHANGE, autocvar_g_balance_electro_primary_animtime, w_ready);
+                                       else
+                                               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_electro_primary_animtime, w_ready);
+                               }
                        if (weapon_prepareattack(0, (autocvar_g_balance_electro_lightning ? 0 : autocvar_g_balance_electro_primary_refire)))
                        {
                                if(autocvar_g_balance_electro_lightning)
@@ -385,19 +395,24 @@ float w_electro(float req)
                                        {
                                                W_Electro_Attack3();
                                        }
-                                       self.BUTTON_ATCK_prev = 1;
+                                       if(!self.BUTTON_ATCK_prev)
+                                       {
+                                               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_electro_primary_animtime, w_ready);
+                                               self.BUTTON_ATCK_prev = 1;
+                                       }
                                }
                                else
                                {
                                        W_Electro_Attack();
+                                       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_electro_primary_animtime, w_ready);
                                }
-                               weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_electro_primary_animtime, w_ready);
                        }
                } else {
                        if(autocvar_g_balance_electro_lightning)
                        {
                                if (self.BUTTON_ATCK_prev != 0)
                                {
+                                       weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_electro_primary_animtime, w_ready);
                                        ATTACK_FINISHED(self) = time + autocvar_g_balance_electro_primary_refire * W_WeaponRateFactor();
                                }
                                self.BUTTON_ATCK_prev = 0;
@@ -411,7 +426,7 @@ float w_electro(float req)
                        W_Electro_Attack2();
                        self.electro_count = autocvar_g_balance_electro_secondary_count;
                        weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_electro_secondary_animtime, w_electro_checkattack);
-                       self.electro_secondarytime = time + autocvar_g_balance_electro_secondary_refire2;
+                       self.electro_secondarytime = time + autocvar_g_balance_electro_secondary_refire2 * W_WeaponRateFactor();
                }
        }
        else if (req == WR_PRECACHE)
index e3d3cb991883e1f209cb666712a89a3110f3693e..a07d54c2283e330741d84697ac72b50a7b33126d 100644 (file)
@@ -2,25 +2,17 @@
 REGISTER_WEAPON(HLAC, w_hlac, IT_CELLS, 6, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_MID, "hlac", "hlac", "Heavy Laser Assault Cannon");
 #else
 #ifdef SVQC
-.float HLAC_bulletcounter;
-void W_HLAC_Touch (void)
-{
-       PROJECTILE_TOUCH;
 
-       self.event_damage = SUB_Null;
-
-    RadiusDamage (self, self.owner, autocvar_g_balance_hlac_primary_damage, autocvar_g_balance_hlac_primary_edgedamage, autocvar_g_balance_hlac_primary_radius, world, autocvar_g_balance_hlac_primary_force, self.projectiledeathtype, other);
-
-       remove (self);
-}
-
-void W_HLAC_Touch2 (void)
+void W_HLAC_Touch (void)
 {
        PROJECTILE_TOUCH;
 
        self.event_damage = SUB_Null;
-
-    RadiusDamage (self, self.owner, autocvar_g_balance_hlac_secondary_damage, autocvar_g_balance_hlac_secondary_edgedamage, autocvar_g_balance_hlac_secondary_radius, world, autocvar_g_balance_hlac_secondary_force, self.projectiledeathtype, other);
+       
+       if(self.projectiledeathtype & HITTYPE_SECONDARY)
+               RadiusDamage (self, self.owner, autocvar_g_balance_hlac_secondary_damage, autocvar_g_balance_hlac_secondary_edgedamage, autocvar_g_balance_hlac_secondary_radius, world, autocvar_g_balance_hlac_secondary_force, self.projectiledeathtype, other);
+       else
+               RadiusDamage (self, self.owner, autocvar_g_balance_hlac_primary_damage, autocvar_g_balance_hlac_primary_edgedamage, autocvar_g_balance_hlac_primary_radius, world, autocvar_g_balance_hlac_primary_force, self.projectiledeathtype, other);
 
        remove (self);
 }
@@ -35,7 +27,7 @@ void W_HLAC_Attack (void)
         self.ammo_cells = self.ammo_cells - autocvar_g_balance_hlac_primary_ammo;
     }
 
-    spread = autocvar_g_balance_hlac_primary_spread_min + (autocvar_g_balance_hlac_primary_spread_add * self.HLAC_bulletcounter);
+    spread = autocvar_g_balance_hlac_primary_spread_min + (autocvar_g_balance_hlac_primary_spread_add * self.misc_bulletcounter);
     spread = min(spread,autocvar_g_balance_hlac_primary_spread_max);
     if(self.crouch)
         spread = spread * autocvar_g_balance_hlac_primary_spread_crouchmod;
@@ -51,7 +43,6 @@ void W_HLAC_Attack (void)
        missile = spawn ();
        missile.owner = self;
        missile.classname = "hlacbolt";
-       // missile.dmg = issecondary;
        missile.bot_dodge = TRUE;
 
     missile.bot_dodgerating = autocvar_g_balance_hlac_primary_damage;
@@ -63,7 +54,7 @@ void W_HLAC_Attack (void)
        setsize(missile, '0 0 0', '0 0 0');
 
        W_SetupProjectileVelocity(missile, autocvar_g_balance_hlac_primary_speed, spread);
-       missile.angles = vectoangles (missile.velocity);
+       //missile.angles = vectoangles (missile.velocity); // csqc
 
        missile.touch = W_HLAC_Touch;
        missile.think = SUB_Remove;
@@ -95,7 +86,6 @@ void W_HLAC_Attack2f (void)
        missile = spawn ();
        missile.owner = self;
        missile.classname = "hlacbolt";
-       // missile.dmg = issecondary;
        missile.bot_dodge = TRUE;
 
     missile.bot_dodgerating = autocvar_g_balance_hlac_secondary_damage;
@@ -107,9 +97,9 @@ void W_HLAC_Attack2f (void)
        setsize(missile, '0 0 0', '0 0 0');
 
        W_SetupProjectileVelocity(missile, autocvar_g_balance_hlac_secondary_speed, spread);
-       missile.angles = vectoangles (missile.velocity);
+       //missile.angles = vectoangles (missile.velocity); // csqc
 
-       missile.touch = W_HLAC_Touch2;
+       missile.touch = W_HLAC_Touch;
        missile.think = SUB_Remove;
 
     missile.nextthink = time + autocvar_g_balance_hlac_secondary_lifetime;
@@ -161,7 +151,7 @@ void HLAC_fire1_02()
 
                ATTACK_FINISHED(self) = time + autocvar_g_balance_hlac_primary_refire * W_WeaponRateFactor();
                W_HLAC_Attack();
-               self.HLAC_bulletcounter = self.HLAC_bulletcounter + 1;
+               self.misc_bulletcounter = self.misc_bulletcounter + 1;
         weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_refire, HLAC_fire1_02);
        }
        else
@@ -184,7 +174,7 @@ float w_hlac(float req)
                if (self.BUTTON_ATCK)
                if (weapon_prepareattack(0, autocvar_g_balance_hlac_primary_refire))
                {
-                       self.HLAC_bulletcounter = 0;
+                       self.misc_bulletcounter = 0;
                        W_HLAC_Attack();
                        weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_hlac_primary_refire, HLAC_fire1_02);
                }
index 42c8ec3ececc565e599fec2ba0541ba45823942f..25998bd5836ade6a515b7ffa5c9bd159b43a8f86 100644 (file)
@@ -1,5 +1,5 @@
 #ifdef REGISTER_WEAPON
-REGISTER_WEAPON(MINE_LAYER, w_minelayer, IT_ROCKETS, 4, WEP_FLAG_NORMAL | WEP_TYPE_SPLASH, BOT_PICKUP_RATING_HIGH, "minelayer", "minelayer", "Mine Layer");
+REGISTER_WEAPON(MINE_LAYER, w_minelayer, IT_ROCKETS, 4, WEP_TYPE_SPLASH, BOT_PICKUP_RATING_HIGH, "minelayer", "minelayer", "Mine Layer");
 #else
 #ifdef SVQC
 void W_Mine_Think (void);
index 7b1239b898859f206b22bfe7881b49d8b72a8fb6..031749be3868368bd338991344c0077292cca0f4 100644 (file)
@@ -47,8 +47,8 @@ void W_Nex_Attack (float issecondary)
        {
                charge = autocvar_g_balance_nex_charge_mindmg / mydmg + (1 - autocvar_g_balance_nex_charge_mindmg / mydmg) * self.nex_charge;
                self.nex_charge *= autocvar_g_balance_nex_charge_shot_multiplier; // do this AFTER setting mydmg/myforce
-                                                                                // O RLY? -- divVerent
-                                                                         // YA RLY -- FruitieX
+               // O RLY? -- divVerent
+               // YA RLY -- FruitieX
        }
        else
                charge = 1;
@@ -56,10 +56,10 @@ void W_Nex_Attack (float issecondary)
        myforce *= charge;
 
        W_SetupShot (self, TRUE, 5, "weapons/nexfire.wav", CHAN_WEAPON, mydmg);
-    if(charge > autocvar_g_balance_nex_charge_limit && autocvar_g_balance_nex_charge_limit) // if the Nex is overcharged, we play an extra sound
-    {
-        sound (self, CHAN_WEAPON2, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_limit) / (1 - 0.5 * autocvar_g_balance_nex_charge_limit), ATTN_NORM);
-    }
+       if(charge > autocvar_g_balance_nex_charge_limit && autocvar_g_balance_nex_charge_limit) // if the Nex is overcharged, we play an extra sound
+       {
+               sound (self, CHAN_WEAPON2, "weapons/nexcharge.wav", VOL_BASE * (charge - 0.5 * autocvar_g_balance_nex_charge_limit) / (1 - 0.5 * autocvar_g_balance_nex_charge_limit), ATTN_NORM);
+       }
 
        yoda = 0;
        FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_NEX);
@@ -69,7 +69,7 @@ void W_Nex_Attack (float issecondary)
 
        //beam and muzzle flash done on client
        SendCSQCNexBeamParticle(charge);
-       
+
        // flash and burn the wall
        if (trace_ent.solid == SOLID_BSP && !(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT))
                Damage_DamageInfo(trace_endpos, mydmg, 0, 0, myforce * w_shotdir, WEP_NEX, self);
@@ -94,27 +94,13 @@ float w_nex(float req)
                if(autocvar_g_balance_nex_charge && self.nex_charge < autocvar_g_balance_nex_charge_limit)
                        self.nex_charge = min(1, self.nex_charge + autocvar_g_balance_nex_charge_rate * frametime / W_TICSPERFRAME);
 
-        if(autocvar_g_balance_nex_charge)
-        {
-            self.weaponentity_glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
-            self.weaponentity_glowmod_y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
-            self.weaponentity_glowmod_z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
-
-            if(self.nex_charge > autocvar_g_balance_nex_charge_limit)
-            {
-                self.weaponentity_glowmod_x = self.weaponentity_glowmod_x + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
-                self.weaponentity_glowmod_y = self.weaponentity_glowmod_y + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
-                self.weaponentity_glowmod_z = self.weaponentity_glowmod_z + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
-            }
-        }
-
                if(autocvar_g_balance_nex_secondary_chargepool)
-               if(self.nex_chargepool_ammo < 1)
-               {
-                       if(self.nex_chargepool_pauseregen_finished < time)
-                               self.nex_chargepool_ammo = min(1, self.nex_chargepool_ammo + autocvar_g_balance_nex_secondary_chargepool_regen * frametime / W_TICSPERFRAME);
-                       self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_nex_secondary_chargepool_pause_health_regen);
-               }
+                       if(self.nex_chargepool_ammo < 1)
+                       {
+                               if(self.nex_chargepool_pauseregen_finished < time)
+                                       self.nex_chargepool_ammo = min(1, self.nex_chargepool_ammo + autocvar_g_balance_nex_secondary_chargepool_regen * frametime / W_TICSPERFRAME);
+                               self.pauseregen_finished = max(self.pauseregen_finished, time + autocvar_g_balance_nex_secondary_chargepool_pause_health_regen);
+                       }
 
                if (self.BUTTON_ATCK)
                {
@@ -124,43 +110,52 @@ float w_nex(float req)
                                weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_nex_primary_animtime, w_ready);
                        }
                }
-               if (self.BUTTON_ATCK2)
+               if ((autocvar_g_balance_nex_secondary_charge && !autocvar_g_balance_nex_secondary) ? self.BUTTON_ZOOM : self.BUTTON_ATCK2)
                {
                        if(autocvar_g_balance_nex_secondary_charge)
                        {
                                self.nex_charge_rottime = time + autocvar_g_balance_nex_charge_rot_pause;
                                dt = frametime / W_TICSPERFRAME;
 
-                               if(autocvar_g_balance_nex_secondary_chargepool)
+                               if(self.nex_charge < 1)
                                {
-                                       if(autocvar_g_balance_nex_secondary_ammo)
+                                       if(autocvar_g_balance_nex_secondary_chargepool)
                                        {
-                                               // always deplete if secondary is held
-                                               self.nex_chargepool_ammo = max(0, self.nex_chargepool_ammo - autocvar_g_balance_nex_secondary_ammo * dt);
+                                               if(autocvar_g_balance_nex_secondary_ammo)
+                                               {
+                                                       // always deplete if secondary is held
+                                                       self.nex_chargepool_ammo = max(0, self.nex_chargepool_ammo - autocvar_g_balance_nex_secondary_ammo * dt);
 
-                                               dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate);
-                                               self.nex_chargepool_pauseregen_finished = time + autocvar_g_balance_nex_secondary_chargepool_pause_regen;
-                                               dt = min(dt, self.nex_chargepool_ammo);
-                                               dt = max(0, dt);
+                                                       dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate);
+                                                       self.nex_chargepool_pauseregen_finished = time + autocvar_g_balance_nex_secondary_chargepool_pause_regen;
+                                                       dt = min(dt, self.nex_chargepool_ammo);
+                                                       dt = max(0, dt);
 
-                                               self.nex_charge += dt * autocvar_g_balance_nex_secondary_charge_rate;
+                                                       self.nex_charge += dt * autocvar_g_balance_nex_secondary_charge_rate;
+                                               }
                                        }
-                               }
 
-                               else if(autocvar_g_balance_nex_secondary_ammo)
-                               {
-                                       if(self.nex_charge < 1)
+                                       else if(autocvar_g_balance_nex_secondary_ammo)
                                        {
-                                               dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate);
-                                               if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+                                               if(self.BUTTON_ATCK2) // only eat ammo when the button is pressed
                                                {
-                                                       dt = min(dt, (self.ammo_cells - autocvar_g_balance_nex_primary_ammo) / autocvar_g_balance_nex_secondary_ammo);
-                                                       dt = max(0, dt);
-                                                       if(dt > 0)
+                                                       dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate);
+                                                       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
                                                        {
-                                                               self.ammo_cells = max(autocvar_g_balance_nex_secondary_ammo, self.ammo_cells - autocvar_g_balance_nex_secondary_ammo * dt);
+                                                               dt = min(dt, (self.ammo_cells - autocvar_g_balance_nex_primary_ammo) / autocvar_g_balance_nex_secondary_ammo);
+                                                               dt = max(0, dt);
+                                                               if(dt > 0)
+                                                               {
+                                                                       self.ammo_cells = max(autocvar_g_balance_nex_secondary_ammo, self.ammo_cells - autocvar_g_balance_nex_secondary_ammo * dt);
+                                                               }
                                                        }
+                                                       self.nex_charge += dt * autocvar_g_balance_nex_secondary_charge_rate;
                                                }
+                                       }
+
+                                       else
+                                       {
+                                               dt = min(dt, (1 - self.nex_charge) / autocvar_g_balance_nex_secondary_charge_rate);
                                                self.nex_charge += dt * autocvar_g_balance_nex_secondary_charge_rate;
                                        }
                                }
@@ -174,6 +169,20 @@ float w_nex(float req)
                                }
                        }
                }
+
+               if(autocvar_g_balance_nex_charge)
+               {
+                       self.weaponentity_glowmod_x = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
+                       self.weaponentity_glowmod_y = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
+                       self.weaponentity_glowmod_z = autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_half * min(1, self.nex_charge / autocvar_g_balance_nex_charge_limit);
+
+                       if(self.nex_charge > autocvar_g_balance_nex_charge_limit)
+                       {
+                               self.weaponentity_glowmod_x = self.weaponentity_glowmod_x + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_red_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
+                               self.weaponentity_glowmod_y = self.weaponentity_glowmod_y + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_green_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
+                               self.weaponentity_glowmod_z = self.weaponentity_glowmod_z + autocvar_g_weapon_charge_colormod_hdrmultiplier * autocvar_g_weapon_charge_colormod_blue_full * (self.nex_charge - autocvar_g_balance_nex_charge_limit) / (1 - autocvar_g_balance_nex_charge_limit);
+                       }
+               }
        }
        else if (req == WR_PRECACHE)
        {
index 08c4a901e12083d7bdd972ed8755e3010cf97d9e..d9d717ecdeb6d3165d2c2109d74b55917f756b19 100644 (file)
@@ -56,9 +56,12 @@ void shotgun_meleethink (void)
        vector angle;
        angle = v_forward;
 
+       float meleetime;
+       meleetime = autocvar_g_balance_shotgun_secondary_melee_time * W_WeaponRateFactor();
+
        // perform trace
        float f;
-       f = (self.cnt + autocvar_g_balance_shotgun_secondary_melee_time - time) / autocvar_g_balance_shotgun_secondary_melee_time * 2 - 1;
+       f = (self.cnt + meleetime - time) / meleetime * 2 - 1;
        vector targpos;
        targpos = self.owner.origin + self.owner.view_ofs + angle * autocvar_g_balance_shotgun_secondary_melee_range + v_right * f * autocvar_g_balance_shotgun_secondary_melee_swing + v_up * f * autocvar_g_balance_shotgun_secondary_melee_swing;
 
@@ -74,7 +77,7 @@ void shotgun_meleethink (void)
                Damage (trace_ent, self.owner, self.owner, autocvar_g_balance_shotgun_secondary_damage * min(1, f + 1), WEP_SHOTGUN | HITTYPE_SECONDARY , self.owner.origin + self.owner.view_ofs, force);
                remove(self);
        }
-       else if(time >= self.cnt + autocvar_g_balance_shotgun_secondary_melee_time) // missed, remove ent
+       else if(time >= self.cnt + meleetime) // missed, remove ent
                remove(self);
        else // continue swinging the weapon in hope of hitting someone :)
                self.nextthink = time;
diff --git a/qcsrc/server/w_sniperrifle.qc b/qcsrc/server/w_sniperrifle.qc
new file mode 100644 (file)
index 0000000..22992dc
--- /dev/null
@@ -0,0 +1,353 @@
+#ifdef REGISTER_WEAPON
+REGISTER_WEAPON(SNIPERRIFLE, w_sniperrifle, IT_NAILS, 7, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "campingrifle", "sniperrifle", "Sniper Rifle");
+#else
+#ifdef SVQC
+//Sniper rifle Primary mode: manually operated bolt*, Secondary: full automatic**
+//* Manually operating the bolt means that all the power of the gas is used to propell the bullet. In this mode the bolt is prevented from moving backwards in response to the firing of the bullet.
+//** In fully automatic mode some of the gas is used to extract and reload the next cartrige, thus there is less power and range.
+
+.float sniperrifle_accumulator;
+
+float W_SniperRifle_CheckMaxBullets(float checkammo)
+{
+       float maxbulls;
+       maxbulls = autocvar_g_balance_sniperrifle_magazinecapacity;
+       if(!maxbulls)
+               maxbulls = 8; // match HUD
+       if(checkammo)
+               if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+                       maxbulls = min(maxbulls, floor(self.ammo_nails / min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo)));
+       if(self.sniperrifle_bulletcounter > maxbulls || !autocvar_g_balance_sniperrifle_magazinecapacity)
+               self.sniperrifle_bulletcounter = maxbulls;
+       return (self.sniperrifle_bulletcounter == maxbulls);
+}
+
+void W_SniperRifle_ReloadedAndReady()
+{
+       float t;
+       self.sniperrifle_bulletcounter = autocvar_g_balance_sniperrifle_magazinecapacity;
+       W_SniperRifle_CheckMaxBullets(TRUE);
+       t = ATTACK_FINISHED(self) - autocvar_g_balance_sniperrifle_reloadtime - 1;
+       ATTACK_FINISHED(self) = t;
+       w_ready();
+}
+
+float W_SniperRifle_Reload()
+{
+       float t;
+
+       W_SniperRifle_CheckMaxBullets(TRUE);
+
+       if(self.ammo_nails < min(autocvar_g_balance_sniperrifle_primary_ammo, autocvar_g_balance_sniperrifle_secondary_ammo)) // when we get here, bulletcounter must be 0 or -1
+       {
+               print("cannot reload... not enough bullets\n");
+               self.sniperrifle_bulletcounter = -1; // reload later
+               W_SwitchToOtherWeapon(self);
+               return 0;
+       }
+       
+       if (self.sniperrifle_bulletcounter >= autocvar_g_balance_sniperrifle_magazinecapacity)
+               return 0;
+
+       if (self.weaponentity)
+       {
+               if (self.weaponentity.wframe == WFRAME_RELOAD)
+                       return 0;
+
+               // allow to switch away while reloading, but this will cause a new reload!
+               self.weaponentity.state = WS_READY;
+       }
+
+       sound (self, CHAN_WEAPON2, "weapons/campingrifle_reload.wav", VOL_BASE, ATTN_NORM);
+
+       t = max(time, ATTACK_FINISHED(self)) + autocvar_g_balance_sniperrifle_reloadtime + 1;
+       ATTACK_FINISHED(self) = t;
+
+       weapon_thinkf(WFRAME_RELOAD, autocvar_g_balance_sniperrifle_reloadtime, W_SniperRifle_ReloadedAndReady);
+
+       self.sniperrifle_bulletcounter = -1;
+
+       return 1;
+}
+
+void W_SniperRifle_CheckReloadAndReady()
+{
+       w_ready();
+       if(self.sniperrifle_bulletcounter <= 0)
+               if(W_SniperRifle_Reload())
+                       return;
+}
+
+void W_SniperRifle_FireBullet(float pSpread, float pDamage, float pHeadshotAddedDamage, float pForce, float pSpeed, float pLifetime, float pAmmo, float deathtype, float pBulletConstant)
+{
+       if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
+               self.ammo_nails -= pAmmo;
+
+       if(deathtype & HITTYPE_SECONDARY)
+               W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, "weapons/campingrifle_fire2.wav", CHAN_WEAPON, autocvar_g_balance_sniperrifle_secondary_damage + autocvar_g_balance_sniperrifle_secondary_headshotaddeddamage);
+       else
+               W_SetupShot (self, autocvar_g_antilag_bullets && pSpeed >= autocvar_g_antilag_bullets, 2, "weapons/campingrifle_fire.wav", CHAN_WEAPON, autocvar_g_balance_sniperrifle_primary_damage + autocvar_g_balance_sniperrifle_primary_headshotaddeddamage);
+
+       pointparticles(particleeffectnum("shotgun_muzzleflash"), w_shotorg, w_shotdir * 2000, 1);
+
+       if(self.BUTTON_ZOOM) // if zoomed, shoot from the eye
+       {
+               w_shotdir = v_forward;
+               w_shotorg = self.origin + self.view_ofs + ((w_shotorg - self.origin - self.view_ofs) * v_forward) * v_forward;
+       }
+
+       if(deathtype & HITTYPE_SECONDARY)
+               fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (autocvar_g_balance_sniperrifle_secondary_tracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
+       else
+               fireBallisticBullet(w_shotorg, w_shotdir, pSpread, pSpeed, pLifetime, pDamage, pHeadshotAddedDamage / pDamage, pForce, deathtype, (autocvar_g_balance_sniperrifle_primary_tracer ? EF_RED : EF_BLUE), 1, pBulletConstant);
+       endFireBallisticBullet();
+
+       if (autocvar_g_casings >= 2)
+               SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
+       
+       self.sniperrifle_bulletcounter = self.sniperrifle_bulletcounter - 1;
+       W_SniperRifle_CheckMaxBullets(TRUE);
+}
+
+void W_SniperRifle_Attack()
+{
+       W_SniperRifle_FireBullet(autocvar_g_balance_sniperrifle_primary_spread, autocvar_g_balance_sniperrifle_primary_damage, autocvar_g_balance_sniperrifle_primary_headshotaddeddamage, autocvar_g_balance_sniperrifle_primary_force, autocvar_g_balance_sniperrifle_primary_speed, autocvar_g_balance_sniperrifle_primary_lifetime, autocvar_g_balance_sniperrifle_primary_ammo, WEP_SNIPERRIFLE, autocvar_g_balance_sniperrifle_primary_bulletconstant);
+}
+
+void W_SniperRifle_Attack2()
+{
+       W_SniperRifle_FireBullet(autocvar_g_balance_sniperrifle_secondary_spread, autocvar_g_balance_sniperrifle_secondary_damage, autocvar_g_balance_sniperrifle_secondary_headshotaddeddamage, autocvar_g_balance_sniperrifle_secondary_force, autocvar_g_balance_sniperrifle_secondary_speed, autocvar_g_balance_sniperrifle_secondary_lifetime, autocvar_g_balance_sniperrifle_secondary_ammo, WEP_SNIPERRIFLE | HITTYPE_SECONDARY, autocvar_g_balance_sniperrifle_secondary_bulletconstant);
+}
+
+void spawnfunc_weapon_sniperrifle (void)
+{
+       weapon_defaultspawnfunc(WEP_SNIPERRIFLE);
+}
+
+// compatibility alias
+void spawnfunc_weapon_campingrifle (void)
+{
+       spawnfunc_weapon_sniperrifle();
+}
+
+.void(void) sniperrifle_bullethail_attackfunc;
+.float sniperrifle_bullethail_frame;
+.float sniperrifle_bullethail_animtime;
+.float sniperrifle_bullethail_refire;
+void W_SniperRifle_BulletHail_Continue()
+{
+       float r, sw, af;
+       W_SniperRifle_CheckReloadAndReady();
+       if(self.sniperrifle_bulletcounter < 0)
+               return; // reloading, so we are done
+       sw = self.switchweapon; // make it not detect weapon changes as reason to abort firing
+       af = ATTACK_FINISHED(self);
+       self.switchweapon = self.weapon;
+       ATTACK_FINISHED(self) = time;
+       print(ftos(self.ammo_nails), "\n");
+       r = weapon_prepareattack(self.sniperrifle_bullethail_frame == WFRAME_FIRE2, self.sniperrifle_bullethail_refire);
+       if(self.switchweapon == self.weapon)
+               self.switchweapon = sw;
+       if(r)
+       {
+               self.sniperrifle_bullethail_attackfunc();
+               weapon_thinkf(self.sniperrifle_bullethail_frame, self.sniperrifle_bullethail_animtime, W_SniperRifle_BulletHail_Continue);
+               print("thinkf set\n");
+       }
+       else
+       {
+               ATTACK_FINISHED(self) = af; // reset attack_finished if we didn't fire, so the last shot enforces the refire time
+               print("out of ammo... ", ftos(self.weaponentity.state), "\n");
+       }
+}
+
+void W_SniperRifle_BulletHail(float mode, void(void) AttackFunc, float fr, float animtime, float refire)
+{
+       // if we get here, we have at least one bullet to fire
+       AttackFunc();
+       if(mode)
+       {
+               // continue hail
+               self.sniperrifle_bullethail_attackfunc = AttackFunc;
+               self.sniperrifle_bullethail_frame = fr;
+               self.sniperrifle_bullethail_animtime = animtime;
+               self.sniperrifle_bullethail_refire = refire;
+               weapon_thinkf(fr, animtime, W_SniperRifle_BulletHail_Continue);
+       }
+       else
+       {
+               // just one shot
+               weapon_thinkf(fr, animtime, W_SniperRifle_CheckReloadAndReady);
+       }
+}
+
+.float bot_secondary_sniperriflemooth;
+float w_sniperrifle(float req)
+{
+       float full;
+       if (req == WR_AIM)
+       {
+               self.BUTTON_ATCK=FALSE;
+               self.BUTTON_ATCK2=FALSE;
+               if(vlen(self.origin-self.enemy.origin) > 1000)
+                       self.bot_secondary_sniperriflemooth = 0;
+               if(self.bot_secondary_sniperriflemooth == 0)
+               {
+                       if(bot_aim(autocvar_g_balance_sniperrifle_primary_speed, 0, autocvar_g_balance_sniperrifle_primary_lifetime, TRUE))
+                       {
+                               self.BUTTON_ATCK = TRUE;
+                               if(random() < 0.01) self.bot_secondary_sniperriflemooth = 1;
+                       }
+               }
+               else
+               {
+                       if(bot_aim(autocvar_g_balance_sniperrifle_secondary_speed, 0, autocvar_g_balance_sniperrifle_secondary_lifetime, TRUE))
+                       {
+                               self.BUTTON_ATCK2 = TRUE;
+                               if(random() < 0.03) self.bot_secondary_sniperriflemooth = 0;
+                       }
+               }
+       }
+       else if (req == WR_THINK)
+       {
+               if(self.sniperrifle_bulletcounter < 0) // forced reload (e.g. because interrupted)
+               {
+            self.wish_reload = 1;
+               }
+               else
+               {
+                       self.sniperrifle_accumulator = bound(time - autocvar_g_balance_sniperrifle_bursttime, self.sniperrifle_accumulator, time);
+                       if (self.BUTTON_ATCK)
+                       if (weapon_prepareattack_check(0, autocvar_g_balance_sniperrifle_primary_refire))
+                       if (time >= self.sniperrifle_accumulator + autocvar_g_balance_sniperrifle_primary_burstcost)
+                       {
+                               weapon_prepareattack_do(0, autocvar_g_balance_sniperrifle_primary_refire);
+                               W_SniperRifle_BulletHail(autocvar_g_balance_sniperrifle_primary_bullethail, W_SniperRifle_Attack, WFRAME_FIRE1, autocvar_g_balance_sniperrifle_primary_animtime, autocvar_g_balance_sniperrifle_primary_refire);
+                               self.sniperrifle_accumulator += autocvar_g_balance_sniperrifle_primary_burstcost;
+                       }
+                       if (self.BUTTON_ATCK2)
+                       {       
+                               if (autocvar_g_balance_sniperrifle_secondary)
+                               {
+                    if(autocvar_g_balance_sniperrifle_secondary_reload)
+                        self.wish_reload = 1;
+                    else
+                    {
+                        if (weapon_prepareattack_check(1, autocvar_g_balance_sniperrifle_secondary_refire))
+                        if (time >= self.sniperrifle_accumulator + autocvar_g_balance_sniperrifle_secondary_burstcost)
+                        {
+                            weapon_prepareattack_do(1, autocvar_g_balance_sniperrifle_secondary_refire);
+                            W_SniperRifle_BulletHail(autocvar_g_balance_sniperrifle_secondary_bullethail, W_SniperRifle_Attack2, WFRAME_FIRE2, autocvar_g_balance_sniperrifle_secondary_animtime, autocvar_g_balance_sniperrifle_primary_refire);
+                            self.sniperrifle_accumulator += autocvar_g_balance_sniperrifle_secondary_burstcost;
+                        }
+                    }
+                               }
+                       }
+               }
+        if(self.wish_reload)
+        {
+            if(self.switchweapon == self.weapon)
+            {
+                if(self.weaponentity.state == WS_READY)
+                {
+                    self.wish_reload = 0;
+                    W_SniperRifle_Reload();
+                }
+            }
+        }
+       }
+       else if (req == WR_PRECACHE)
+       {
+               precache_model ("models/weapons/g_campingrifle.md3");
+               precache_model ("models/weapons/v_campingrifle.md3");
+               precache_model ("models/weapons/h_campingrifle.iqm");
+               precache_sound ("weapons/campingrifle_reload.wav");
+               precache_sound ("weapons/campingrifle_fire.wav");
+               precache_sound ("weapons/campingrifle_fire2.wav");
+       }
+       else if (req == WR_SETUP)
+       {
+               weapon_setup(WEP_SNIPERRIFLE);
+
+               full = W_SniperRifle_CheckMaxBullets(TRUE);
+               if(autocvar_g_balance_sniperrifle_auto_reload_on_switch)
+                       if(!full)
+                               self.sniperrifle_bulletcounter = -1;
+       }
+       else if (req == WR_CHECKAMMO1)
+               return self.ammo_nails >= autocvar_g_balance_sniperrifle_primary_ammo;
+       else if (req == WR_CHECKAMMO2)
+               return self.ammo_nails >= autocvar_g_balance_sniperrifle_secondary_ammo;
+       else if (req == WR_RELOAD)
+       {
+        self.wish_reload = 1;
+       }
+       else if (req == WR_RESETPLAYER)
+       {
+               self.sniperrifle_accumulator = time - autocvar_g_balance_sniperrifle_bursttime;
+               self.sniperrifle_bulletcounter = autocvar_g_balance_sniperrifle_magazinecapacity;
+               W_SniperRifle_CheckMaxBullets(FALSE);
+       }
+       return TRUE;
+};
+#endif
+#ifdef CSQC
+float w_sniperrifle(float req)
+{
+       if(req == WR_IMPACTEFFECT)
+       {
+               vector org2;
+               org2 = w_org + w_backoff * 2;
+               pointparticles(particleeffectnum("machinegun_impact"), org2, w_backoff * 1000, 1);
+               if(!w_issilent)
+               {
+                       if(w_random < 0.2)
+                               sound(self, CHAN_PROJECTILE, "weapons/ric1.wav", VOL_BASE, ATTN_NORM);
+                       else if(w_random < 0.4)
+                               sound(self, CHAN_PROJECTILE, "weapons/ric2.wav", VOL_BASE, ATTN_NORM);
+                       else if(w_random < 0.5)
+                               sound(self, CHAN_PROJECTILE, "weapons/ric3.wav", VOL_BASE, ATTN_NORM);
+               }
+       }
+       else if(req == WR_PRECACHE)
+       {
+               precache_sound("weapons/ric1.wav");
+               precache_sound("weapons/ric2.wav");
+               precache_sound("weapons/ric3.wav");
+       }
+       else if (req == WR_SUICIDEMESSAGE)
+       {
+               if(w_deathtype & HITTYPE_SECONDARY)
+                       w_deathtypestring = "%s shot themself automatically";
+               else
+                       w_deathtypestring = "%s sniped themself somehow";
+       }
+       else if (req == WR_KILLMESSAGE)
+       {
+               if(w_deathtype & HITTYPE_SECONDARY)
+               {
+                       if(w_deathtype & HITTYPE_BOUNCE)
+                               w_deathtypestring = "%s failed to hide from %s's bullet hail";
+                       else
+                               w_deathtypestring = "%s died in %s's bullet hail";
+               }
+               else
+               {
+                       if(w_deathtype & HITTYPE_BOUNCE)
+                       {
+                               // TODO special headshot message here too?
+                               w_deathtypestring = "%s failed to hide from %s's rifle";
+                       }
+                       else
+                       {
+                               if(w_deathtype & HITTYPE_HEADSHOT)
+                                       w_deathtypestring = "%s got hit in the head by %s";
+                               else
+                                       w_deathtypestring = "%s was sniped by %s";
+                       }
+               }
+       }
+       return TRUE;
+}
+#endif
+#endif
index 2d50143deed1ddad0ca5623cca74363ed66ab9aa..f3dc51ce832cba3c280d30265aec11f6e28eb56d 100644 (file)
@@ -2,7 +2,6 @@
 REGISTER_WEAPON(UZI, w_uzi, IT_NAILS, 3, WEP_FLAG_NORMAL | WEP_TYPE_HITSCAN, BOT_PICKUP_RATING_MID, "uzi", "uzi", "Machine Gun");
 #else
 #ifdef SVQC
-.entity muzzle_flash;
 
 // leilei's fancy muzzleflash stuff
 void Uzi_Flash_Go() 
@@ -40,17 +39,16 @@ void UziFlash()
        self.muzzle_flash.owner = self;
 }
 
-.float uzi_bulletcounter;
 void W_Uzi_Attack (float deathtype)
 {
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
        {
-               if (self.uzi_bulletcounter == 1)
+               if (self.misc_bulletcounter == 1)
                        self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_first_ammo;
                else
                        self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_sustained_ammo;
        }
-       W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CHAN_WEAPON, ((self.uzi_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage));
+       W_SetupShot (self, autocvar_g_antilag_bullets && autocvar_g_balance_uzi_speed >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CHAN_WEAPON, ((self.misc_bulletcounter == 1) ? autocvar_g_balance_uzi_first_damage : autocvar_g_balance_uzi_sustained_damage));
        if (!g_norecoil)
        {
                self.punchangle_x = random () - 0.5;
@@ -60,7 +58,7 @@ void W_Uzi_Attack (float deathtype)
        // this attack_finished just enforces a cooldown at the end of a burst
        ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_first_refire * W_WeaponRateFactor();
 
-       if (self.uzi_bulletcounter == 1)
+       if (self.misc_bulletcounter == 1)
                fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_first_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_first_damage, 0, autocvar_g_balance_uzi_first_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
        else
                fireBallisticBullet(w_shotorg, w_shotdir, autocvar_g_balance_uzi_sustained_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, deathtype, 0, 1, autocvar_g_balance_uzi_bulletconstant);
@@ -92,7 +90,7 @@ void uzi_fire1_02()
                        w_ready();
                        return;
                }
-               self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
+               self.misc_bulletcounter = self.misc_bulletcounter + 1;
                W_Uzi_Attack(WEP_UZI);
                weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, uzi_fire1_02);
        }
@@ -128,11 +126,11 @@ void uzi_mode1_fire_auto()
                self.punchangle_y = random () - 0.5;
        }
        
-       uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.uzi_bulletcounter), autocvar_g_balance_uzi_spread_max);
+       uzi_spread = bound(autocvar_g_balance_uzi_spread_min, autocvar_g_balance_uzi_spread_min + (autocvar_g_balance_uzi_spread_add * self.misc_bulletcounter), autocvar_g_balance_uzi_spread_max);
        fireBallisticBullet(w_shotorg, w_shotdir, uzi_spread, autocvar_g_balance_uzi_speed, 5, autocvar_g_balance_uzi_sustained_damage, 0, autocvar_g_balance_uzi_sustained_force, WEP_UZI, 0, 1, autocvar_g_balance_uzi_bulletconstant);
        endFireBallisticBullet();
        
-       self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
+       self.misc_bulletcounter = self.misc_bulletcounter + 1;
        
        pointparticles(particleeffectnum("uzi_muzzleflash"), w_shotorg, w_shotdir * 1000, 1);
 
@@ -168,13 +166,15 @@ void uzi_mode1_fire_burst()
        if (autocvar_g_casings >= 2) // casing code
                SpawnCasing (((random () * 50 + 50) * v_right) - (v_forward * (random () * 25 + 25)) - ((random () * 5 - 70) * v_up), 2, vectoangles(v_forward),'0 250 0', 100, 3, self);
 
-       self.uzi_bulletcounter = self.uzi_bulletcounter + 1;
-       if (self.uzi_bulletcounter == 0)
-               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_burst_refire2, w_ready);
+       self.misc_bulletcounter = self.misc_bulletcounter + 1;
+       if (self.misc_bulletcounter == 0)
+       {
+               ATTACK_FINISHED(self) = time + autocvar_g_balance_uzi_burst_refire2 * W_WeaponRateFactor();
+               weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_burst_animtime, w_ready);
+       }
        else
        {
                weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_burst_refire, uzi_mode1_fire_burst);
-               dprint("bullets:", ftos(self.uzi_bulletcounter),"\n");
        }
                
 }
@@ -197,7 +197,7 @@ float w_uzi(float req)
                        if (self.BUTTON_ATCK)
                        if (weapon_prepareattack(0, 0))
                        {                               
-                               self.uzi_bulletcounter = 0;
+                               self.misc_bulletcounter = 0;
                                uzi_mode1_fire_auto();
                        }
                        
@@ -214,7 +214,7 @@ float w_uzi(float req)
                                if not(self.items & IT_UNLIMITED_WEAPON_AMMO)   
                                        self.ammo_nails = self.ammo_nails - autocvar_g_balance_uzi_burst_ammo;
 
-                               self.uzi_bulletcounter = autocvar_g_balance_uzi_burst * -1;
+                               self.misc_bulletcounter = autocvar_g_balance_uzi_burst * -1;
                                uzi_mode1_fire_burst();
                        }
                }
@@ -224,7 +224,7 @@ float w_uzi(float req)
                        if (self.BUTTON_ATCK)
                        if (weapon_prepareattack(0, 0))
                        {
-                               self.uzi_bulletcounter = 1;
+                               self.misc_bulletcounter = 1;
                                W_Uzi_Attack(WEP_UZI); // sets attack_finished
                                weapon_thinkf(WFRAME_FIRE1, autocvar_g_balance_uzi_sustained_refire, uzi_fire1_02);
                        }
@@ -232,7 +232,7 @@ float w_uzi(float req)
                        if (self.BUTTON_ATCK2 && autocvar_g_balance_uzi_first)
                        if (weapon_prepareattack(1, 0))
                        {
-                               self.uzi_bulletcounter = 1;
+                               self.misc_bulletcounter = 1;
                                W_Uzi_Attack(WEP_UZI | HITTYPE_SECONDARY); // sets attack_finished
                                weapon_thinkf(WFRAME_FIRE2, autocvar_g_balance_uzi_first_refire, w_ready);
                        }
index 5bbf02676f7a16e29a6b1e7dbbd19a0d80bf65d1..bda0e77b8a972543b558d4051a13aecdf6d7acec 100644 (file)
@@ -81,8 +81,13 @@ void WaypointSprite_UpdateTeamRadar(entity e, float icon, vector col)
        e.SendFlags |= 32;
 }
 
+.float waypointsprite_pingtime;
 void WaypointSprite_Ping(entity e)
 {
+       // anti spam
+       if(time < e.waypointsprite_pingtime)
+               return;
+       e.waypointsprite_pingtime = time + 0.3;
        // ALWAYS sends (this causes a radar circle), thus no check
        e.cnt |= 0x80;
        e.SendFlags |= 32;
index 0bd63e9fb2ad9d57e61582ddf0d691cff8a5f831..b7c87a34a63ff22494dbecbb418dc9fd25cd7d74 100755 (executable)
@@ -14,6 +14,7 @@ for b in balance*.cfg; do
                awk '/^seta? g_/ { print $2; }' "$b"                     | sort -u | tr -d '\r' > "$B"
                diff "$A" "$B" | grep '^[<>]' | sort
                rm -f "$A" "$B"
-               exit 1
+               echo "Please wait for 30 seconds, so you have had enough time to read this..."
+               sleep 30
        fi
 done
index ec46525c90a1ec87dea004ba58f94e62ad837625..50c593d0457f6dc70d2474603ea47162e3288810 100644 (file)
@@ -63,6 +63,7 @@ Kristian "morfar" Johansson
 kojn
 Maik "SavageX" Merten
 MrBougo
+Ruszkai "C.Brutail" Ákos
 Samual Lenks
 Stephan "esteel" Stahl
 Wolfgang "Blub\0" Bumiller