mirror of
https://github.com/ENSL/NS.git
synced 2025-04-22 09:31:34 +00:00
Compare commits
182 commits
Author | SHA1 | Date | |
---|---|---|---|
|
be1aead879 | ||
|
cea65c1fdc | ||
|
b1bcdd2f70 | ||
|
290ad067eb | ||
|
a01d8a6708 | ||
|
0a15148352 | ||
|
4102dabe05 | ||
|
11512d9d28 | ||
|
733ad6eb04 | ||
|
2842aba0bb | ||
|
65155fb3f0 | ||
|
9ee01c0d64 | ||
|
6f263d400b | ||
|
0897cf15a0 | ||
|
73ff332b68 | ||
|
5b83a4c886 | ||
|
2b27b90f25 | ||
|
f427a9c052 | ||
|
ef7e7a9178 | ||
|
36318cd1d4 | ||
|
9a4a6b3660 | ||
|
9452b8a0c3 | ||
|
8fef7241a0 | ||
|
e17fba76ea | ||
|
91231ac069 | ||
|
c2e41c2011 | ||
|
5beb313546 | ||
|
c0bef7cb05 | ||
|
6ffc3d3258 | ||
|
d17cb601eb | ||
|
ff3b4afb1c | ||
|
fcddb5b6c3 | ||
|
4736cdcc53 | ||
|
37a310a568 | ||
|
c626c27df4 | ||
|
38d8031ab1 | ||
|
27d5db3b03 | ||
|
8220ae1738 | ||
|
a6c6f8c8e9 | ||
|
6fd6cb8b8b | ||
|
2f6ddf68bb | ||
|
92db73eb89 | ||
|
1363f48d96 | ||
|
802174ddcd | ||
|
0f578e359f | ||
|
6ed297c68f | ||
|
eb15f8e1d5 | ||
|
f5e5b9b41a | ||
|
6021daabab | ||
|
8835eb0a60 | ||
|
710518f55a | ||
|
b5177e8e47 | ||
|
e24041c64a | ||
|
4f32271532 | ||
|
019045c5c7 | ||
|
e08554b34f | ||
|
b53db7408f | ||
|
aa3ddd6017 | ||
|
1b8460c74a | ||
|
0f1365b785 | ||
|
1f3940091a | ||
|
d2dc2fd7cf | ||
|
c800522dcc | ||
|
af04d9a078 | ||
|
23dc6c3a9c | ||
|
c5153c4ab1 | ||
|
f39297efcb | ||
|
3b8049d226 | ||
|
fb214971d5 | ||
|
f191b913d3 | ||
|
44f1f12a4f | ||
|
fbab99da9e | ||
|
d209fe5184 | ||
|
e8a85852e8 | ||
|
f6796ad025 | ||
|
cfc65e1f5a | ||
|
540194cc6e | ||
|
c710fa347a | ||
|
7f75f80a6e | ||
|
2224c32a73 | ||
|
f24261e416 | ||
|
33b5fcbe82 | ||
|
188b1dac32 | ||
|
3073f7f60b | ||
|
efbbeacc48 | ||
|
68b7278072 | ||
|
d1da0553e8 | ||
|
ccebaff4ad | ||
|
b1f1c6a660 | ||
|
3e36057948 | ||
|
9484517a15 | ||
|
7d659fb8c2 | ||
|
261ff5cef1 | ||
|
7adeda4113 | ||
|
0cb450605d | ||
|
ddc8839d9a | ||
|
d886d9b2e3 | ||
|
27ed51035c | ||
|
e322e52619 | ||
|
dfcd4463ac | ||
|
d87bb3d600 | ||
|
eba41379e3 | ||
|
75469430ad | ||
|
349cf7240f | ||
|
44a1072fb3 | ||
|
56f992b6fe | ||
|
91f2e4c0c0 | ||
|
4871012a51 | ||
|
a5239c575b | ||
|
6506119264 | ||
|
9381cf6438 | ||
|
936ef5d609 | ||
|
4efd22b709 | ||
|
09a9b4870f | ||
|
09c48fa653 | ||
|
71e5051752 | ||
|
ddeb934179 | ||
|
c7efc37227 | ||
|
4470feb4c5 | ||
|
b139fbf9b8 | ||
|
67903b598e | ||
|
c6344df589 | ||
|
1cd837b372 | ||
|
f391176841 | ||
|
3daa2f32e4 | ||
|
c4629d6113 | ||
|
b8f5f818bc | ||
|
3cc9648ea7 | ||
|
58358d0927 | ||
|
acc1056ec8 | ||
|
1ee5881cf2 | ||
|
b615902e94 | ||
|
34a62c747b | ||
|
48addfdd2f | ||
|
a411958a1e | ||
|
1677f6d7c8 | ||
|
adb875bc40 | ||
|
1e7fa6f61e | ||
|
3b4c2d98dd | ||
|
202889488b | ||
|
417892f507 | ||
|
de3ae12236 | ||
|
42346aee87 | ||
|
0e53e0ee3d | ||
|
90ebbdda23 | ||
|
833eb0a792 | ||
|
1dc828e071 | ||
|
856e71f05a | ||
|
3220c418ed | ||
|
3e404baff8 | ||
|
0bdc52796f | ||
|
dcb4de963d | ||
|
8ab1a69972 | ||
|
c5c338ba3d | ||
|
0688b2ef65 | ||
|
5636d7a103 | ||
|
ceb814f4f6 | ||
|
a024343cb0 | ||
|
8fde5dc37c | ||
|
4b1ec43d81 | ||
|
61c7fc5d9c | ||
|
e59ea9b87f | ||
|
ae447029c0 | ||
|
abef5c5cca | ||
|
48da9f7260 | ||
|
2c339fb9fd | ||
|
56512a8f45 | ||
|
0e88d368b9 | ||
|
bf34643be3 | ||
|
deffcba07c | ||
|
44ffcf24fd | ||
|
e435bdad29 | ||
|
5fc8493b9a | ||
|
5b68b5a778 | ||
|
9f324e47b0 | ||
|
1748d39d7e | ||
|
a04cc4fd40 | ||
|
61f3c7be61 | ||
|
dfd82fcec5 | ||
|
bf37abf714 | ||
|
bebb696e50 | ||
|
c2df0b2715 |
308 changed files with 130135 additions and 1458 deletions
81
README.md
81
README.md
|
@ -1,6 +1,6 @@
|
||||||
# Natural Selection v3.3
|
# Natural Selection v3.3
|
||||||
|
|
||||||
An updated build of the game [Natural Selection] for Windows and Linux focused on quality-of-life improvements and bug fixes. For a new custom-built bot for NS, go check out [Evobot].
|
An updated build of the game [Natural Selection] for Windows and Linux focused on quality-of-life improvements and bug fixes.
|
||||||
|
|
||||||
## Downloads
|
## Downloads
|
||||||
|
|
||||||
|
@ -8,13 +8,14 @@ The **[Natural Selection Launcher](https://github.com/ENSL/NaturalLauncher/relea
|
||||||
|
|
||||||
**[Manual installation](https://github.com/ENSL/NS/releases)** (Windows / Linux)
|
**[Manual installation](https://github.com/ENSL/NS/releases)** (Windows / Linux)
|
||||||
|
|
||||||
As the game is a Half-Life mod, Steam and Half-Life installations are required to play the game.
|
As the game is a Half-Life mod, Steam and Half-Life installations are required to play the game. After installing, restart steam.
|
||||||
|
|
||||||
A fresh install of NS comes with updated config files containing everything you need to get playing on the standard settings most players prefer. Customization options are built into the advanced options menu, like the Nine Legends competitive UI option. For further customization, team and weapon specific config files are also now available.
|
A fresh install of NS comes with updated config files containing everything you need to get playing on the standard settings most players prefer. Customization options are built into the advanced options menu, like the Nine Legends competitive UI option. For further customization, team and weapon specific config files are also now available.
|
||||||
|
|
||||||
## Game not working? Troubleshooting tips
|
## Game not working? Troubleshooting tips
|
||||||
|
|
||||||
If the game doesn't load, check the following:
|
If the game doesn't load, check the following:
|
||||||
|
1. Restart steam after installation to be able to play the game.
|
||||||
1. If you recieve a "could not load library" error for the client.dll, please install the **[latest Microsoft Visual C++ Redistributable package](https://aka.ms/vs/17/release/vc_redist.x86.exe)**.
|
1. If you recieve a "could not load library" error for the client.dll, please install the **[latest Microsoft Visual C++ Redistributable package](https://aka.ms/vs/17/release/vc_redist.x86.exe)**.
|
||||||
1. Make sure you have verified Half-Life's integrity. Click [here](https://support.steampowered.com/kb_article.php?ref=2037-QEUH-3335) for detailed instructions.
|
1. Make sure you have verified Half-Life's integrity. Click [here](https://support.steampowered.com/kb_article.php?ref=2037-QEUH-3335) for detailed instructions.
|
||||||
1. Check if Half-Life works for you.
|
1. Check if Half-Life works for you.
|
||||||
|
@ -28,18 +29,22 @@ For Linux:
|
||||||
|
|
||||||
## Changes
|
## Changes
|
||||||
|
|
||||||
Updates include:
|
Update highlights:
|
||||||
|
|
||||||
- Widescreen support (now expands FOV up to 16:9 aspect instead of cropping the image)
|
- Many new audio and visual options, including the "gamma ramp" restored as a post-processing shader
|
||||||
- AI upscaled model textures can be turned on with the "Use High Definition models" video option
|
- Integrated bot players
|
||||||
- Many FPS dependent bugs fixed, including jetpack acceleration, so the game can now be fairly played at 200+ FPS
|
- Widescreen support
|
||||||
- Quake style queued jumping to make bunnyhopping more accessible (server adjustable via sv_jumpmode)
|
- AI upscaled model textures can be turned on with the "Use High Definition models" HL video option
|
||||||
- Shotgun and grenade launcher have been reworked to fix reload bugs and animate better
|
- Many FPS-dependent bugs fixed, including jetpack acceleration, so the game can now be fairly played at 200+ FPS
|
||||||
|
- Quake-style queued jumping to make bunnyhopping more accessible (server adjustable via sv_jumpmode)
|
||||||
|
- The shotgun and grenade launcher have been reworked to fix reload bugs and animate better
|
||||||
|
- The "pistol script" is now a standard feature as a toggleable binary trigger
|
||||||
- Weapon reloads are now predicted on the client
|
- Weapon reloads are now predicted on the client
|
||||||
- New minimal HUD and the Nine Legends HUD can be selected through advanced options or hud_style and hud_mapstyle
|
- Player names are now shown on the minimap
|
||||||
- New crosshair system that can be adjusted through the advanced options and cl_cross commands (Thanks [OpenAG](https://github.com/YaLTeR/OpenAG))
|
|
||||||
- Ambient sounds can be changed in advanced options or via cl_ambientsound
|
|
||||||
- The marine HUD now tracks research progress and the alien HUD tracks hive growth
|
- The marine HUD now tracks research progress and the alien HUD tracks hive growth
|
||||||
|
- Teammate health or armor status rings are now shown to players that can heal or repair them
|
||||||
|
- New minimal and Nine Legends HUDs are available
|
||||||
|
- A New crosshair system (Modified from [OpenAG](https://github.com/YaLTeR/OpenAG))
|
||||||
- Raw input and sensitivity scaling options are now available and non-accelerated mouse input is now default
|
- Raw input and sensitivity scaling options are now available and non-accelerated mouse input is now default
|
||||||
- The many other improvements, customization options, and bug fixes can be found in the [release notes](https://github.com/ENSL/NS/releases)
|
- The many other improvements, customization options, and bug fixes can be found in the [release notes](https://github.com/ENSL/NS/releases)
|
||||||
|
|
||||||
|
@ -48,15 +53,21 @@ Updates include:
|
||||||
How to set up a dedicated [Natural Selection] server with [HLDS]:
|
How to set up a dedicated [Natural Selection] server with [HLDS]:
|
||||||
|
|
||||||
1. Follow these steps to get steamCMD installed and HLDS updated in it: https://developer.valvesoftware.com/wiki/SteamCMD
|
1. Follow these steps to get steamCMD installed and HLDS updated in it: https://developer.valvesoftware.com/wiki/SteamCMD
|
||||||
2. You'll want to run `app_update 90 validate` multiple times in steamCMD to install HLDS and fully update it, as it won't completely do it the first time.
|
1. Set the HLDS install directory after opening steamcmd and before logging in. The following steps assume a directory named `hlds` from doing `force_install_dir ./hlds/`
|
||||||
3. Copy the `ns` directory into the `hlds` directory after installing HLDS from steamcmd
|
1. You'll want to run `app_update 90 validate` multiple times in steamCMD to install HLDS and fully update it, as it won't completely do it the first time.
|
||||||
4. For Linux servers:
|
1. Copy the `ns` directory into the `hlds` directory after installing HLDS from steamcmd
|
||||||
|
1. For Linux servers:
|
||||||
- Remove or rename the `libstdc++so.6` in the `hlds` directory so the linux distro's can be used instead. The one steam provides is outdated. You may need to rename the `libgcc.so.1` file in the same directory as well.
|
- Remove or rename the `libstdc++so.6` in the `hlds` directory so the linux distro's can be used instead. The one steam provides is outdated. You may need to rename the `libgcc.so.1` file in the same directory as well.
|
||||||
- 32 bit C libraries might need to be installed. Try `apt-get install libc6-i386` if on debian or ubuntu. The libm.so.6 from it may need to be placed in your HLDS folder if you cannot install that package.
|
- 32 bit C libraries might need to be installed. Try `apt-get install libc6-i386` if on debian or ubuntu. The libm.so.6 from it may need to be placed in your HLDS folder if you cannot install that package.
|
||||||
5. Run the game :
|
1. Run the game:
|
||||||
```sh
|
- Linux:
|
||||||
./hlds_run -game ns +map ns_eclipse + sv_secure 1 + port 27015 +hostname "Natural Selection" +maxplayers 32
|
```sh
|
||||||
```
|
./hlds_run -game ns +map ns_eclipse +sv_secure 1 +port 27015 +hostname "Natural Selection" +maxplayers 32
|
||||||
|
```
|
||||||
|
- Windows:
|
||||||
|
```cmd
|
||||||
|
hlds.exe -console -game ns +map ns_eclipse +sv_secure 1 +port 27015 +hostname "Natural Selection" +maxplayers 32
|
||||||
|
```
|
||||||
|
|
||||||
If you are behind a NAT(Router) make sure to open at least those ports:
|
If you are behind a NAT(Router) make sure to open at least those ports:
|
||||||
- 27015 UDP (game transmission, pings)
|
- 27015 UDP (game transmission, pings)
|
||||||
|
@ -69,10 +80,40 @@ In order to check if your server is connected to the steam servers copy the foll
|
||||||
|
|
||||||
There is an updated version of metamod called [metamod-p](https://github.com/APGRoboCop/metamod-p/).
|
There is an updated version of metamod called [metamod-p](https://github.com/APGRoboCop/metamod-p/).
|
||||||
|
|
||||||
There are a few different bots for Natural Selection, with Evobot being the newest and most comprehensive:
|
To run NS plugins, please use the [updated build of AMX](https://github.com/pierow/amxmodx-ns/releases) that supports this version of NS.
|
||||||
* [Evobot]
|
|
||||||
|
## Bots
|
||||||
|
Evobot is integrated in NS 3.3 and can be configured in the listen server creation UI or via the following commands in the `server.cfg` for dedicated servers:
|
||||||
|
```
|
||||||
|
mp_botsenabled (0/1) Bots are enabled Y/N
|
||||||
|
mp_botautomode (0-2) (0 = manually add/remove bots, 1 = Maintain min player counts, 2 = Keep teams balanced only)
|
||||||
|
mp_botskill (0-3) Bot skill (0 = Easiest, 3 = Hardest)
|
||||||
|
mp_botcommandermode (0-2) (0 = Bot never commands, 1 = Bot commands after mp_botcommanderwait seconds if nobody else does, 2 = Bot only commands if no humans are on the team)
|
||||||
|
mp_botcommanderwait (0..) How long the bot should wait before taking command (if allowed to)
|
||||||
|
mp_botusemapdefaults (0/1) Use the map min player counts defined in nsbots.ini Y/N
|
||||||
|
mp_botminplayers (0-32) If not using map defaults, maintain this player population for all maps
|
||||||
|
mp_botallowlerk (0/1) Bot is allowed to evolve lerk Y/N
|
||||||
|
mp_botallowfade (0/1) Bot is allowed to evolve fade Y/N
|
||||||
|
mp_botallowonos (0/1) Bot is allowed to evolve onos Y/N
|
||||||
|
mp_botlerkcooldown (0..) After a lerk is killed, how long in seconds should the bot wait to evolve again (default 60s)
|
||||||
|
mp_botmaxstucktime (0..) If a bot is stuck longer than this time (in seconds) it will suicide (default 15s)
|
||||||
|
mp_botdebugmode (0-2) (0 = Disabled, 1 = Drone Mode, 2 = Test Nav Mode). Use test nav mode to validate your nav files.
|
||||||
|
|
||||||
|
sv_botadd <Team> If mp_botautomode is 0, this will manually add a bot to team 1 or 2. If Team is 0, it will assign randomly
|
||||||
|
sv_botremove <Team> If mp_botautomode is 0, this will manually remove a bot from team 1 or 2. If Team is 0, it will remove randomly
|
||||||
|
sv_botregenini If your copy of nsbots.ini is lost or corrupted, this will generate a fresh one
|
||||||
|
|
||||||
|
bot_cometome If mp_botdebugmode is 1, this will force the bot to come to you. Helps test your nav file.
|
||||||
|
bot_drawoffmeshconns Will draw the off-mesh connections present in the loaded navigation file, color-coded based on connection type
|
||||||
|
bot_drawtempobstacles Will draw nearby temporary obstacles affecting the nav mesh
|
||||||
|
```
|
||||||
|
|
||||||
|
The bot system uses a modified version of the Detour library from [recastnavigation](https://github.com/recastnavigation/recastnavigation).
|
||||||
|
|
||||||
|
Other bot plugins:
|
||||||
* [RCbot](http://rcbot.bots-united.com/)
|
* [RCbot](http://rcbot.bots-united.com/)
|
||||||
* [Whichbot](https://whichbot.sourceforge.net/)
|
* [Whichbot](https://whichbot.sourceforge.net/)
|
||||||
|
* [Commander AI](https://github.com/jac95501/-NS-Commander-AI)
|
||||||
|
|
||||||
## Compiling
|
## Compiling
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -1,5 +1,4 @@
|
||||||
//Alien cfg that is part of a default installation on the NS Launcher.
|
//Alien cfg that is part of a default installation on the NS Launcher.
|
||||||
//Activated by joining or spawning on aliens.
|
//Activated by joining or spawning on aliens.
|
||||||
|
|
||||||
//bind "mouse2" "+movement"
|
//bind "mouse2" "+movement"
|
||||||
//psoff
|
|
|
@ -59,14 +59,13 @@ bind "MWHEELUP" "invprev"
|
||||||
bind "MOUSE1" "+attack"
|
bind "MOUSE1" "+attack"
|
||||||
bind "MOUSE2" "+movement"
|
bind "MOUSE2" "+movement"
|
||||||
bind "MOUSE3" "+popupmenu"
|
bind "MOUSE3" "+popupmenu"
|
||||||
bind "MOUSE4" "lastinv"
|
|
||||||
bind "PAUSE" "pause"
|
bind "PAUSE" "pause"
|
||||||
_snd_mixahead "0.1"
|
_snd_mixahead "0.1"
|
||||||
ati_npatch "0"
|
ati_npatch "0"
|
||||||
ati_subdiv "0"
|
ati_subdiv "0"
|
||||||
bgmvolume "1.000000"
|
bgmvolume "1.000000"
|
||||||
bottomcolor "144.889999"
|
bottomcolor "144.889999"
|
||||||
brightness "5"
|
brightness "0"
|
||||||
cl_allowdownload "1"
|
cl_allowdownload "1"
|
||||||
cl_allowupload "1"
|
cl_allowupload "1"
|
||||||
cl_autohelp "1.0"
|
cl_autohelp "1.0"
|
||||||
|
@ -80,9 +79,9 @@ cl_dlmax "128"
|
||||||
cl_download_ingame "1"
|
cl_download_ingame "1"
|
||||||
cl_dynamiclights "0"
|
cl_dynamiclights "0"
|
||||||
cl_forcedefaultfov "0"
|
cl_forcedefaultfov "0"
|
||||||
cl_gammaramp "0"
|
|
||||||
cl_highdetail "1"
|
cl_highdetail "1"
|
||||||
cl_himodels "0"
|
cl_himodels "0"
|
||||||
|
cl_hudmapzoom "2"
|
||||||
cl_iconb "221"
|
cl_iconb "221"
|
||||||
cl_icong "149"
|
cl_icong "149"
|
||||||
cl_iconr "0"
|
cl_iconr "0"
|
||||||
|
@ -90,14 +89,17 @@ cl_idealpitchscale "0.8"
|
||||||
cl_labelhivesight "1"
|
cl_labelhivesight "1"
|
||||||
cl_labelmaps "1"
|
cl_labelmaps "1"
|
||||||
cl_lc "1"
|
cl_lc "1"
|
||||||
|
cl_intensity "0.55"
|
||||||
|
cl_intensityalt "1"
|
||||||
cl_logocolor "#Valve_Orange"
|
cl_logocolor "#Valve_Orange"
|
||||||
cl_logofile "lambda"
|
cl_logofile "lambda"
|
||||||
cl_lw "1"
|
cl_lw "1"
|
||||||
cl_musicdelay "90"
|
cl_musicdelay "-1"
|
||||||
cl_musicdirectory ""
|
cl_musicdirectory ""
|
||||||
cl_musicvolume "155"
|
cl_musicvolume "0.6"
|
||||||
cl_musicenabled "0"
|
cl_musicenabled "1"
|
||||||
cl_particleinfo "0"
|
cl_particleinfo "0"
|
||||||
|
cl_postprocessing "1"
|
||||||
cl_quickselecttime ".15"
|
cl_quickselecttime ".15"
|
||||||
cl_timeout "60"
|
cl_timeout "60"
|
||||||
cl_updaterate "100"
|
cl_updaterate "100"
|
||||||
|
@ -108,15 +110,16 @@ crosshair "0"
|
||||||
fps_max "250"
|
fps_max "250"
|
||||||
fps_override "1"
|
fps_override "1"
|
||||||
fps_modem "0.0"
|
fps_modem "0.0"
|
||||||
gamma "3"
|
gamma "2.95"
|
||||||
gl_vsync "0"
|
|
||||||
gl_dither "1"
|
gl_dither "1"
|
||||||
gl_flipmatrix "0"
|
gl_flipmatrix "0"
|
||||||
gl_fog "1"
|
gl_fog "1"
|
||||||
gl_monolights "0"
|
gl_monolights "0"
|
||||||
gl_overbright "1"
|
gl_overbright "0"
|
||||||
gl_polyoffset "0.1"
|
gl_polyoffset "0.1"
|
||||||
gl_texturemode "GL_LINEAR_MIPMAP_LINEAR"
|
gl_texturemode "GL_LINEAR_MIPMAP_LINEAR"
|
||||||
|
gl_use_shaders "0"
|
||||||
|
gl_vsync "0"
|
||||||
hisound "1"
|
hisound "1"
|
||||||
hpk_maxsize "4"
|
hpk_maxsize "4"
|
||||||
hud_capturemouse "1"
|
hud_capturemouse "1"
|
||||||
|
@ -135,12 +138,13 @@ m_side "0.8"
|
||||||
m_yaw "0.022"
|
m_yaw "0.022"
|
||||||
model "barney"
|
model "barney"
|
||||||
MP3FadeTime "2.0"
|
MP3FadeTime "2.0"
|
||||||
MP3Volume "0"
|
MP3Volume "0.4"
|
||||||
mp_decals "300"
|
mp_decals "300"
|
||||||
name "NSPlayer"
|
name "NSPlayer"
|
||||||
net_graph "0"
|
net_graph "0"
|
||||||
net_graphpos "1"
|
net_graphpos "1"
|
||||||
net_scale "5"
|
net_scale "5"
|
||||||
|
rate "100000"
|
||||||
r_bmodelhighfrac "5.0"
|
r_bmodelhighfrac "5.0"
|
||||||
r_detailtextures "0"
|
r_detailtextures "0"
|
||||||
s_a3d "0.0"
|
s_a3d "0.0"
|
||||||
|
@ -172,14 +176,18 @@ voice_enable "1"
|
||||||
voice_forcemicrecord "1"
|
voice_forcemicrecord "1"
|
||||||
voice_modenable "1"
|
voice_modenable "1"
|
||||||
voice_scale "1"
|
voice_scale "1"
|
||||||
volume "0.500000"
|
volume "0.400000"
|
||||||
m_rawinput "1"
|
m_rawinput "1"
|
||||||
zoom_sensitivity_ratio "1"
|
zoom_sensitivity_ratio "0.97"
|
||||||
lightgamma "2"
|
lightgamma "1.81"
|
||||||
ex_interp "0.05"
|
ex_interp "0.05"
|
||||||
cl_cross "1"
|
cl_cross "1"
|
||||||
rate "30000"
|
cl_bob "0.005"
|
||||||
cl_bob "0"
|
cl_bobcycle "0.8"
|
||||||
|
cl_bobup "0.5"
|
||||||
|
cl_weaponswap "2"
|
||||||
|
cl_pistoltrigger "1"
|
||||||
|
cl_weaponcfgs "2"
|
||||||
|
|
||||||
+mlook
|
+mlook
|
||||||
exec userconfig.cfg
|
exec userconfig.cfg
|
||||||
|
|
8
main/defaultvideo.cfg
Normal file
8
main/defaultvideo.cfg
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
// NS 3.3 video settings to be executed after patching to b8.
|
||||||
|
brightness "0"
|
||||||
|
gamma "2.95"
|
||||||
|
lightgamma "1.81"
|
||||||
|
cl_dynamiclights "0"
|
||||||
|
cl_postprocess "1"
|
||||||
|
cl_intensity "0.55"
|
||||||
|
cl_intensityalt "1"
|
|
@ -237,14 +237,16 @@ weapon_data_t none
|
||||||
DEFINE_DELTA( m_flNextSecondaryAttack, DT_FLOAT | DT_SIGNED, 22, 1000.0 ),
|
DEFINE_DELTA( m_flNextSecondaryAttack, DT_FLOAT | DT_SIGNED, 22, 1000.0 ),
|
||||||
DEFINE_DELTA( m_iClip, DT_SIGNED | DT_INTEGER, 10, 1.0 ),
|
DEFINE_DELTA( m_iClip, DT_SIGNED | DT_INTEGER, 10, 1.0 ),
|
||||||
// DEFINE_DELTA( m_flPumpTime, DT_FLOAT | DT_SIGNED, 22, 1000.0 ),
|
// DEFINE_DELTA( m_flPumpTime, DT_FLOAT | DT_SIGNED, 22, 1000.0 ),
|
||||||
DEFINE_DELTA( m_fInSpecialReload, DT_INTEGER, 3, 1.0 ),
|
DEFINE_DELTA( m_fInSpecialReload, DT_INTEGER, 2, 1.0 ),
|
||||||
DEFINE_DELTA( m_fReloadTime, DT_FLOAT, 16, 100.0 ),
|
DEFINE_DELTA( m_fReloadTime, DT_FLOAT, 16, 100.0 ),
|
||||||
DEFINE_DELTA( m_fInReload, DT_INTEGER, 1, 1.0 ),
|
DEFINE_DELTA( m_fInReload, DT_INTEGER, 1, 1.0 ),
|
||||||
// DEFINE_DELTA( m_fAimedDamage, DT_FLOAT, 6, 0.1 ),
|
// DEFINE_DELTA( m_fAimedDamage, DT_FLOAT, 6, 0.1 ),
|
||||||
// DEFINE_DELTA( m_fInZoom, DT_INTEGER, 1, 1.0 ),
|
// DEFINE_DELTA( m_fInZoom, DT_INTEGER, 1, 1.0 ),
|
||||||
// DEFINE_DELTA( m_iWeaponState, DT_INTEGER, 2, 1.0 ),
|
// DEFINE_DELTA( m_iWeaponState, DT_INTEGER, 2, 1.0 ),
|
||||||
DEFINE_DELTA( m_iId, DT_INTEGER, 8, 1.0 ),
|
DEFINE_DELTA( m_iId, DT_INTEGER, 8, 1.0 ),
|
||||||
|
DEFINE_DELTA( iuser2, DT_INTEGER, 1, 1.0 ), // m_fInAttack
|
||||||
DEFINE_DELTA( iuser3, DT_INTEGER, 3, 1.0 ),
|
DEFINE_DELTA( iuser3, DT_INTEGER, 3, 1.0 ),
|
||||||
|
DEFINE_DELTA( iuser4, DT_INTEGER, 1, 1.0 ), // m_bAttackQueued
|
||||||
DEFINE_DELTA( fuser2, DT_SIGNED | DT_FLOAT, 22, 128.0 ),
|
DEFINE_DELTA( fuser2, DT_SIGNED | DT_FLOAT, 22, 128.0 ),
|
||||||
DEFINE_DELTA( fuser3, DT_SIGNED | DT_FLOAT, 22, 128.0 )
|
DEFINE_DELTA( fuser3, DT_SIGNED | DT_FLOAT, 22, 128.0 )
|
||||||
}
|
}
|
||||||
|
|
0
main/events/Mine.sc
Normal file
0
main/events/Mine.sc
Normal file
|
@ -56,6 +56,13 @@ mp_killdelay 3
|
||||||
mp_flashlight 1
|
mp_flashlight 1
|
||||||
mp_footsteps 1
|
mp_footsteps 1
|
||||||
|
|
||||||
|
// AI Player Settings
|
||||||
|
mp_botusemapdefaults 1
|
||||||
|
mp_botminplayers 0
|
||||||
|
mp_botallowlerk 1
|
||||||
|
mp_botallowfade 1
|
||||||
|
mp_botallowonos 1
|
||||||
|
|
||||||
// disable autoaim and mad gibs
|
// disable autoaim and mad gibs
|
||||||
sv_aim 0
|
sv_aim 0
|
||||||
violence_hgibs 0
|
violence_hgibs 0
|
||||||
|
@ -67,7 +74,8 @@ sv_clienttrace 3.5
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
// Dedicated server specific //
|
// Dedicated server specific //
|
||||||
///////////////////////////////
|
///////////////////////////////
|
||||||
sv_lan 0
|
// Let GUI determine lan for listen servers.
|
||||||
|
//sv_lan 0
|
||||||
|
|
||||||
// Forces a limit on structures on the server
|
// Forces a limit on structures on the server
|
||||||
sv_structurelimit 300
|
sv_structurelimit 300
|
||||||
|
@ -83,3 +91,14 @@ mp_uplink 0
|
||||||
|
|
||||||
// Needed so this file is executed on map change, like pre-NS v2.1
|
// Needed so this file is executed on map change, like pre-NS v2.1
|
||||||
mapchangecfgfile listenserver.cfg
|
mapchangecfgfile listenserver.cfg
|
||||||
|
|
||||||
|
//Post HL 25th Aniversary update
|
||||||
|
sv_rollangle 0
|
||||||
|
sv_allow_shaders 0
|
||||||
|
|
||||||
|
// Set rate limits, otherwise they initialize to bad values
|
||||||
|
sv_maxupdaterate 102
|
||||||
|
sv_maxunlag 0.3
|
||||||
|
sv_maxrate 0
|
||||||
|
sv_minrate 20000
|
||||||
|
sv_minupdaterate 30
|
|
@ -33,6 +33,7 @@ ns_lost "\minplayers\16\maxplayers\32\"
|
||||||
ns_machina "\minplayers\16\maxplayers\24\"
|
ns_machina "\minplayers\16\maxplayers\24\"
|
||||||
ns_nothing "\minplayers\16\maxplayers\32\"
|
ns_nothing "\minplayers\16\maxplayers\32\"
|
||||||
co_niveus "\minplayers\4\maxplayers\20\"
|
co_niveus "\minplayers\4\maxplayers\20\"
|
||||||
|
ns_ragnarok "\minplayers\16\maxplayers\32\"
|
||||||
co_faceoff "\minplayers\0\maxplayers\18\"
|
co_faceoff "\minplayers\0\maxplayers\18\"
|
||||||
co_daimos "\minplayers\8\maxplayers\20\"
|
co_daimos "\minplayers\8\maxplayers\20\"
|
||||||
ns_bast "\minplayers\14\maxplayers\28\"
|
ns_bast "\minplayers\14\maxplayers\28\"
|
||||||
|
@ -44,6 +45,7 @@ co_umbra "\minplayers\8\maxplayers\20\"
|
||||||
ns_nancy "\minplayers\14\maxplayers\32\"
|
ns_nancy "\minplayers\14\maxplayers\32\"
|
||||||
ns_veil "\minplayers\16\maxplayers\32\"
|
ns_veil "\minplayers\16\maxplayers\32\"
|
||||||
co_core "\minplayers\0\maxplayers\20\"
|
co_core "\minplayers\0\maxplayers\20\"
|
||||||
|
ns_askr_b6 "\minplayers\16\maxplayers\32\"
|
||||||
co_ulysses "\minplayers\4\maxplayers\20\"
|
co_ulysses "\minplayers\4\maxplayers\20\"
|
||||||
ns_eclipse "\minplayers\14\maxplayers\32\"
|
ns_eclipse "\minplayers\14\maxplayers\32\"
|
||||||
co_pulse "\minplayers\0\maxplayers\20\"
|
co_pulse "\minplayers\0\maxplayers\20\"
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,6 +1,4 @@
|
||||||
//Marine cfg that is part of a default installation on the NS Launcher.
|
//Marine cfg that is part of a default installation on the NS Launcher.
|
||||||
//Activated by pressing joining or spawning on marines.
|
//Activated by pressing joining or spawning on marines.
|
||||||
|
|
||||||
|
//bind "mouse2" "impulse 10"
|
||||||
//bind "mouse2" "impulse 10"
|
|
||||||
//pson
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
main/navmeshes/NavEditor/DroidSans.ttf
Normal file
BIN
main/navmeshes/NavEditor/DroidSans.ttf
Normal file
Binary file not shown.
BIN
main/navmeshes/NavEditor/GoldsrcNavEditor.exe
Normal file
BIN
main/navmeshes/NavEditor/GoldsrcNavEditor.exe
Normal file
Binary file not shown.
BIN
main/navmeshes/NavEditor/NavEditorDocs.pdf
Normal file
BIN
main/navmeshes/NavEditor/NavEditorDocs.pdf
Normal file
Binary file not shown.
BIN
main/navmeshes/NavEditor/SDL2.dll
Normal file
BIN
main/navmeshes/NavEditor/SDL2.dll
Normal file
Binary file not shown.
BIN
main/navmeshes/co_angst.nav
Normal file
BIN
main/navmeshes/co_angst.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/co_core.nav
Normal file
BIN
main/navmeshes/co_core.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/co_daimos.nav
Normal file
BIN
main/navmeshes/co_daimos.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/co_faceoff.nav
Normal file
BIN
main/navmeshes/co_faceoff.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/co_kestrel.nav
Normal file
BIN
main/navmeshes/co_kestrel.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/co_niveus.nav
Normal file
BIN
main/navmeshes/co_niveus.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/co_pulse.nav
Normal file
BIN
main/navmeshes/co_pulse.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/co_sava.nav
Normal file
BIN
main/navmeshes/co_sava.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/co_ulysses.nav
Normal file
BIN
main/navmeshes/co_ulysses.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/co_umbra.nav
Normal file
BIN
main/navmeshes/co_umbra.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_altair.nav
Normal file
BIN
main/navmeshes/ns_altair.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_askr_b5.nav
Normal file
BIN
main/navmeshes/ns_askr_b5.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_askr_b6.nav
Normal file
BIN
main/navmeshes/ns_askr_b6.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_ayumi.nav
Normal file
BIN
main/navmeshes/ns_ayumi.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_bast.nav
Normal file
BIN
main/navmeshes/ns_bast.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_caged.nav
Normal file
BIN
main/navmeshes/ns_caged.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_eclipse.nav
Normal file
BIN
main/navmeshes/ns_eclipse.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_eon.nav
Normal file
BIN
main/navmeshes/ns_eon.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_hera.nav
Normal file
BIN
main/navmeshes/ns_hera.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_lost.nav
Normal file
BIN
main/navmeshes/ns_lost.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_lucid.nav
Normal file
BIN
main/navmeshes/ns_lucid.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_machina.nav
Normal file
BIN
main/navmeshes/ns_machina.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_metal.nav
Normal file
BIN
main/navmeshes/ns_metal.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_nancy.nav
Normal file
BIN
main/navmeshes/ns_nancy.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_nothing.nav
Normal file
BIN
main/navmeshes/ns_nothing.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_origin.nav
Normal file
BIN
main/navmeshes/ns_origin.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_ragnarok.nav
Normal file
BIN
main/navmeshes/ns_ragnarok.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_shiva.nav
Normal file
BIN
main/navmeshes/ns_shiva.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_tanith.nav
Normal file
BIN
main/navmeshes/ns_tanith.nav
Normal file
Binary file not shown.
BIN
main/navmeshes/ns_veil.nav
Normal file
BIN
main/navmeshes/ns_veil.nav
Normal file
Binary file not shown.
96
main/nsbots.ini
Normal file
96
main/nsbots.ini
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
### General bot settings ###
|
||||||
|
|
||||||
|
# What prefix to put in front of a bot's name (can leave blank)
|
||||||
|
Prefix=[BOT]
|
||||||
|
|
||||||
|
# After this many minutes into a match, the bots will leave the game if there are no humans playing
|
||||||
|
# Helps prevent stalemates and bugs that happen after extremely long matches
|
||||||
|
# Default = 90 minutes
|
||||||
|
MaxAIMatchTime=90
|
||||||
|
|
||||||
|
# When should the server start adding bots? Note: bots will always be added after round start regardless
|
||||||
|
# 0 = On map load (after 5 second grace period)
|
||||||
|
# 1 = When all humans have joined a team (i.e. no more humans left in ready room)
|
||||||
|
# 2 = When the round has started (after countdown)
|
||||||
|
BotFillTiming=1
|
||||||
|
|
||||||
|
# Chance the AI commander will try to relocate to an empty hive at match start
|
||||||
|
# Value is a decimal between 0.0 and 1.0, with 0 being never and 1 being always
|
||||||
|
# Note that setting relocation chance to 0.0 will also disable ANY relocation at any time
|
||||||
|
RelocationChance=0.2
|
||||||
|
|
||||||
|
### Skill Settings ###
|
||||||
|
|
||||||
|
# Bot skill settings. There are 4 settings from 0 - 3 for easiest - hardest
|
||||||
|
# Use BotSkillName=<index> to start defining a skill level, then the following:
|
||||||
|
# ReactionTime = How quickly in seconds the bot will react to sighting enemies
|
||||||
|
# AimSkill = How accurately the bot can lock sights on you after seeing you (0.0 - 1.0)
|
||||||
|
# MovementTracking = How accurately the bot can follow a moving target (0.0 - 1.0)
|
||||||
|
# ViewSpeed = How fast the bot can swivel its view (0.1 - 2.0)
|
||||||
|
# Set the difficulty using the 'mp_botskill' cvar (0 - 3)
|
||||||
|
|
||||||
|
BotSkillLevel=0
|
||||||
|
MarineReactionTime=0.4
|
||||||
|
MarineAimSkill=0.1
|
||||||
|
MarineMovementTracking=0.1
|
||||||
|
MarineViewSpeed=0.5
|
||||||
|
AlienReactionTime=0.5
|
||||||
|
AlienAimSkill=0.2
|
||||||
|
AlienMovementTracking=0.2
|
||||||
|
AlienViewSpeed=0.75
|
||||||
|
|
||||||
|
BotSkillLevel=1
|
||||||
|
MarineReactionTime=0.2
|
||||||
|
MarineAimSkill=0.5
|
||||||
|
MarineMovementTracking=0.4
|
||||||
|
MarineViewSpeed=1.0
|
||||||
|
AlienReactionTime=0.2
|
||||||
|
AlienAimSkill=0.5
|
||||||
|
AlienMovementTracking=0.5
|
||||||
|
AlienViewSpeed=1.3
|
||||||
|
|
||||||
|
BotSkillLevel=2
|
||||||
|
MarineReactionTime=0.2
|
||||||
|
MarineAimSkill=0.6
|
||||||
|
MarineMovementTracking=0.6
|
||||||
|
MarineViewSpeed=1.5
|
||||||
|
AlienReactionTime=0.2
|
||||||
|
AlienAimSkill=0.8
|
||||||
|
AlienMovementTracking=0.8
|
||||||
|
AlienViewSpeed=1.5
|
||||||
|
|
||||||
|
BotSkillLevel=3
|
||||||
|
MarineReactionTime=0.1
|
||||||
|
MarineAimSkill=1.0
|
||||||
|
MarineMovementTracking=1.0
|
||||||
|
MarineViewSpeed=2.0
|
||||||
|
AlienReactionTime=0.1
|
||||||
|
AlienAimSkill=1.0
|
||||||
|
AlienMovementTracking=1.0
|
||||||
|
AlienViewSpeed=2.0
|
||||||
|
|
||||||
|
|
||||||
|
# Desired team sizes. Only used if bot fill mode is 'fillteams'
|
||||||
|
# Format is TeamSize=mapname:nummarines/numaliens
|
||||||
|
# 'default' will be used if playing a map not listed below
|
||||||
|
TeamSize=default:7/7
|
||||||
|
TeamSize=ns_machina:8/8
|
||||||
|
TeamSize=ns_ragnarok:8/8
|
||||||
|
TeamSize=ns_askr_b5:8/8
|
||||||
|
TeamSize=ns_askr_b6:8/8
|
||||||
|
TeamSize=co_faceoff:4/4
|
||||||
|
TeamSize=co_core:4/4
|
||||||
|
TeamSize=co_pulse:6/6
|
||||||
|
TeamSize=co_ulysses:6/6
|
||||||
|
TeamSize=co_niveus:5/5
|
||||||
|
TeamSize=co_kestrel:5/5
|
||||||
|
|
||||||
|
|
||||||
|
### Alien Settings ###
|
||||||
|
|
||||||
|
# Preferred chamber sequence. Valid entries are 'defense', 'movement' and 'sensory'. Separate sequence with forward slash
|
||||||
|
# You can also use ? for random, so if you want movement always first but then defense and sensory at random, use
|
||||||
|
# ChamberSequence:movement/?/?
|
||||||
|
# Or if you want sensory always last, but movement and defence random, use
|
||||||
|
# ChamberSequence=?/?/sensory
|
||||||
|
ChamberSequence=?/?/?
|
44
main/presetcfgs/AV/competitive.cfg
Normal file
44
main/presetcfgs/AV/competitive.cfg
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
// Bright Lighting
|
||||||
|
brightness "2"
|
||||||
|
gamma "3"
|
||||||
|
lightgamma "2"
|
||||||
|
cl_dynamiclights "0"
|
||||||
|
cl_postprocess "0"
|
||||||
|
cl_intensity "0"
|
||||||
|
cl_intensityalt "1"
|
||||||
|
|
||||||
|
// High detail particles
|
||||||
|
//cl_high_detail "0"
|
||||||
|
|
||||||
|
// No bobbing
|
||||||
|
cl_bob "0"
|
||||||
|
//cl_bobcycle "0.8"
|
||||||
|
//cl_bobup "0.5"
|
||||||
|
cl_bobview "0"
|
||||||
|
|
||||||
|
// Audio
|
||||||
|
cl_ambientsound "0"
|
||||||
|
cl_musicenabled "0"
|
||||||
|
//cl_musicvolume "0.6"
|
||||||
|
//cl_musicdelay "-1"
|
||||||
|
|
||||||
|
// HUD
|
||||||
|
hud_style "2"
|
||||||
|
hud_mapstyle "3"
|
||||||
|
//hud_mapnames "5"
|
||||||
|
cl_hudmapzoom "2"
|
||||||
|
|
||||||
|
// New crosshairs
|
||||||
|
crosshair "0"
|
||||||
|
cl_cross "1"
|
||||||
|
cl_cross_scaling "0"
|
||||||
|
cl_weaponcfgs "2"
|
||||||
|
|
||||||
|
echo " "
|
||||||
|
echo "----------------------------------------------------------------------"
|
||||||
|
echo "Competitive NS preset applied:"
|
||||||
|
echo "----------------------------------------------------------------------"
|
||||||
|
echo "- Bright lighting settings with overbright shader disabled"
|
||||||
|
echo "- Nine Legends competitive HUD and new crosshair system"
|
||||||
|
echo "- No weapon or view bobbing"
|
||||||
|
echo "- Ambient sound and music tracks disabled"
|
47
main/presetcfgs/AV/newdefault.cfg
Normal file
47
main/presetcfgs/AV/newdefault.cfg
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
// Lighting
|
||||||
|
brightness "0"
|
||||||
|
gamma "2.95"
|
||||||
|
lightgamma "1.81"
|
||||||
|
cl_dynamiclights "0"
|
||||||
|
cl_postprocess "1"
|
||||||
|
cl_intensity "0.55"
|
||||||
|
cl_intensityalt "1"
|
||||||
|
|
||||||
|
// High detail particles
|
||||||
|
cl_high_detail "1"
|
||||||
|
|
||||||
|
// Bobbing
|
||||||
|
cl_bob "0.005"
|
||||||
|
cl_bobcycle "0.8"
|
||||||
|
cl_bobup "0.5"
|
||||||
|
cl_bobview "0"
|
||||||
|
|
||||||
|
// Reduced ambient and music volume
|
||||||
|
cl_ambientsound "0.6"
|
||||||
|
cl_musicenabled "1"
|
||||||
|
cl_musicvolume "0.6"
|
||||||
|
cl_musicdelay "-1"
|
||||||
|
|
||||||
|
// HUD
|
||||||
|
hud_style "1"
|
||||||
|
hud_mapstyle "3"
|
||||||
|
//hud_mapnames "5"
|
||||||
|
cl_hudmapzoom "2"
|
||||||
|
|
||||||
|
// New crosshairs
|
||||||
|
crosshair "0"
|
||||||
|
cl_cross "1"
|
||||||
|
cl_cross_scaling "1"
|
||||||
|
cl_weaponcfgs "2"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
echo " "
|
||||||
|
echo "----------------------------------------------------------------------"
|
||||||
|
echo "NS 3.3 graphics and audio preset applied"
|
||||||
|
echo "----------------------------------------------------------------------"
|
||||||
|
echo "- Brighter maps with less shadows. Reduced overbrightening effects. Flashing dynamic lights disabled."
|
||||||
|
echo "- Minimal marine HUD and new crosshair system."
|
||||||
|
echo "- Reduced weapon bobbing and no view bobbing."
|
||||||
|
echo "- Reduced ambient and music track volumes. Music tracks play only once at the start of the round."
|
||||||
|
echo " "
|
44
main/presetcfgs/AV/ns32.cfg
Normal file
44
main/presetcfgs/AV/ns32.cfg
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
// Lighting
|
||||||
|
brightness "1"
|
||||||
|
gamma "2.5"
|
||||||
|
lightgamma "2.5"
|
||||||
|
cl_dynamiclights "1"
|
||||||
|
cl_postprocess "1"
|
||||||
|
cl_intensity "1"
|
||||||
|
cl_intensityalt "0"
|
||||||
|
|
||||||
|
// High detail particles
|
||||||
|
cl_high_detail "1"
|
||||||
|
|
||||||
|
// Bobbing
|
||||||
|
cl_bob "0.01"
|
||||||
|
cl_bobcycle "0.8"
|
||||||
|
cl_bobup "0.5"
|
||||||
|
cl_bobview "1"
|
||||||
|
|
||||||
|
// Audio
|
||||||
|
cl_ambientsound "1.25" // 1 is the old ambient default volume, but the old master volume was 0.8 before ambient sound volume scaled with the volume command
|
||||||
|
cl_musicenabled "1"
|
||||||
|
cl_musicvolume "1.25" // 1 is the old music default volume, but the old master volume was 0.8 before music volume scaled with the volume command
|
||||||
|
cl_musicdelay "90"
|
||||||
|
|
||||||
|
// HUD
|
||||||
|
hud_style "0"
|
||||||
|
hud_mapstyle "1"
|
||||||
|
//hud_mapnames "0"
|
||||||
|
cl_hudmapzoom "3"
|
||||||
|
|
||||||
|
// Legacy sprite crosshairs
|
||||||
|
crosshair "1"
|
||||||
|
cl_cross "0"
|
||||||
|
|
||||||
|
|
||||||
|
echo " "
|
||||||
|
echo "----------------------------------------------------------------------"
|
||||||
|
echo "Classic NS graphics and audio preset applied:"
|
||||||
|
echo "----------------------------------------------------------------------"
|
||||||
|
echo "- Original lighting."
|
||||||
|
echo "- Original HUD and crosshairs."
|
||||||
|
echo "- Original weapon and view bob."
|
||||||
|
echo "- Original mix volumes for ambient sound and music."
|
||||||
|
echo " "
|
5
main/presetcfgs/rates/1.cfg
Normal file
5
main/presetcfgs/rates/1.cfg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
rate "100000"
|
||||||
|
cl_cmdrate "100"
|
||||||
|
cl_updaterate "100"
|
||||||
|
cl_cmdbackup "2"
|
||||||
|
ex_interp "0.01"
|
5
main/presetcfgs/rates/2.cfg
Normal file
5
main/presetcfgs/rates/2.cfg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
rate "100000"
|
||||||
|
cl_cmdrate "100"
|
||||||
|
cl_updaterate "100"
|
||||||
|
cl_cmdbackup "2"
|
||||||
|
ex_interp "0.02"
|
5
main/presetcfgs/rates/3.cfg
Normal file
5
main/presetcfgs/rates/3.cfg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
rate "100000"
|
||||||
|
cl_cmdrate "100"
|
||||||
|
cl_updaterate "100"
|
||||||
|
cl_cmdbackup "2"
|
||||||
|
ex_interp "0.033333"
|
5
main/presetcfgs/rates/4.cfg
Normal file
5
main/presetcfgs/rates/4.cfg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
rate "100000"
|
||||||
|
cl_cmdrate "100"
|
||||||
|
cl_updaterate "100"
|
||||||
|
cl_cmdbackup "2"
|
||||||
|
ex_interp "0.05"
|
5
main/presetcfgs/rates/5.cfg
Normal file
5
main/presetcfgs/rates/5.cfg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
rate "100000"
|
||||||
|
cl_cmdrate "100"
|
||||||
|
cl_updaterate "60"
|
||||||
|
cl_cmdbackup "2"
|
||||||
|
ex_interp "0.05"
|
5
main/presetcfgs/rates/6.cfg
Normal file
5
main/presetcfgs/rates/6.cfg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
rate "100000"
|
||||||
|
cl_cmdrate "60"
|
||||||
|
cl_updaterate "60"
|
||||||
|
cl_cmdbackup "2"
|
||||||
|
ex_interp "0.05"
|
5
main/presetcfgs/rates/7.cfg
Normal file
5
main/presetcfgs/rates/7.cfg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
rate "30000"
|
||||||
|
cl_cmdrate "60"
|
||||||
|
cl_updaterate "60"
|
||||||
|
cl_cmdbackup "2"
|
||||||
|
ex_interp "0.1"
|
5
main/presetcfgs/rates/8.cfg
Normal file
5
main/presetcfgs/rates/8.cfg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
rate "30000"
|
||||||
|
cl_cmdrate "60"
|
||||||
|
cl_updaterate "30"
|
||||||
|
cl_cmdbackup "2"
|
||||||
|
ex_interp "0.1"
|
5
main/presetcfgs/rates/9.cfg
Normal file
5
main/presetcfgs/rates/9.cfg
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
rate "20000"
|
||||||
|
cl_cmdrate "60"
|
||||||
|
cl_updaterate "30"
|
||||||
|
cl_cmdbackup "2"
|
||||||
|
ex_interp "0.1"
|
|
@ -1,18 +1,43 @@
|
||||||
"GameMenu"
|
"GameMenu"
|
||||||
{
|
{
|
||||||
"1"
|
"1"
|
||||||
|
{
|
||||||
|
"label" "Apply classic NS preset"
|
||||||
|
"command" "engine nspreset 1"
|
||||||
|
}
|
||||||
|
"2"
|
||||||
|
{
|
||||||
|
"label" "Apply NS 3.3 preset"
|
||||||
|
"command" "engine nspreset 2"
|
||||||
|
}
|
||||||
|
"3"
|
||||||
|
{
|
||||||
|
"label" "Apply competitive preset"
|
||||||
|
"command" "engine nspreset 3"
|
||||||
|
}
|
||||||
|
"4"
|
||||||
|
{
|
||||||
|
"label" ""
|
||||||
|
"command" ""
|
||||||
|
}
|
||||||
|
"5"
|
||||||
|
{
|
||||||
|
"label" ""
|
||||||
|
"command" ""
|
||||||
|
}
|
||||||
|
"6"
|
||||||
{
|
{
|
||||||
"label" "#GameUI_GameMenu_ResumeGame"
|
"label" "#GameUI_GameMenu_ResumeGame"
|
||||||
"command" "ResumeGame"
|
"command" "ResumeGame"
|
||||||
"OnlyInGame" "1"
|
"OnlyInGame" "1"
|
||||||
}
|
}
|
||||||
"2"
|
"7"
|
||||||
{
|
{
|
||||||
"label" "#Menu_ReadyRoom"
|
"label" "#Menu_ReadyRoom"
|
||||||
"command" "engine menureadyroom"
|
"command" "engine menureadyroom"
|
||||||
"OnlyInGame" "1"
|
"OnlyInGame" "1"
|
||||||
}
|
}
|
||||||
"3"
|
"8"
|
||||||
{
|
{
|
||||||
"label" "#GameUI_GameMenu_Disconnect"
|
"label" "#GameUI_GameMenu_Disconnect"
|
||||||
"command" "Disconnect"
|
"command" "Disconnect"
|
||||||
|
@ -37,25 +62,25 @@
|
||||||
// "notmulti" "1"
|
// "notmulti" "1"
|
||||||
// "OnlyInGame" "1"
|
// "OnlyInGame" "1"
|
||||||
// }
|
// }
|
||||||
"7"
|
"9"
|
||||||
{
|
{
|
||||||
"label" ""
|
"label" ""
|
||||||
"command" ""
|
"command" ""
|
||||||
"notmulti" "1"
|
"notmulti" "1"
|
||||||
}
|
}
|
||||||
"8"
|
"10"
|
||||||
{
|
{
|
||||||
"label" "#GameUI_GameMenu_PlayerList"
|
"label" "#GameUI_GameMenu_PlayerList"
|
||||||
"command" "OpenPlayerListDialog"
|
"command" "OpenPlayerListDialog"
|
||||||
"OnlyInGame" "1"
|
"OnlyInGame" "1"
|
||||||
"notmulti" "0"
|
"notmulti" "0"
|
||||||
}
|
}
|
||||||
"9"
|
"11"
|
||||||
{
|
{
|
||||||
"label" "#GameUI_GameMenu_CreateServer"
|
"label" "#GameUI_GameMenu_CreateServer"
|
||||||
"command" "OpenCreateMultiplayerGameDialog"
|
"command" "OpenCreateMultiplayerGameDialog"
|
||||||
}
|
}
|
||||||
"10"
|
"12"
|
||||||
{
|
{
|
||||||
"label" "#GameUI_GameMenu_FindServers"
|
"label" "#GameUI_GameMenu_FindServers"
|
||||||
"command" "OpenServerBrowser"
|
"command" "OpenServerBrowser"
|
||||||
|
@ -66,23 +91,23 @@
|
||||||
//"label" "#GameUI_GameMenu_PlayDemo"
|
//"label" "#GameUI_GameMenu_PlayDemo"
|
||||||
//"command" "OpenLoadDemoDialog"
|
//"command" "OpenLoadDemoDialog"
|
||||||
//}
|
//}
|
||||||
"11"
|
"13"
|
||||||
{
|
{
|
||||||
"label" ""
|
"label" ""
|
||||||
"command" ""
|
"command" ""
|
||||||
}
|
}
|
||||||
"12"
|
"14"
|
||||||
{
|
{
|
||||||
"label" "#GameUI_GameMenu_ChangeGame"
|
"label" "#GameUI_GameMenu_ChangeGame"
|
||||||
"command" "OpenChangeGameDialog"
|
"command" "OpenChangeGameDialog"
|
||||||
"notsteam" "1"
|
"notsteam" "1"
|
||||||
}
|
}
|
||||||
"13"
|
"15"
|
||||||
{
|
{
|
||||||
"label" "#GameUI_GameMenu_Options"
|
"label" "#GameUI_GameMenu_Options"
|
||||||
"command" "OpenOptionsDialog"
|
"command" "OpenOptionsDialog"
|
||||||
}
|
}
|
||||||
"14"
|
"16"
|
||||||
{
|
{
|
||||||
"label" "#GameUI_GameMenu_Quit"
|
"label" "#GameUI_GameMenu_Quit"
|
||||||
"command" "Quit"
|
"command" "Quit"
|
||||||
|
|
80
main/resource/MultiplayerAdvancedDialog.res
Normal file
80
main/resource/MultiplayerAdvancedDialog.res
Normal file
|
@ -0,0 +1,80 @@
|
||||||
|
"Resource\MultiplayerAdvancedDialog.res"
|
||||||
|
{
|
||||||
|
"MultiplayerAdvancedDialog"
|
||||||
|
{
|
||||||
|
"ControlName" "CTaskFrame"
|
||||||
|
"fieldName" "MultiplayerAdvancedDialog"
|
||||||
|
"xpos" "250"
|
||||||
|
"ypos" "25"
|
||||||
|
"wide" "700"
|
||||||
|
"tall" "600"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "1"
|
||||||
|
"enabled" "1"
|
||||||
|
"tabPosition" "0"
|
||||||
|
"paintbackground" "1"
|
||||||
|
"settitlebarvisible" "1"
|
||||||
|
"title" "#GameUI_MultiplayerAdvanced"
|
||||||
|
}
|
||||||
|
"Cancel"
|
||||||
|
{
|
||||||
|
"ControlName" "Button"
|
||||||
|
"fieldName" "Cancel"
|
||||||
|
"xpos" "616"
|
||||||
|
"ypos" "562"
|
||||||
|
"wide" "72"
|
||||||
|
"tall" "24"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "1"
|
||||||
|
"enabled" "1"
|
||||||
|
"tabPosition" "2"
|
||||||
|
"paintbackground" "1"
|
||||||
|
"labelText" "#GameUI_Cancel"
|
||||||
|
"textAlignment" "west"
|
||||||
|
"dulltext" "0"
|
||||||
|
"brighttext" "0"
|
||||||
|
"wrap" "0"
|
||||||
|
"Command" "Close"
|
||||||
|
"Default" "0"
|
||||||
|
}
|
||||||
|
"Ok"
|
||||||
|
{
|
||||||
|
"ControlName" "Button"
|
||||||
|
"fieldName" "OK"
|
||||||
|
"xpos" "536"
|
||||||
|
"ypos" "562"
|
||||||
|
"wide" "72"
|
||||||
|
"tall" "24"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "1"
|
||||||
|
"enabled" "1"
|
||||||
|
"tabPosition" "1"
|
||||||
|
"paintbackground" "1"
|
||||||
|
"labelText" "#GameUI_OK"
|
||||||
|
"textAlignment" "west"
|
||||||
|
"dulltext" "0"
|
||||||
|
"brighttext" "0"
|
||||||
|
"wrap" "0"
|
||||||
|
"Command" "Ok"
|
||||||
|
"Default" "0"
|
||||||
|
}
|
||||||
|
"PanelListPanel"
|
||||||
|
{
|
||||||
|
"ControlName" "CPanelListPanel"
|
||||||
|
"fieldName" "PanelListPanel"
|
||||||
|
"xpos" "16"
|
||||||
|
"ypos" "56"
|
||||||
|
"wide" "670"
|
||||||
|
"tall" "502"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "1"
|
||||||
|
"enabled" "1"
|
||||||
|
"tabPosition" "0"
|
||||||
|
"paintbackground" "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
31
main/resource/MultiplayerAdvancedPage.res
Normal file
31
main/resource/MultiplayerAdvancedPage.res
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
"Resource\MultiplayerAdvancedDia"
|
||||||
|
{
|
||||||
|
"MultiplayerAdvancedDialog"
|
||||||
|
{
|
||||||
|
"ControlName" "PropertyDialog"
|
||||||
|
"fieldName" "MultiplayerAdvancedDialog"
|
||||||
|
"xpos" "0"
|
||||||
|
"ypos" "0"
|
||||||
|
"wide" "728"
|
||||||
|
"tall" "536"
|
||||||
|
"autoResize" "0"
|
||||||
|
"pinCorner" "0"
|
||||||
|
"visible" "1"
|
||||||
|
"enabled" "1"
|
||||||
|
"tabPosition" "0"
|
||||||
|
}
|
||||||
|
"PanelListPanel"
|
||||||
|
{
|
||||||
|
"ControlName" "CPanelListPanel"
|
||||||
|
"fieldName" "PanelListPanel"
|
||||||
|
"xpos" "10"
|
||||||
|
"ypos" "10"
|
||||||
|
"wide" "713"
|
||||||
|
"tall" "516"
|
||||||
|
"autoResize" "0"
|
||||||
|
"pinCorner" "0"
|
||||||
|
"visible" "1"
|
||||||
|
"enabled" "1"
|
||||||
|
"tabPosition" "0"
|
||||||
|
}
|
||||||
|
}
|
312
main/resource/OptionsSubMultiplayer.res
Normal file
312
main/resource/OptionsSubMultiplayer.res
Normal file
|
@ -0,0 +1,312 @@
|
||||||
|
"Resource/OptionsSubMultiplayer.res"
|
||||||
|
{
|
||||||
|
"Advanced"
|
||||||
|
{
|
||||||
|
"ControlName" "Button"
|
||||||
|
"fieldName" "Advanced"
|
||||||
|
"xpos" "32"
|
||||||
|
"ypos" "22"
|
||||||
|
"tooltiptext" ""
|
||||||
|
"wide" "440"
|
||||||
|
"tall" "80"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "1"
|
||||||
|
"enabled" "1"
|
||||||
|
"tabPosition" "1"
|
||||||
|
"paintbackground" "1"
|
||||||
|
"labelText" "#GameUI_AdvancedEllipsis"
|
||||||
|
"textAlignment" "center"
|
||||||
|
"dulltext" "0"
|
||||||
|
"brighttext" "0"
|
||||||
|
"wrap" "0"
|
||||||
|
"Command" "Advanced"
|
||||||
|
"Default" "0"
|
||||||
|
}
|
||||||
|
"NameLabel"
|
||||||
|
{
|
||||||
|
"ControlName" "Label"
|
||||||
|
"fieldName" "NameLabel"
|
||||||
|
"xpos" "230"
|
||||||
|
"ypos" "144"
|
||||||
|
"wide" "144"
|
||||||
|
"tall" "24"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "1"
|
||||||
|
"enabled" "1"
|
||||||
|
"tabPosition" "0"
|
||||||
|
"paintbackground" "1"
|
||||||
|
"labelText" "#GameUI_PlayerName"
|
||||||
|
"textAlignment" "west"
|
||||||
|
"associate" "NameEntry"
|
||||||
|
"dulltext" "0"
|
||||||
|
"brighttext" "0"
|
||||||
|
"wrap" "0"
|
||||||
|
}
|
||||||
|
"NameEntry"
|
||||||
|
{
|
||||||
|
"ControlName" "CCvarTextEntry"
|
||||||
|
"fieldName" "NameEntry"
|
||||||
|
"xpos" "230"
|
||||||
|
"ypos" "174"
|
||||||
|
"wide" "240"
|
||||||
|
"tall" "24"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "1"
|
||||||
|
"enabled" "1"
|
||||||
|
"tabPosition" "2"
|
||||||
|
"paintbackground" "1"
|
||||||
|
"textHidden" "0"
|
||||||
|
"editable" "1"
|
||||||
|
"maxchars" "63"
|
||||||
|
"NumericInputOnly" "0"
|
||||||
|
"unicode" "1"
|
||||||
|
}
|
||||||
|
"Primary Color Slider"
|
||||||
|
{
|
||||||
|
"ControlName" "CCvarSlider"
|
||||||
|
"fieldName" "Primary Color Slider"
|
||||||
|
"xpos" "0"
|
||||||
|
"ypos" "0"
|
||||||
|
"wide" "42"
|
||||||
|
"tall" "16"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "0"
|
||||||
|
"enabled" "0"
|
||||||
|
"tabPosition" "0"
|
||||||
|
"paintbackground" "1"
|
||||||
|
"leftText" "0.00"
|
||||||
|
"rightText" "255.00"
|
||||||
|
}
|
||||||
|
"Secondary Color Slider"
|
||||||
|
{
|
||||||
|
"ControlName" "CCvarSlider"
|
||||||
|
"fieldName" "Secondary Color Slider"
|
||||||
|
"xpos" "0"
|
||||||
|
"ypos" "0"
|
||||||
|
"wide" "42"
|
||||||
|
"tall" "16"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "0"
|
||||||
|
"enabled" "0"
|
||||||
|
"tabPosition" "0"
|
||||||
|
"paintbackground" "1"
|
||||||
|
"leftText" "0.00"
|
||||||
|
"rightText" "255.00"
|
||||||
|
}
|
||||||
|
"High Quality Models"
|
||||||
|
{
|
||||||
|
"ControlName" "CCvarToggleCheckButton"
|
||||||
|
"fieldName" "High Quality Models"
|
||||||
|
"xpos" "162"
|
||||||
|
"ypos" "280"
|
||||||
|
"wide" "204"
|
||||||
|
"tall" "24"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "0"
|
||||||
|
"enabled" "0"
|
||||||
|
"tabPosition" "0"
|
||||||
|
"paintbackground" "0"
|
||||||
|
"labelText" "#GameUI_HighModels"
|
||||||
|
"textAlignment" "west"
|
||||||
|
"dulltext" "0"
|
||||||
|
"brighttext" "0"
|
||||||
|
"wrap" "0"
|
||||||
|
"Default" "0"
|
||||||
|
}
|
||||||
|
"Player model"
|
||||||
|
{
|
||||||
|
"ControlName" "CLabeledCommandComboBox"
|
||||||
|
"fieldName" "Player model"
|
||||||
|
"xpos" "0"
|
||||||
|
"ypos" "0"
|
||||||
|
"wide" "42"
|
||||||
|
"tall" "16"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "0"
|
||||||
|
"enabled" "0"
|
||||||
|
"tabPosition" "0"
|
||||||
|
"paintbackground" "1"
|
||||||
|
"textHidden" "0"
|
||||||
|
"editable" "0"
|
||||||
|
"maxchars" "-1"
|
||||||
|
"NumericInputOnly" "0"
|
||||||
|
"unicode" "0"
|
||||||
|
}
|
||||||
|
"Label2"
|
||||||
|
{
|
||||||
|
"ControlName" "Label"
|
||||||
|
"fieldName" "Label2"
|
||||||
|
"xpos" "230"
|
||||||
|
"ypos" "216"
|
||||||
|
"wide" "140"
|
||||||
|
"tall" "24"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "1"
|
||||||
|
"enabled" "1"
|
||||||
|
"tabPosition" "0"
|
||||||
|
"paintbackground" "1"
|
||||||
|
"labelText" "#GameUI_SpraypaintImage"
|
||||||
|
"textAlignment" "west"
|
||||||
|
"associate" "SpraypaintList"
|
||||||
|
"dulltext" "0"
|
||||||
|
"brighttext" "0"
|
||||||
|
"wrap" "0"
|
||||||
|
}
|
||||||
|
"SpraypaintList"
|
||||||
|
{
|
||||||
|
"ControlName" "CLabeledCommandComboBox"
|
||||||
|
"fieldName" "SpraypaintList"
|
||||||
|
"xpos" "230"
|
||||||
|
"ypos" "244"
|
||||||
|
"wide" "240"
|
||||||
|
"tall" "24"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "1"
|
||||||
|
"enabled" "1"
|
||||||
|
"tabPosition" "3"
|
||||||
|
"paintbackground" "1"
|
||||||
|
"textHidden" "0"
|
||||||
|
"editable" "0"
|
||||||
|
"maxchars" "-1"
|
||||||
|
"NumericInputOnly" "0"
|
||||||
|
"unicode" "0"
|
||||||
|
}
|
||||||
|
"SpraypaintColor"
|
||||||
|
{
|
||||||
|
"ControlName" "CLabeledCommandComboBox"
|
||||||
|
"fieldName" "SpraypaintColor"
|
||||||
|
"xpos" "230"
|
||||||
|
"ypos" "274"
|
||||||
|
"wide" "240"
|
||||||
|
"tall" "24"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "1"
|
||||||
|
"enabled" "1"
|
||||||
|
"tabPosition" "4"
|
||||||
|
"paintbackground" "1"
|
||||||
|
"textHidden" "0"
|
||||||
|
"editable" "0"
|
||||||
|
"maxchars" "-1"
|
||||||
|
"NumericInputOnly" "0"
|
||||||
|
"unicode" "0"
|
||||||
|
}
|
||||||
|
"ModelImage"
|
||||||
|
{
|
||||||
|
"ControlName" "Panel"
|
||||||
|
"fieldName" "ModelImage"
|
||||||
|
"xpos" "0"
|
||||||
|
"ypos" "0"
|
||||||
|
"wide" "66"
|
||||||
|
"tall" "66"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "0"
|
||||||
|
"enabled" "0"
|
||||||
|
"tabPosition" "0"
|
||||||
|
"paintbackground" "1"
|
||||||
|
}
|
||||||
|
"LogoImage"
|
||||||
|
{
|
||||||
|
"ControlName" "Panel"
|
||||||
|
"fieldName" "LogoImage"
|
||||||
|
"xpos" "132"
|
||||||
|
"ypos" "234"
|
||||||
|
"wide" "64"
|
||||||
|
"tall" "64"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "1"
|
||||||
|
"enabled" "1"
|
||||||
|
"tabPosition" "0"
|
||||||
|
"paintbackground" "1"
|
||||||
|
}
|
||||||
|
"Ok"
|
||||||
|
{
|
||||||
|
"ControlName" "Button"
|
||||||
|
"fieldName" "OK"
|
||||||
|
"xpos" "0"
|
||||||
|
"ypos" "0"
|
||||||
|
"wide" "42"
|
||||||
|
"tall" "16"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "0"
|
||||||
|
"enabled" "0"
|
||||||
|
"tabPosition" "0"
|
||||||
|
"paintbackground" "1"
|
||||||
|
"labelText" "#GameUI_OK"
|
||||||
|
"textAlignment" "west"
|
||||||
|
"dulltext" "0"
|
||||||
|
"brighttext" "0"
|
||||||
|
"wrap" "0"
|
||||||
|
"Default" "0"
|
||||||
|
}
|
||||||
|
"Apply"
|
||||||
|
{
|
||||||
|
"ControlName" "Button"
|
||||||
|
"fieldName" "Apply"
|
||||||
|
"xpos" "0"
|
||||||
|
"ypos" "0"
|
||||||
|
"wide" "42"
|
||||||
|
"tall" "16"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "0"
|
||||||
|
"enabled" "0"
|
||||||
|
"tabPosition" "0"
|
||||||
|
"paintbackground" "1"
|
||||||
|
"labelText" "#GameUI_Apply"
|
||||||
|
"textAlignment" "west"
|
||||||
|
"dulltext" "0"
|
||||||
|
"brighttext" "0"
|
||||||
|
"wrap" "0"
|
||||||
|
"Default" "0"
|
||||||
|
}
|
||||||
|
"Cancel"
|
||||||
|
{
|
||||||
|
"ControlName" "Button"
|
||||||
|
"fieldName" "Cancel"
|
||||||
|
"xpos" "0"
|
||||||
|
"ypos" "0"
|
||||||
|
"wide" "42"
|
||||||
|
"tall" "16"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "0"
|
||||||
|
"enabled" "0"
|
||||||
|
"tabPosition" "0"
|
||||||
|
"paintbackground" "1"
|
||||||
|
"labelText" "#GameUI_Cancel"
|
||||||
|
"textAlignment" "west"
|
||||||
|
"dulltext" "0"
|
||||||
|
"brighttext" "0"
|
||||||
|
"wrap" "0"
|
||||||
|
"Default" "0"
|
||||||
|
}
|
||||||
|
"Divider1"
|
||||||
|
{
|
||||||
|
"ControlName" "Divider"
|
||||||
|
"fieldName" "Divider1"
|
||||||
|
"xpos" "32"
|
||||||
|
"ypos" "126"
|
||||||
|
"wide" "440"
|
||||||
|
"tall" "1"
|
||||||
|
"AutoResize" "0"
|
||||||
|
"PinCorner" "0"
|
||||||
|
"visible" "1"
|
||||||
|
"enabled" "1"
|
||||||
|
"tabPosition" "0"
|
||||||
|
"paintbackground" "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -174,7 +174,7 @@ Scheme
|
||||||
"ArmedMenuColor" "255 255 255 255"
|
"ArmedMenuColor" "255 255 255 255"
|
||||||
"DepressedMenuColor" "192 186 80 255"
|
"DepressedMenuColor" "192 186 80 255"
|
||||||
"WidescreenBarColor" "0 0 0 0"
|
"WidescreenBarColor" "0 0 0 0"
|
||||||
"MenuItemVisibilityRate" "0.03" // time it takes for one menu item to appear
|
"MenuItemVisibilityRate" "0.01" // time it takes for one menu item to appear
|
||||||
"MenuItemHeight" "28"
|
"MenuItemHeight" "28"
|
||||||
"GameMenuInset" "32"
|
"GameMenuInset" "32"
|
||||||
}
|
}
|
||||||
|
|
BIN
main/resource/gameui_english.txt
Normal file
BIN
main/resource/gameui_english.txt
Normal file
Binary file not shown.
|
@ -58,6 +58,14 @@ mp_killdelay 3
|
||||||
mp_flashlight 1
|
mp_flashlight 1
|
||||||
mp_footsteps 1
|
mp_footsteps 1
|
||||||
|
|
||||||
|
// AI Player Settings
|
||||||
|
mp_botsenabled 0
|
||||||
|
mp_botminplayers 0
|
||||||
|
mp_botusemapdefaults 1
|
||||||
|
mp_botskill 1
|
||||||
|
mp_botautomode 1
|
||||||
|
mp_botcommandermode 1
|
||||||
|
|
||||||
// disable autoaim and mad gibs
|
// disable autoaim and mad gibs
|
||||||
sv_aim 0
|
sv_aim 0
|
||||||
violence_hgibs 0
|
violence_hgibs 0
|
||||||
|
@ -100,3 +108,14 @@ mp_uplink 1
|
||||||
|
|
||||||
// Needed so this file is executed on map change, like pre-NS v2.1
|
// Needed so this file is executed on map change, like pre-NS v2.1
|
||||||
mapchangecfgfile server.cfg
|
mapchangecfgfile server.cfg
|
||||||
|
|
||||||
|
// Post HL 25th Aniversary update
|
||||||
|
sv_rollangle 0
|
||||||
|
sv_allow_shaders 0
|
||||||
|
|
||||||
|
// Set rate limits, otherwise they initialize to bad values
|
||||||
|
sv_maxupdaterate 102
|
||||||
|
sv_maxunlag 0.3
|
||||||
|
sv_maxrate 0
|
||||||
|
sv_minrate 20000
|
||||||
|
sv_minupdaterate 30
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
|
|
||||||
// Half-Life Server Configuration Layout Script (stores last settings chosen, too)
|
// Half-Life Server Configuration Layout Script (stores last settings chosen, too)
|
||||||
// File generated: Sun May 07 10:30:06 AM
|
// File generated: Thu Mar 14 10:53:31 AM
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// Cvar - Setting
|
// Cvar - Setting
|
||||||
|
@ -45,7 +45,7 @@ DESCRIPTION SERVER_OPTIONS
|
||||||
{
|
{
|
||||||
"LAN Game"
|
"LAN Game"
|
||||||
{ BOOL }
|
{ BOOL }
|
||||||
{ "0" }
|
{ "1" }
|
||||||
}
|
}
|
||||||
|
|
||||||
"hostname"
|
"hostname"
|
||||||
|
@ -59,7 +59,7 @@ DESCRIPTION SERVER_OPTIONS
|
||||||
{
|
{
|
||||||
"#Valve_Max_Players"
|
"#Valve_Max_Players"
|
||||||
{ NUMBER 2.000000 32.000000 }
|
{ NUMBER 2.000000 32.000000 }
|
||||||
{ "2.000000" }
|
{ "24.000000" }
|
||||||
}
|
}
|
||||||
|
|
||||||
"sv_password"
|
"sv_password"
|
||||||
|
@ -158,4 +158,46 @@ DESCRIPTION SERVER_OPTIONS
|
||||||
{ "0.510000" }
|
{ "0.510000" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"mp_botsenabled"
|
||||||
|
{
|
||||||
|
"Enable Bots"
|
||||||
|
{ BOOL }
|
||||||
|
{ "0" }
|
||||||
|
}
|
||||||
|
|
||||||
|
"mp_botskill"
|
||||||
|
{
|
||||||
|
"Bot Difficulty"
|
||||||
|
{
|
||||||
|
LIST
|
||||||
|
"Easy" "0"
|
||||||
|
"Medium" "1"
|
||||||
|
"Hard" "2"
|
||||||
|
"Godlike" "3"
|
||||||
|
}
|
||||||
|
{ "1.000000" }
|
||||||
|
}
|
||||||
|
|
||||||
|
"mp_botautomode"
|
||||||
|
{
|
||||||
|
"Bot Mode"
|
||||||
|
{
|
||||||
|
LIST
|
||||||
|
"Manual" "0"
|
||||||
|
"Automatic" "1"
|
||||||
|
}
|
||||||
|
{ "1.000000" }
|
||||||
|
}
|
||||||
|
|
||||||
|
"mp_botcommandermode"
|
||||||
|
{
|
||||||
|
"Allow AI Commander"
|
||||||
|
{
|
||||||
|
LIST
|
||||||
|
"Disabled" "0"
|
||||||
|
"Enabled" "1"
|
||||||
|
}
|
||||||
|
{ "1.000000" }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
14
main/shaders/fs.shaders
Normal file
14
main/shaders/fs.shaders
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#version 330 core
|
||||||
|
|
||||||
|
in vec2 texCoord;
|
||||||
|
out vec4 fragColor;
|
||||||
|
|
||||||
|
uniform sampler2D textureSampler;
|
||||||
|
uniform float colorMultiplier; // Uniform float to multiply color by
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
// Sample the texture
|
||||||
|
vec4 texColor = texture(textureSampler, texCoord);
|
||||||
|
// Multiply the color
|
||||||
|
fragColor = vec4(texColor.rgb * colorMultiplier, 1.0f);
|
||||||
|
}
|
10
main/shaders/vs.shaders
Normal file
10
main/shaders/vs.shaders
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#version 330 core
|
||||||
|
|
||||||
|
layout(location = 0) in vec2 vertexPosition;
|
||||||
|
out vec2 texCoord;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
// Pass the vertex position to the fragment shader
|
||||||
|
texCoord = (vertexPosition + 1.0) * 0.5; // Convert vertex position to texture coordinates
|
||||||
|
gl_Position = vec4(vertexPosition, 0.0, 1.0);
|
||||||
|
}
|
0
main/sound/UI/launch_dnmenu1.wav
Normal file
0
main/sound/UI/launch_dnmenu1.wav
Normal file
BIN
main/sound/UI/launch_selectmenu.wav
Normal file
BIN
main/sound/UI/launch_selectmenu.wav
Normal file
Binary file not shown.
|
@ -8,9 +8,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cl_dll.dll", "cl_dll\cl_dll
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ns.dll", "dlls\hl.vcxproj", "{BC87A180-F17B-83FC-5D7D-470FAD003ABC}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ns.dll", "dlls\hl.vcxproj", "{BC87A180-F17B-83FC-5D7D-470FAD003ABC}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{36E392B2-EA9F-43FE-9700-82DFE548C75D} = {36E392B2-EA9F-43FE-9700-82DFE548C75D}
|
||||||
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "particles", "particles\particles.vcxproj", "{5AADD469-7488-4B34-A9FD-01CFAC5972FD}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "particles", "particles\particles.vcxproj", "{5AADD469-7488-4B34-A9FD-01CFAC5972FD}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "detour", "detour\detour.vcxproj", "{36E392B2-EA9F-43FE-9700-82DFE548C75D}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Win32 = Debug|Win32
|
Debug|Win32 = Debug|Win32
|
||||||
|
@ -36,6 +41,12 @@ Global
|
||||||
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Playtest|Win32.Build.0 = Particles - Release|Win32
|
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Playtest|Win32.Build.0 = Particles - Release|Win32
|
||||||
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Release|Win32.ActiveCfg = Particles - Release|Win32
|
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Release|Win32.ActiveCfg = Particles - Release|Win32
|
||||||
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Release|Win32.Build.0 = Particles - Release|Win32
|
{5AADD469-7488-4B34-A9FD-01CFAC5972FD}.Release|Win32.Build.0 = Particles - Release|Win32
|
||||||
|
{36E392B2-EA9F-43FE-9700-82DFE548C75D}.Debug|Win32.ActiveCfg = Detour - Debug|Win32
|
||||||
|
{36E392B2-EA9F-43FE-9700-82DFE548C75D}.Debug|Win32.Build.0 = Detour - Debug|Win32
|
||||||
|
{36E392B2-EA9F-43FE-9700-82DFE548C75D}.Playtest|Win32.ActiveCfg = Detour - Release|Win32
|
||||||
|
{36E392B2-EA9F-43FE-9700-82DFE548C75D}.Playtest|Win32.Build.0 = Detour - Release|Win32
|
||||||
|
{36E392B2-EA9F-43FE-9700-82DFE548C75D}.Release|Win32.ActiveCfg = Detour - Release|Win32
|
||||||
|
{36E392B2-EA9F-43FE-9700-82DFE548C75D}.Release|Win32.Build.0 = Detour - Release|Win32
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|
|
@ -43,6 +43,7 @@ WeaponsResource gWR;
|
||||||
int g_weaponselect = 0;
|
int g_weaponselect = 0;
|
||||||
|
|
||||||
extern bool gCanMove;
|
extern bool gCanMove;
|
||||||
|
extern cvar_t* cl_weaponcfgs;
|
||||||
|
|
||||||
void IN_AttackDownForced(void);
|
void IN_AttackDownForced(void);
|
||||||
void IN_AttackUpForced(void);
|
void IN_AttackUpForced(void);
|
||||||
|
@ -87,6 +88,9 @@ void WeaponsResource::Reset( void )
|
||||||
iOldWeaponBits = 0;
|
iOldWeaponBits = 0;
|
||||||
memset( rgSlots, 0, sizeof(WEAPON*)*MAX_WEAPON_SLOTS*MAX_WEAPON_POSITIONS );
|
memset( rgSlots, 0, sizeof(WEAPON*)*MAX_WEAPON_SLOTS*MAX_WEAPON_POSITIONS );
|
||||||
memset( riAmmo, 0, sizeof(int)*MAX_AMMO_TYPES );
|
memset( riAmmo, 0, sizeof(int)*MAX_AMMO_TYPES );
|
||||||
|
crossLastWeapId = 0;
|
||||||
|
lastSpecXhair = 0;
|
||||||
|
lastPlayMode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -380,13 +384,18 @@ void WeaponsResource::UserCmd_MovementOn()
|
||||||
// Find out which weapon we want to trigger
|
// Find out which weapon we want to trigger
|
||||||
AvHUser3 theUser3 = gHUD.GetHUDUser3();
|
AvHUser3 theUser3 = gHUD.GetHUDUser3();
|
||||||
int wID = -1;
|
int wID = -1;
|
||||||
|
bool lerkFlap = false;
|
||||||
switch(theUser3)
|
switch(theUser3)
|
||||||
{
|
{
|
||||||
case AVH_USER3_ALIEN_PLAYER1:
|
case AVH_USER3_ALIEN_PLAYER1:
|
||||||
wID = AVH_ABILITY_LEAP;
|
wID = AVH_ABILITY_LEAP;
|
||||||
break;
|
break;
|
||||||
|
//TODO: Make healspray work with attack2
|
||||||
|
case AVH_USER3_ALIEN_PLAYER2:
|
||||||
|
wID = AVH_WEAPON_HEALINGSPRAY;
|
||||||
|
break;
|
||||||
case AVH_USER3_ALIEN_PLAYER3:
|
case AVH_USER3_ALIEN_PLAYER3:
|
||||||
// TODO: Add flap
|
lerkFlap = true;
|
||||||
break;
|
break;
|
||||||
case AVH_USER3_ALIEN_PLAYER4:
|
case AVH_USER3_ALIEN_PLAYER4:
|
||||||
wID = AVH_WEAPON_BLINK;
|
wID = AVH_WEAPON_BLINK;
|
||||||
|
@ -399,7 +408,24 @@ void WeaponsResource::UserCmd_MovementOn()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wID > -1)
|
if (wID == AVH_WEAPON_HEALINGSPRAY)
|
||||||
|
{
|
||||||
|
WEAPON* healWeapon = this->GetWeapon(AVH_WEAPON_HEALINGSPRAY);
|
||||||
|
WEAPON* currentWeapon = this->GetWeapon(gHUD.GetCurrentWeaponID());
|
||||||
|
|
||||||
|
if (healWeapon != NULL && currentWeapon != NULL)
|
||||||
|
{
|
||||||
|
//if (healWeapon != currentWeapon)
|
||||||
|
//{
|
||||||
|
healSprayLastWeapon = currentWeapon;
|
||||||
|
healSprayAttack2Active = true;
|
||||||
|
SetCurrentWeapon(healWeapon);
|
||||||
|
//}
|
||||||
|
|
||||||
|
IN_Attack2Down();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (wID > -1)
|
||||||
{
|
{
|
||||||
// Fetch the needed movement weapon
|
// Fetch the needed movement weapon
|
||||||
WEAPON *p = this->GetWeapon(wID);
|
WEAPON *p = this->GetWeapon(wID);
|
||||||
|
@ -409,6 +435,10 @@ void WeaponsResource::UserCmd_MovementOn()
|
||||||
IN_Attack2Down();
|
IN_Attack2Down();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (lerkFlap)
|
||||||
|
{
|
||||||
|
IN_Attack2Down();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -418,6 +448,24 @@ void WeaponsResource::UserCmd_MovementOff()
|
||||||
// Ensure that we're not activating any weapons when selected
|
// Ensure that we're not activating any weapons when selected
|
||||||
IN_Attack2Up();
|
IN_Attack2Up();
|
||||||
IN_ReloadUp();
|
IN_ReloadUp();
|
||||||
|
|
||||||
|
// Check if we're in game.
|
||||||
|
if (gEngfuncs.pfnGetLevelName()[0] != 0)
|
||||||
|
{
|
||||||
|
if (gHUD.GetHUDUser3() == AVH_USER3_ALIEN_PLAYER2)
|
||||||
|
{
|
||||||
|
WEAPON* healWeapon = this->GetWeapon(AVH_WEAPON_HEALINGSPRAY);
|
||||||
|
if (healWeapon != NULL && healSprayLastWeapon != NULL)
|
||||||
|
{
|
||||||
|
//if (healSprayLastWeapon != healWeapon)
|
||||||
|
//{
|
||||||
|
SetCurrentWeapon(healSprayLastWeapon);
|
||||||
|
//}
|
||||||
|
|
||||||
|
healSprayAttack2Active = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -461,7 +509,15 @@ void WeaponsResource::SetCurrentWeapon(WEAPON* newWeapon)
|
||||||
if( newWeapon != NULL )
|
if( newWeapon != NULL )
|
||||||
{
|
{
|
||||||
if( newWeapon != currentWeapon )
|
if( newWeapon != currentWeapon )
|
||||||
{ lastWeapon = currentWeapon; }
|
{
|
||||||
|
lastWeapon = currentWeapon;
|
||||||
|
|
||||||
|
if (gHUD.GetHUDUser3() == AVH_USER3_ALIEN_PLAYER2 && !healSprayAttack2Active)
|
||||||
|
{
|
||||||
|
healSprayLastWeapon = newWeapon;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ServerCmd(newWeapon->szName);
|
ServerCmd(newWeapon->szName);
|
||||||
g_weaponselect = newWeapon->iId;
|
g_weaponselect = newWeapon->iId;
|
||||||
}
|
}
|
||||||
|
@ -536,7 +592,67 @@ void WeaponsResource :: SelectSlot( int iSlot, int fAdvance, int iDirection )
|
||||||
|
|
||||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
void WeaponsResource::SetWeaponConfig (WEAPON* weapon, int specXhair)
|
||||||
|
{
|
||||||
|
int newPlayMode = gHUD.GetPlayMode();
|
||||||
|
|
||||||
|
if (gHUD.GetCurrentWeaponID() != crossLastWeapId || (newPlayMode == PLAYMODE_READYROOM && newPlayMode != lastPlayMode) || (specXhair != lastSpecXhair && !weapon))
|
||||||
|
{
|
||||||
|
crossLastWeapId = gHUD.GetCurrentWeaponID();
|
||||||
|
lastPlayMode = newPlayMode;
|
||||||
|
lastSpecXhair = specXhair;
|
||||||
|
|
||||||
|
char weapCfg[128];
|
||||||
|
|
||||||
|
if (cl_weaponcfgs->value == 1.0f)
|
||||||
|
{
|
||||||
|
ClientCmd("exec weaponcfgs/default.cfg");
|
||||||
|
if (!weapon || newPlayMode == PLAYMODE_READYROOM)
|
||||||
|
{
|
||||||
|
if (specXhair == 1)
|
||||||
|
{
|
||||||
|
ClientCmd("exec weaponcfgs/spectate.cfg");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClientCmd("exec weaponcfgs/noweapon.cfg");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
snprintf(weapCfg, 128, "exec weaponcfgs/%s.cfg", weapon->szName);
|
||||||
|
ClientCmd(weapCfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (cl_weaponcfgs->value == 2.0f)
|
||||||
|
{
|
||||||
|
if (!weapon || newPlayMode == PLAYMODE_READYROOM)
|
||||||
|
{
|
||||||
|
if (specXhair == 1)
|
||||||
|
{
|
||||||
|
ClientCmd("exec weaponcfgs/nsdefaults/spectate.cfg");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClientCmd("exec weaponcfgs/nsdefaults/noweapon.cfg");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
snprintf(weapCfg, 128, "exec weaponcfgs/nsdefaults/%s.cfg", weapon->szName);
|
||||||
|
ClientCmd(weapCfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
int giBucketHeight, giBucketWidth, giABHeight, giABWidth; // Ammo Bar width and height
|
int giBucketHeight, giBucketWidth, giABHeight, giABWidth; // Ammo Bar width and height
|
||||||
|
cvar_t* hud_ammo_x;
|
||||||
|
cvar_t* hud_ammo_y;
|
||||||
|
cvar_t* hud_ammo_scale;
|
||||||
|
cvar_t* hud_ammo_alphamin;
|
||||||
|
|
||||||
AVHHSPRITE ghsprBuckets; // Sprite for top row of weapons menu
|
AVHHSPRITE ghsprBuckets; // Sprite for top row of weapons menu
|
||||||
|
|
||||||
|
@ -599,6 +715,11 @@ int CHudAmmo::Init(void)
|
||||||
CVAR_CREATE( "hud_drawhistory_time", HISTORY_DRAW_TIME, 0 );
|
CVAR_CREATE( "hud_drawhistory_time", HISTORY_DRAW_TIME, 0 );
|
||||||
CVAR_CREATE( "hud_fastswitch", "0", FCVAR_ARCHIVE ); // controls whether or not weapons can be selected in one keypress
|
CVAR_CREATE( "hud_fastswitch", "0", FCVAR_ARCHIVE ); // controls whether or not weapons can be selected in one keypress
|
||||||
|
|
||||||
|
hud_ammo_x = CVAR_CREATE("hud_ammo_x", "0", FCVAR_ARCHIVE);
|
||||||
|
hud_ammo_y = CVAR_CREATE("hud_ammo_y", "0", FCVAR_ARCHIVE);
|
||||||
|
hud_ammo_scale = CVAR_CREATE("hud_ammo_scale", "1", FCVAR_ARCHIVE);
|
||||||
|
hud_ammo_alphamin = CVAR_CREATE("hud_ammo_alphamin", "128", FCVAR_ARCHIVE);
|
||||||
|
|
||||||
m_iFlags |= HUD_ACTIVE; //!!!
|
m_iFlags |= HUD_ACTIVE; //!!!
|
||||||
|
|
||||||
gWR.Init();
|
gWR.Init();
|
||||||
|
@ -694,41 +815,18 @@ void CHudAmmo::Think(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gHUD.GetCurrentWeaponID() != gWR.lastWeaponId)
|
WEAPON* currentWeapon = gWR.GetWeapon(gHUD.GetCurrentWeaponID());
|
||||||
{
|
|
||||||
gWR.lastWeaponId = gHUD.GetCurrentWeaponID();
|
|
||||||
|
|
||||||
float wCfgCvar = CVAR_GET_FLOAT("cl_weaponcfgs");
|
|
||||||
|
|
||||||
if (wCfgCvar == 1)
|
|
||||||
{
|
|
||||||
ClientCmd("exec weaponcfgs/default.cfg");
|
|
||||||
|
|
||||||
WEAPON* currentWeapon = gWR.GetWeapon(gHUD.GetCurrentWeaponID());
|
|
||||||
char weapcfg[128];
|
|
||||||
sprintf(weapcfg, "exec weaponcfgs/%s.cfg", currentWeapon->szName);
|
|
||||||
ClientCmd(weapcfg);
|
|
||||||
}
|
|
||||||
//else if (wCfgCvar == 2.0f)
|
|
||||||
//{
|
|
||||||
// ClientCmd("exec weaponcfgs/nsdefaults/default.cfg");
|
|
||||||
|
|
||||||
// WEAPON* currentWeapon = gWR.GetWeapon(gHUD.GetCurrentWeaponID());
|
|
||||||
// char weapcfg[128];
|
|
||||||
// sprintf(weapcfg, "exec weaponcfgs/nsdefaults/%s.cfg", currentWeapon->szName);
|
|
||||||
// ClientCmd(weapcfg);
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(gHUD.GetIsAlien()) //check for hive death causing loss of current weapon
|
if(gHUD.GetIsAlien()) //check for hive death causing loss of current weapon
|
||||||
{
|
{
|
||||||
WEAPON* currentWeapon = gWR.GetWeapon(gHUD.GetCurrentWeaponID());
|
|
||||||
if(!gWR.IsSelectable(currentWeapon)) //current weapon isn't valid
|
if(!gWR.IsSelectable(currentWeapon)) //current weapon isn't valid
|
||||||
{
|
{
|
||||||
gWR.SetValidWeapon(); //get best option
|
gWR.SetValidWeapon(); //get best option
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gWR.SetWeaponConfig(currentWeapon, false);
|
||||||
|
|
||||||
if (!gpActiveSel)
|
if (!gpActiveSel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1101,6 +1199,125 @@ void CHudAmmo::SetCurrentClip(int inClip)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//// Old HUD drawing
|
||||||
|
//int CHudAmmo::Draw(float flTime)
|
||||||
|
//{
|
||||||
|
// int a, x, y, r, g, b;
|
||||||
|
// int AmmoWidth;
|
||||||
|
//
|
||||||
|
// if (!(gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT)) ))
|
||||||
|
// return 1;
|
||||||
|
//
|
||||||
|
// if (/*!gHUD.GetIsAlive() ||*/ (gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_ALL )) )
|
||||||
|
// return 1;
|
||||||
|
//
|
||||||
|
// // Draw Weapon Menu
|
||||||
|
// DrawWList(flTime);
|
||||||
|
//
|
||||||
|
// // Draw ammo pickup history
|
||||||
|
// gHR.DrawAmmoHistory( flTime );
|
||||||
|
//
|
||||||
|
// if (!(m_iFlags & HUD_ACTIVE))
|
||||||
|
// return 0;
|
||||||
|
//
|
||||||
|
// if (!m_pWeapon)
|
||||||
|
// return 0;
|
||||||
|
//
|
||||||
|
// WEAPON *pw = m_pWeapon; // shorthand
|
||||||
|
//
|
||||||
|
// // SPR_Draw Ammo
|
||||||
|
// if ((pw->iAmmoType < 0) && (pw->iAmmo2Type < 0))
|
||||||
|
// return 0;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// int iFlags = DHN_DRAWZERO; // draw 0 values
|
||||||
|
//
|
||||||
|
// AmmoWidth = gHUD.GetSpriteRect(gHUD.m_HUD_number_0).right - gHUD.GetSpriteRect(gHUD.m_HUD_number_0).left;
|
||||||
|
//
|
||||||
|
// a = (int) max( MIN_ALPHA, m_fFade );
|
||||||
|
//
|
||||||
|
// if (m_fFade > 0)
|
||||||
|
// m_fFade -= (gHUD.m_flTimeDelta * 20);
|
||||||
|
//
|
||||||
|
// gHUD.GetPrimaryHudColor(r, g, b);
|
||||||
|
//
|
||||||
|
// ScaleColors(r, g, b, a );
|
||||||
|
//
|
||||||
|
// int theViewport[4];
|
||||||
|
// gHUD.GetViewport(theViewport);
|
||||||
|
//
|
||||||
|
// // Does this weapon have a clip?
|
||||||
|
// y = theViewport[1] + theViewport[3] - gHUD.m_iFontHeight - gHUD.m_iFontHeight/2;
|
||||||
|
//
|
||||||
|
// // Does weapon have any ammo at all?
|
||||||
|
// if (m_pWeapon->iAmmoType > 0)
|
||||||
|
// {
|
||||||
|
// int iIconWidth = m_pWeapon->rcAmmo.right - m_pWeapon->rcAmmo.left;
|
||||||
|
//
|
||||||
|
// if (pw->iClip >= 0)
|
||||||
|
// {
|
||||||
|
// // room for the number and the '|' and the current ammo
|
||||||
|
//
|
||||||
|
// x = theViewport[0] + theViewport[2] - (8 * AmmoWidth) - iIconWidth;
|
||||||
|
// x = gHUD.DrawHudNumber(x, y, iFlags | DHN_3DIGITS, pw->iClip, r, g, b);
|
||||||
|
//
|
||||||
|
// wrect_t rc;
|
||||||
|
// rc.top = 0;
|
||||||
|
// rc.left = 0;
|
||||||
|
// rc.right = AmmoWidth;
|
||||||
|
// rc.bottom = 100;
|
||||||
|
//
|
||||||
|
// int iBarWidth = AmmoWidth/10;
|
||||||
|
//
|
||||||
|
// x += AmmoWidth/2;
|
||||||
|
//
|
||||||
|
// gHUD.GetPrimaryHudColor(r, g, b);
|
||||||
|
//
|
||||||
|
// // draw the | bar
|
||||||
|
// FillRGBA(x, y, iBarWidth, gHUD.m_iFontHeight, r, g, b, a);
|
||||||
|
//
|
||||||
|
// x += iBarWidth + AmmoWidth/2;;
|
||||||
|
//
|
||||||
|
// // GL Seems to need this
|
||||||
|
// ScaleColors(r, g, b, a );
|
||||||
|
// x = gHUD.DrawHudNumber(x, y, iFlags | DHN_3DIGITS, gWR.CountAmmo(pw->iAmmoType), r, g, b);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// // SPR_Draw a bullets only line
|
||||||
|
// x = theViewport[0] + theViewport[2] - 4 * AmmoWidth - iIconWidth;
|
||||||
|
// x = gHUD.DrawHudNumber(x, y, iFlags | DHN_3DIGITS, gWR.CountAmmo(pw->iAmmoType), r, g, b);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // Draw the ammo Icon
|
||||||
|
// int iOffset = (m_pWeapon->rcAmmo.bottom - m_pWeapon->rcAmmo.top)/8;
|
||||||
|
// SPR_Set(m_pWeapon->hAmmo, r, g, b);
|
||||||
|
// SPR_DrawAdditive(0, x, y - iOffset, &m_pWeapon->rcAmmo);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // Does weapon have seconday ammo?
|
||||||
|
// if (pw->iAmmo2Type > 0)
|
||||||
|
// {
|
||||||
|
// int iIconWidth = m_pWeapon->rcAmmo2.right - m_pWeapon->rcAmmo2.left;
|
||||||
|
//
|
||||||
|
// // Do we have secondary ammo?
|
||||||
|
// if ((pw->iAmmo2Type != 0) && (gWR.CountAmmo(pw->iAmmo2Type) > 0))
|
||||||
|
// {
|
||||||
|
// y -= gHUD.m_iFontHeight + gHUD.m_iFontHeight/4;
|
||||||
|
// x = theViewport[0] + theViewport[2] - 4 * AmmoWidth - iIconWidth;
|
||||||
|
// x = gHUD.DrawHudNumber(x, y, iFlags|DHN_3DIGITS, gWR.CountAmmo(pw->iAmmo2Type), r, g, b);
|
||||||
|
//
|
||||||
|
// // Draw the ammo Icon
|
||||||
|
// SPR_Set(m_pWeapon->hAmmo2, r, g, b);
|
||||||
|
// int iOffset = (m_pWeapon->rcAmmo2.bottom - m_pWeapon->rcAmmo2.top)/8;
|
||||||
|
// SPR_DrawAdditive(0, x, y - iOffset, &m_pWeapon->rcAmmo2);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return 1;
|
||||||
|
//}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// Drawing code
|
// Drawing code
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
|
@ -1137,9 +1354,21 @@ int CHudAmmo::Draw(float flTime)
|
||||||
|
|
||||||
int iFlags = DHN_DRAWZERO; // draw 0 values
|
int iFlags = DHN_DRAWZERO; // draw 0 values
|
||||||
|
|
||||||
AmmoWidth = gHUD.GetSpriteRect(gHUD.m_HUD_number_0).right - gHUD.GetSpriteRect(gHUD.m_HUD_number_0).left;
|
float ammoScale = 1.0f;
|
||||||
|
if (hud_ammo_scale)
|
||||||
|
{
|
||||||
|
ammoScale = min(max(0.01f, hud_ammo_scale->value), 5.0f);
|
||||||
|
}
|
||||||
|
|
||||||
a = (int) max( MIN_ALPHA, m_fFade );
|
AmmoWidth = (gHUD.GetSpriteRect(gHUD.m_HUD_number_0).right - gHUD.GetSpriteRect(gHUD.m_HUD_number_0).left) * ammoScale;
|
||||||
|
|
||||||
|
int minAlpha;
|
||||||
|
if (hud_ammo_alphamin)
|
||||||
|
minAlpha = max(0, min(hud_ammo_alphamin->value, 255));
|
||||||
|
else
|
||||||
|
minAlpha = MIN_ALPHA;
|
||||||
|
|
||||||
|
a = (int)max(minAlpha, m_fFade);
|
||||||
|
|
||||||
if (m_fFade > 0)
|
if (m_fFade > 0)
|
||||||
m_fFade -= (gHUD.m_flTimeDelta * 20);
|
m_fFade -= (gHUD.m_flTimeDelta * 20);
|
||||||
|
@ -1148,58 +1377,63 @@ int CHudAmmo::Draw(float flTime)
|
||||||
|
|
||||||
ScaleColors(r, g, b, a );
|
ScaleColors(r, g, b, a );
|
||||||
|
|
||||||
int theViewport[4];
|
|
||||||
gHUD.GetViewport(theViewport);
|
|
||||||
|
|
||||||
// Does this weapon have a clip?
|
// Does this weapon have a clip?
|
||||||
y = theViewport[1] + theViewport[3] - gHUD.m_iFontHeight - gHUD.m_iFontHeight/2;
|
int initialY = gHUD.GetHeight();
|
||||||
|
if (hud_ammo_y && hud_ammo_y->value != 0.0f)
|
||||||
|
{
|
||||||
|
initialY *= min(max(0.0f, hud_ammo_y->value), 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
y = initialY - gHUD.m_iFontHeight / 2;
|
||||||
|
|
||||||
// Does weapon have any ammo at all?
|
// Does weapon have any ammo at all?
|
||||||
if (m_pWeapon->iAmmoType > 0)
|
if (m_pWeapon->iAmmoType > 0)
|
||||||
{
|
{
|
||||||
int iIconWidth = m_pWeapon->rcAmmo.right - m_pWeapon->rcAmmo.left;
|
int iIconWidth = (m_pWeapon->rcAmmo.right - m_pWeapon->rcAmmo.left) * ammoScale;
|
||||||
|
|
||||||
if (pw->iClip >= 0)
|
if (pw->iClip >= 0)
|
||||||
{
|
{
|
||||||
// room for the number and the '|' and the current ammo
|
// room for the number and the '|' and the current ammo
|
||||||
|
|
||||||
x = theViewport[0] + theViewport[2] - (8 * AmmoWidth) - iIconWidth;
|
int initialX = gHUD.GetWidth();
|
||||||
x = gHUD.DrawHudNumber(x, y, iFlags | DHN_3DIGITS, pw->iClip, r, g, b);
|
if (hud_ammo_x && hud_ammo_x->value != 0.0f)
|
||||||
|
{
|
||||||
|
//TODO: Inset position for ultrawide monitors.
|
||||||
|
//if (gHUD.GetWidth() > (gHUD.GetHeight() * 1.78f)){}
|
||||||
|
|
||||||
wrect_t rc;
|
initialX *= min(max(0.0f, hud_ammo_x->value), 1.0f);
|
||||||
rc.top = 0;
|
}
|
||||||
rc.left = 0;
|
|
||||||
rc.right = AmmoWidth;
|
x = initialX - (8 * AmmoWidth) - iIconWidth;
|
||||||
rc.bottom = 100;
|
|
||||||
|
x = gHUD.DrawHudNumber(x, y, iFlags | DHN_3DIGITS, pw->iClip, r, g, b, 255, ammoScale, CHud::a_southwest);
|
||||||
|
|
||||||
int iBarWidth = AmmoWidth/10;
|
int iBarWidth = AmmoWidth/10;
|
||||||
|
int iBarHeight = gHUD.m_iFontHeight * -1;
|
||||||
|
|
||||||
x += AmmoWidth/2;
|
x += AmmoWidth/2;
|
||||||
|
|
||||||
gHUD.GetPrimaryHudColor(r, g, b);
|
gHUD.GetPrimaryHudColor(r, g, b);
|
||||||
|
|
||||||
// draw the | bar
|
// draw the | bar
|
||||||
FillRGBA(x, y, iBarWidth, gHUD.m_iFontHeight, r, g, b, a);
|
gHUD.DrawHudFill(x, y, iBarWidth, iBarHeight, r, g, b, a, ammoScale);
|
||||||
|
|
||||||
x += iBarWidth + AmmoWidth/2;;
|
x += iBarWidth + AmmoWidth/2;
|
||||||
|
|
||||||
// GL Seems to need this
|
// GL Seems to need this
|
||||||
ScaleColors(r, g, b, a );
|
ScaleColors(r, g, b, a );
|
||||||
x = gHUD.DrawHudNumber(x, y, iFlags | DHN_3DIGITS, gWR.CountAmmo(pw->iAmmoType), r, g, b);
|
x = gHUD.DrawHudNumber(x, y, iFlags | DHN_3DIGITS, gWR.CountAmmo(pw->iAmmoType), r, g, b, 255, ammoScale, CHud::a_southwest);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// SPR_Draw a bullets only line
|
// SPR_Draw a bullets only line
|
||||||
x = theViewport[0] + theViewport[2] - 4 * AmmoWidth - iIconWidth;
|
x = gHUD.GetWidth() - 4 * AmmoWidth - iIconWidth;
|
||||||
x = gHUD.DrawHudNumber(x, y, iFlags | DHN_3DIGITS, gWR.CountAmmo(pw->iAmmoType), r, g, b);
|
x = gHUD.DrawHudNumber(x, y, iFlags | DHN_3DIGITS, gWR.CountAmmo(pw->iAmmoType), r, g, b, 255, ammoScale, CHud::a_southwest);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the ammo Icon
|
// Draw the ammo Icon
|
||||||
int iOffset = (m_pWeapon->rcAmmo.bottom - m_pWeapon->rcAmmo.top)/8;
|
gHUD.DrawHudSprite(m_pWeapon->hAmmo, 0, &m_pWeapon->rcAmmo, x, y, r, g, b, 255, ammoScale, CHud::a_southwest);
|
||||||
SPR_Set(m_pWeapon->hAmmo, r, g, b);
|
|
||||||
SPR_DrawAdditive(0, x, y - iOffset, &m_pWeapon->rcAmmo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Does weapon have seconday ammo?
|
// Does weapon have seconday ammo?
|
||||||
|
@ -1211,13 +1445,11 @@ int CHudAmmo::Draw(float flTime)
|
||||||
if ((pw->iAmmo2Type != 0) && (gWR.CountAmmo(pw->iAmmo2Type) > 0))
|
if ((pw->iAmmo2Type != 0) && (gWR.CountAmmo(pw->iAmmo2Type) > 0))
|
||||||
{
|
{
|
||||||
y -= gHUD.m_iFontHeight + gHUD.m_iFontHeight/4;
|
y -= gHUD.m_iFontHeight + gHUD.m_iFontHeight/4;
|
||||||
x = theViewport[0] + theViewport[2] - 4 * AmmoWidth - iIconWidth;
|
x = gHUD.GetWidth() - 4 * AmmoWidth - iIconWidth;
|
||||||
x = gHUD.DrawHudNumber(x, y, iFlags|DHN_3DIGITS, gWR.CountAmmo(pw->iAmmo2Type), r, g, b);
|
x = gHUD.DrawHudNumber(x, y, iFlags|DHN_3DIGITS, gWR.CountAmmo(pw->iAmmo2Type), r, g, b, 255, ammoScale, CHud::a_southwest);
|
||||||
|
|
||||||
// Draw the ammo Icon
|
// Draw the ammo Icon
|
||||||
SPR_Set(m_pWeapon->hAmmo2, r, g, b);
|
gHUD.DrawHudSprite(m_pWeapon->hAmmo2, 0, &m_pWeapon->rcAmmo2, x, y, r, b, g, 255, ammoScale, CHud::a_southwest);
|
||||||
int iOffset = (m_pWeapon->rcAmmo2.bottom - m_pWeapon->rcAmmo2.top)/8;
|
|
||||||
SPR_DrawAdditive(0, x, y - iOffset, &m_pWeapon->rcAmmo2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -70,8 +70,9 @@ int CHudAmmoSecondary :: Draw(float flTime)
|
||||||
x -= (gHUD.GetSpriteRect(m_HUD_ammoicon).right - gHUD.GetSpriteRect(m_HUD_ammoicon).left);
|
x -= (gHUD.GetSpriteRect(m_HUD_ammoicon).right - gHUD.GetSpriteRect(m_HUD_ammoicon).left);
|
||||||
y -= (gHUD.GetSpriteRect(m_HUD_ammoicon).top - gHUD.GetSpriteRect(m_HUD_ammoicon).bottom);
|
y -= (gHUD.GetSpriteRect(m_HUD_ammoicon).top - gHUD.GetSpriteRect(m_HUD_ammoicon).bottom);
|
||||||
|
|
||||||
SPR_Set( gHUD.GetSprite(m_HUD_ammoicon), r, g, b );
|
//SPR_Set( gHUD.GetSprite(m_HUD_ammoicon), r, g, b );
|
||||||
SPR_DrawAdditive( 0, x, y, &gHUD.GetSpriteRect(m_HUD_ammoicon) );
|
//SPR_DrawAdditive( 0, x, y, &gHUD.GetSpriteRect(m_HUD_ammoicon) );
|
||||||
|
gHUD.DrawHudSpriteIndex(m_HUD_ammoicon, x, y, r , g, b);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // move the cursor by the '0' char instead, since we don't have an icon to work with
|
{ // move the cursor by the '0' char instead, since we don't have an icon to work with
|
||||||
|
@ -96,7 +97,8 @@ int CHudAmmoSecondary :: Draw(float flTime)
|
||||||
{
|
{
|
||||||
// draw the divider bar
|
// draw the divider bar
|
||||||
x -= (AmmoWidth / 2);
|
x -= (AmmoWidth / 2);
|
||||||
FillRGBA(x, y, (AmmoWidth/10), gHUD.m_iFontHeight, r, g, b, a);
|
//FillRGBA(x, y, (AmmoWidth/10), gHUD.m_iFontHeight, r, g, b, a);
|
||||||
|
gHUD.DrawHudFill(x, y, (AmmoWidth / 10), gHUD.m_iFontHeight, r, g ,b , MIN_ALPHA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,16 +67,21 @@ public:
|
||||||
void SetValidWeapon( void );
|
void SetValidWeapon( void );
|
||||||
void SetCurrentWeapon( WEAPON* wp );
|
void SetCurrentWeapon( WEAPON* wp );
|
||||||
void SelectSlot( int iSlot, int fAdvance, int iDirection );
|
void SelectSlot( int iSlot, int fAdvance, int iDirection );
|
||||||
|
void SetWeaponConfig(WEAPON* weapon, int specXhair = 0);
|
||||||
|
|
||||||
friend CHudAmmo; //for iOldWeaponBits access
|
friend CHudAmmo; //for iOldWeaponBits access
|
||||||
private:
|
private:
|
||||||
WEAPON rgWeapons[MAX_WEAPONS]; // current weapon state
|
WEAPON rgWeapons[MAX_WEAPONS]; // current weapon state
|
||||||
WEAPON* rgSlots[MAX_WEAPON_SLOTS][MAX_WEAPON_POSITIONS]; // current weapon slot map
|
WEAPON* rgSlots[MAX_WEAPON_SLOTS][MAX_WEAPON_POSITIONS]; // current weapon slot map
|
||||||
WEAPON* lastWeapon; // client-side lastinv
|
WEAPON* lastWeapon; // client-side lastinv
|
||||||
|
WEAPON* healSprayLastWeapon;
|
||||||
|
bool healSprayAttack2Active;
|
||||||
|
|
||||||
int riAmmo[MAX_AMMO_TYPES]; // current ammo counts
|
int riAmmo[MAX_AMMO_TYPES]; // current ammo counts
|
||||||
int iOldWeaponBits;
|
int iOldWeaponBits;
|
||||||
int lastWeaponId;
|
int crossLastWeapId;
|
||||||
|
int lastSpecXhair;
|
||||||
|
int lastPlayMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern WeaponsResource gWR;
|
extern WeaponsResource gWR;
|
||||||
|
|
|
@ -95,7 +95,7 @@ int CHudBattery::Draw(float flTime)
|
||||||
|
|
||||||
if (!(gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT)) ))
|
if (!(gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT)) ))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
// Has health changed? Flash the health #
|
// Has health changed? Flash the health #
|
||||||
if (m_fFade)
|
if (m_fFade)
|
||||||
{
|
{
|
||||||
|
@ -105,23 +105,23 @@ int CHudBattery::Draw(float flTime)
|
||||||
m_fFade -= (gHUD.m_flTimeDelta * 20);
|
m_fFade -= (gHUD.m_flTimeDelta * 20);
|
||||||
if (m_fFade <= 0)
|
if (m_fFade <= 0)
|
||||||
{
|
{
|
||||||
a = 128;
|
//a = 128;
|
||||||
m_fFade = 0;
|
m_fFade = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fade the health number back to dim
|
// Fade the health number back to dim
|
||||||
|
|
||||||
a = MIN_ALPHA + (m_fFade/FADE_TIME) * 128;
|
a = gHUD.m_Health.m_iMinAlpha + (m_fFade/FADE_TIME) * 128;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
a = MIN_ALPHA;
|
a = gHUD.m_Health.m_iMinAlpha;
|
||||||
|
|
||||||
ScaleColors(r, g, b, a );
|
ScaleColors(r, g, b, a );
|
||||||
|
|
||||||
int iOffset = (m_prc1->bottom - m_prc1->top)/6;
|
//int iOffset = (m_prc1->bottom - m_prc1->top)/6;
|
||||||
|
|
||||||
int theInset = 0;
|
//int theInset = 0;
|
||||||
//if(gHUD.GetIsAlien())
|
//if(gHUD.GetIsAlien())
|
||||||
//{
|
//{
|
||||||
// theInset = ScreenWidth()*kResourceEnergyBarWidth;
|
// theInset = ScreenWidth()*kResourceEnergyBarWidth;
|
||||||
|
@ -130,8 +130,11 @@ int CHudBattery::Draw(float flTime)
|
||||||
int theViewport[4];
|
int theViewport[4];
|
||||||
gHUD.GetViewport(theViewport);
|
gHUD.GetViewport(theViewport);
|
||||||
|
|
||||||
y = theViewport[1] + theViewport[3] - gHUD.m_iFontHeight - gHUD.m_iFontHeight / 2;
|
//y = theViewport[1] + theViewport[3] - gHUD.m_iFontHeight - gHUD.m_iFontHeight / 2;
|
||||||
x = theViewport[0] + theInset + kArmorLeftInset*ScreenWidth();
|
//x = theViewport[0] + theInset + kArmorLeftInset*ScreenWidth();
|
||||||
|
//y = m_iAnchorY - gHUD.m_iFontHeight - gHUD.m_iFontHeight / 2;
|
||||||
|
y = m_iAnchorY - gHUD.m_iFontHeight / 2;
|
||||||
|
x = m_iAnchorX;
|
||||||
|
|
||||||
// make sure we have the right sprite handles
|
// make sure we have the right sprite handles
|
||||||
if ( !m_hSprite1 )
|
if ( !m_hSprite1 )
|
||||||
|
@ -139,18 +142,102 @@ int CHudBattery::Draw(float flTime)
|
||||||
if ( !m_hSprite2 )
|
if ( !m_hSprite2 )
|
||||||
m_hSprite2 = gHUD.GetSprite( gHUD.GetSpriteIndex( "suit_full" ) );
|
m_hSprite2 = gHUD.GetSprite( gHUD.GetSpriteIndex( "suit_full" ) );
|
||||||
|
|
||||||
SPR_Set(m_hSprite1, r, g, b );
|
//SPR_Set(m_hSprite1, r, g, b );
|
||||||
SPR_DrawAdditive( 0, x, y - iOffset, m_prc1);
|
//SPR_DrawAdditive( 0, x, y - iOffset, m_prc1);
|
||||||
|
gHUD.DrawHudSprite(m_hSprite1, 0, m_prc1, x, y, r, g, b, a, gHUD.m_Health.m_fHealthScale, CHud::a_southwest);
|
||||||
|
|
||||||
if (rc.bottom > rc.top)
|
if (rc.bottom > rc.top)
|
||||||
{
|
{
|
||||||
SPR_Set(m_hSprite2, r, g, b );
|
//SPR_Set(m_hSprite2, r, g, b );
|
||||||
SPR_DrawAdditive( 0, x, y - iOffset + (rc.top - m_prc2->top), &rc);
|
//SPR_DrawAdditive( 0, x, y - iOffset + (rc.top - m_prc2->top), &rc);
|
||||||
|
gHUD.DrawHudSprite(m_hSprite2, 0, &rc, x, y, r, g, b, a, gHUD.m_Health.m_fHealthScale, CHud::a_southwest);
|
||||||
}
|
}
|
||||||
|
|
||||||
x += (m_prc1->right - m_prc1->left);
|
x += (m_prc1->right - m_prc1->left) * gHUD.m_Health.m_fHealthScale;
|
||||||
x = gHUD.DrawHudNumber(x, y, DHN_3DIGITS | DHN_DRAWZERO, m_iBat, r, g, b);
|
x += ((gHUD.GetSpriteRect(gHUD.m_HUD_number_0).right - gHUD.GetSpriteRect(gHUD.m_HUD_number_0).left) / 2) * gHUD.m_Health.m_fHealthScale;
|
||||||
|
x = gHUD.DrawHudNumber(x, y, DHN_3DIGITS | DHN_DRAWZERO, m_iBat, r, g, b, 255, gHUD.m_Health.m_fHealthScale, CHud::a_southwest);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//// Old HUD drawing.
|
||||||
|
//int CHudBattery::Draw(float flTime)
|
||||||
|
//{
|
||||||
|
//
|
||||||
|
// if (gHUD.m_iHideHUDDisplay & HIDEHUD_HEALTH)
|
||||||
|
// return 1;
|
||||||
|
//
|
||||||
|
// int r, g, b, x, y, a;
|
||||||
|
// wrect_t rc;
|
||||||
|
//
|
||||||
|
// rc = *m_prc2;
|
||||||
|
//
|
||||||
|
// int theMaxArmor = gHUD.GetHUDMaxArmor();
|
||||||
|
// float theScalar = 1.0f / theMaxArmor;
|
||||||
|
//
|
||||||
|
// rc.top += m_iHeight * ((float)(theMaxArmor - (min(theMaxArmor, m_iBat))) * theScalar); // battery can go from 0 to 100 so * 0.01 goes from 0 to 1
|
||||||
|
//
|
||||||
|
// gHUD.GetPrimaryHudColor(r, g, b);
|
||||||
|
//
|
||||||
|
// if (!(gHUD.m_iWeaponBits & (1 << (WEAPON_SUIT))))
|
||||||
|
// return 1;
|
||||||
|
//
|
||||||
|
// // Has health changed? Flash the health #
|
||||||
|
// if (m_fFade)
|
||||||
|
// {
|
||||||
|
// if (m_fFade > FADE_TIME)
|
||||||
|
// m_fFade = FADE_TIME;
|
||||||
|
//
|
||||||
|
// m_fFade -= (gHUD.m_flTimeDelta * 20);
|
||||||
|
// if (m_fFade <= 0)
|
||||||
|
// {
|
||||||
|
// a = 128;
|
||||||
|
// m_fFade = 0;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // Fade the health number back to dim
|
||||||
|
//
|
||||||
|
// a = MIN_ALPHA + (m_fFade / FADE_TIME) * 128;
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// a = MIN_ALPHA;
|
||||||
|
//
|
||||||
|
// ScaleColors(r, g, b, a);
|
||||||
|
//
|
||||||
|
// int iOffset = (m_prc1->bottom - m_prc1->top) / 6;
|
||||||
|
//
|
||||||
|
// int theInset = 0;
|
||||||
|
// //if(gHUD.GetIsAlien())
|
||||||
|
// //{
|
||||||
|
// // theInset = ScreenWidth()*kResourceEnergyBarWidth;
|
||||||
|
// //}
|
||||||
|
//
|
||||||
|
// int theViewport[4];
|
||||||
|
// gHUD.GetViewport(theViewport);
|
||||||
|
//
|
||||||
|
// y = theViewport[1] + theViewport[3] - gHUD.m_iFontHeight - gHUD.m_iFontHeight / 2;
|
||||||
|
// x = theViewport[0] + theInset + kArmorLeftInset * ScreenWidth();
|
||||||
|
//
|
||||||
|
// // make sure we have the right sprite handles
|
||||||
|
// if (!m_hSprite1)
|
||||||
|
// m_hSprite1 = gHUD.GetSprite(gHUD.GetSpriteIndex("suit_empty"));
|
||||||
|
// if (!m_hSprite2)
|
||||||
|
// m_hSprite2 = gHUD.GetSprite(gHUD.GetSpriteIndex("suit_full"));
|
||||||
|
//
|
||||||
|
// SPR_Set(m_hSprite1, r, g, b);
|
||||||
|
// SPR_DrawAdditive(0, x, y - iOffset, m_prc1);
|
||||||
|
//
|
||||||
|
// if (rc.bottom > rc.top)
|
||||||
|
// {
|
||||||
|
// SPR_Set(m_hSprite2, r, g, b);
|
||||||
|
// SPR_DrawAdditive(0, x, y - iOffset + (rc.top - m_prc2->top), &rc);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// x += (m_prc1->right - m_prc1->left);
|
||||||
|
// x = gHUD.DrawHudNumber(x, y, DHN_3DIGITS | DHN_DRAWZERO, m_iBat, r, g, b);
|
||||||
|
//
|
||||||
|
// return 1;
|
||||||
|
//
|
||||||
|
//}
|
|
@ -69,6 +69,8 @@ TeamFortressViewport *gViewPort = NULL;
|
||||||
HINTERFACEMODULE g_hTrackerModule = NULL;
|
HINTERFACEMODULE g_hTrackerModule = NULL;
|
||||||
//ITrackerUser *g_pTrackerUser = NULL;
|
//ITrackerUser *g_pTrackerUser = NULL;
|
||||||
|
|
||||||
|
CPostProcessShader g_PostProcessShader;
|
||||||
|
|
||||||
void InitInput (void);
|
void InitInput (void);
|
||||||
void EV_HookEvents( void );
|
void EV_HookEvents( void );
|
||||||
void IN_Commands( void );
|
void IN_Commands( void );
|
||||||
|
@ -216,6 +218,8 @@ void CL_DLLEXPORT HUD_Init( void )
|
||||||
InitInput();
|
InitInput();
|
||||||
gHUD.Init();
|
gHUD.Init();
|
||||||
Scheme_Init();
|
Scheme_Init();
|
||||||
|
g_PostProcessShader.Init();
|
||||||
|
//gEngfuncs.Con_Printf("waterrenderer init %d", success);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -261,6 +265,8 @@ HUD_Redraw
|
||||||
|
|
||||||
int CL_DLLEXPORT HUD_Redraw( float time, int intermission )
|
int CL_DLLEXPORT HUD_Redraw( float time, int intermission )
|
||||||
{
|
{
|
||||||
|
g_PostProcessShader.DrawShader();
|
||||||
|
|
||||||
// RecClHudRedraw(time, intermission);
|
// RecClHudRedraw(time, intermission);
|
||||||
|
|
||||||
gHUD.Redraw( time, intermission );
|
gHUD.Redraw( time, intermission );
|
||||||
|
|
|
@ -19,12 +19,20 @@ private:
|
||||||
float m_flMouseSensitivity;
|
float m_flMouseSensitivity;
|
||||||
bool wstoggle;
|
bool wstoggle;
|
||||||
|
|
||||||
|
float m_flScaleX;
|
||||||
|
float m_flScaleY;
|
||||||
|
unsigned int m_iConWidth;
|
||||||
|
unsigned int m_iConHeight;
|
||||||
|
float m_flOffsetX;
|
||||||
|
float m_flOffsetY;
|
||||||
|
bool m_bIsWidescreen;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
AVHHSPRITE m_hsprCursor;
|
AVHHSPRITE m_hsprCursor;
|
||||||
float m_flTime; // the current client time
|
float m_flTime; // the current client time
|
||||||
float m_fOldTime; // the time at which the HUD was last redrawn
|
float m_fOldTime; // the time at which the HUD was last redrawn
|
||||||
float m_wsFOV; //fov recalc corrected for widescreen
|
//float m_wsFOV; //fov recalc corrected for widescreen
|
||||||
double m_flTimeDelta; // the difference between flTime and fOldTime
|
double m_flTimeDelta; // the difference between flTime and fOldTime
|
||||||
Vector m_vecOrigin;
|
Vector m_vecOrigin;
|
||||||
Vector m_vecAngles;
|
Vector m_vecAngles;
|
||||||
|
@ -34,17 +42,89 @@ public:
|
||||||
int m_iRes;
|
int m_iRes;
|
||||||
cvar_t *m_pCvarStealMouse;
|
cvar_t *m_pCvarStealMouse;
|
||||||
cvar_t *m_pCvarDraw;
|
cvar_t *m_pCvarDraw;
|
||||||
|
bool m_bWindowed;
|
||||||
|
cvar_t* m_pCvarWidescreen;
|
||||||
|
|
||||||
int m_iFontHeight;
|
int m_iFontHeight;
|
||||||
int DrawHudNumber(int x, int y, int iFlags, int iNumber, int r, int g, int b );
|
//int DrawHudNumber(int x, int y, int iFlags, int iNumber, int r, int g, int b );
|
||||||
int DrawHudStringCentered(int x, int y, int iMaxX, const char *szString, int r, int g, int b );
|
int DrawHudStringCentered(int x, int y, int iMaxX, const char *szString, int r, int g, int b );
|
||||||
int DrawHudString(int x, int y, int iMaxX, const char *szString, int r, int g, int b );
|
int DrawHudString(int x, int y, int iMaxX, const char *szString, int r, int g, int b );
|
||||||
int GetHudStringHeight();
|
int GetHudStringHeight();
|
||||||
int GetHudStringWidth(const char* szIt);
|
int GetHudStringWidth(const char* szIt);
|
||||||
int DrawHudStringReverse( int xpos, int ypos, int iMinX, char *szString, int r, int g, int b );
|
int DrawHudStringReverse( int xpos, int ypos, int iMinX, char *szString, int r, int g, int b );
|
||||||
int DrawHudNumberString( int xpos, int ypos, int iMinX, int iNumber, int r, int g, int b );
|
//int DrawHudNumberString( int xpos, int ypos, int iMinX, int iNumber, int r, int g, int b );
|
||||||
int GetNumWidth(int iNumber, int iFlags);
|
int GetNumWidth(int iNumber, int iFlags);
|
||||||
|
|
||||||
|
// New stuff
|
||||||
|
typedef enum {
|
||||||
|
COLOR_DEFAULT = 0,
|
||||||
|
COLOR_PRIMARY,
|
||||||
|
COLOR_SECONDARY,
|
||||||
|
COLOR_WARNING,
|
||||||
|
COLOR_COUNT
|
||||||
|
} hudcolor_e;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
a_northwest = 0,
|
||||||
|
a_north,
|
||||||
|
a_northeast,
|
||||||
|
a_west,
|
||||||
|
a_center,
|
||||||
|
a_east,
|
||||||
|
a_southwest,
|
||||||
|
a_south,
|
||||||
|
a_southeast,
|
||||||
|
} hudalign_e;
|
||||||
|
|
||||||
|
void DrawHudSprite(AVHHSPRITE pic, int frame, wrect_t* rect, int x, int y, int r, int g, int b, int a = 255, float scale = 1.0f, hudalign_e alignment = a_northwest);
|
||||||
|
//void DrawHudSprite(AVHHSPRITE pic, int frame, wrect_t* rect, int x, int y, hudcolor_e color, int a = 255, hudalign_e alignment = a_northwest);
|
||||||
|
//void DrawHudSpriteIndex(int index, int x, int y, hudcolor_e color, int a = 255, hudalign_e alignment = a_northwest);
|
||||||
|
void DrawHudSpriteIndex(int index, int x, int y, int r, int g, int b, int a = 255, float scale = 1.0f, hudalign_e alignment = a_northwest);
|
||||||
|
void DrawHudFill(int x, int y, int w, int h, int r, int g, int b, int a, float scale = 1.0f);
|
||||||
|
//void DrawHudFill(int x, int y, int w, int h, hudcolor_e color, int a);
|
||||||
|
int DrawHudNumber(int x, int y, int iFlags, int iNumber, int r, int g, int b, int a = 255, float scale = 1.0f, hudalign_e alignment = a_northwest);
|
||||||
|
//int DrawHudNumber(int x, int y, int iFlags, int iNumber, hudcolor_e color, int a = 255, hudalign_e alignment = a_northwest);
|
||||||
|
|
||||||
|
//int DrawHudStringReverse(int xpos, int ypos, int iMinX, const char* szString, int r, int g, int b);
|
||||||
|
int DrawHudNumberString(int xpos, int ypos, int iMinX, int iNumber, int r, int g, int b);
|
||||||
|
|
||||||
|
int GetHudNumberWidth(int number, int width, int flags, float scale = 1.0f);
|
||||||
|
int DrawHudNumberReverse(int x, int y, int number, int flags, int r, int g, int b, int a = 255, float scale = 1.0f, hudalign_e alignment = a_northwest);
|
||||||
|
//int DrawHudNumberReverse(int x, int y, int number, int flags, hudcolor_e color, int a = 255, hudalign_e alignment = a_northwest);
|
||||||
|
|
||||||
|
//int DrawHudString(const char* string, int x, int y);
|
||||||
|
//void GetHudStringSize(const char* string, int& width, int& height);
|
||||||
|
//int HudStringLen(const char* string);
|
||||||
|
|
||||||
|
//void GetChatInputPosition(int& x, int& y);
|
||||||
|
|
||||||
|
inline unsigned int GetWidth() const
|
||||||
|
{
|
||||||
|
return m_iConWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline unsigned int GetHeight() const
|
||||||
|
{
|
||||||
|
return m_iConHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline float GetScaleX() const
|
||||||
|
{
|
||||||
|
return m_flScaleX;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline float GetScaleY() const
|
||||||
|
{
|
||||||
|
return m_flScaleY;
|
||||||
|
}
|
||||||
|
|
||||||
|
//inline void GetColor(int& r, int& g, int& b, hudcolor_e color) const
|
||||||
|
//{
|
||||||
|
// r = m_cColors[color].r;
|
||||||
|
// g = m_cColors[color].g;
|
||||||
|
// b = m_cColors[color].b;
|
||||||
|
//}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// the memory for these arrays are allocated in the first call to CHud::VidInit(), when the hud.txt and associated sprites are loaded.
|
// the memory for these arrays are allocated in the first call to CHud::VidInit(), when the hud.txt and associated sprites are loaded.
|
||||||
// freed in ~CHud()
|
// freed in ~CHud()
|
||||||
|
|
|
@ -23,7 +23,8 @@
|
||||||
#define DHN_DRAWZERO 1
|
#define DHN_DRAWZERO 1
|
||||||
#define DHN_2DIGITS 2
|
#define DHN_2DIGITS 2
|
||||||
#define DHN_3DIGITS 4
|
#define DHN_3DIGITS 4
|
||||||
#define MIN_ALPHA 100
|
//#define MIN_ALPHA 100
|
||||||
|
#define MIN_ALPHA 128
|
||||||
|
|
||||||
#define HUDELEM_ACTIVE 1
|
#define HUDELEM_ACTIVE 1
|
||||||
|
|
||||||
|
@ -341,7 +342,10 @@ public:
|
||||||
int VidInit( void );
|
int VidInit( void );
|
||||||
int Draw(float flTime);
|
int Draw(float flTime);
|
||||||
int MsgFunc_Battery(const char *pszName, int iSize, void *pbuf );
|
int MsgFunc_Battery(const char *pszName, int iSize, void *pbuf );
|
||||||
|
|
||||||
|
int m_iAnchorX; // our x position, set by the health hud
|
||||||
|
int m_iAnchorY; // our y position, set by the health hud
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AVHHSPRITE m_hSprite1;
|
AVHHSPRITE m_hSprite1;
|
||||||
AVHHSPRITE m_hSprite2;
|
AVHHSPRITE m_hSprite2;
|
||||||
|
|
|
@ -95,8 +95,8 @@
|
||||||
<Optimization>Full</Optimization>
|
<Optimization>Full</Optimization>
|
||||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||||
<IntrinsicFunctions>false</IntrinsicFunctions>
|
<IntrinsicFunctions>false</IntrinsicFunctions>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)\particles;$(SolutionDir)\includes\lpng1251;$(SolutionDir)\includes\zlib-1.2.8;$(SolutionDir)\includes\fmod\inc;$(SolutionDir)\includes\vgui\include;../public;../common;../external;../pm_shared;../game_shared;../mod;../util;../ui;../engine;../cl_dll;../dlls</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)\particles;$(SolutionDir)\includes\lpng1251;$(SolutionDir)\includes\zlib-1.2.8;$(SolutionDir)\includes\fmod\inc;$(SolutionDir)\includes\vgui\include;$(SolutionDir)\includes\glew;../public;../common;../external;../pm_shared;../game_shared;../mod;../util;../ui;../engine;../cl_dll;../dlls</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;WIN32;_WINDOWS;AVH_CLIENT;USE_OLDAUTH;_X86_;AVH_PLAYTEST_BUILD;BALANCE_ENABLED;PLAYTEST_BUILD</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;WIN32;_WINDOWS;AVH_CLIENT;USE_OLDAUTH;_X86_;AVH_PLAYTEST_BUILD;BALANCE_ENABLED;PLAYTEST_BUILD;GLEW_STATIC</PreprocessorDefinitions>
|
||||||
<StringPooling>true</StringPooling>
|
<StringPooling>true</StringPooling>
|
||||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
<PrecompiledHeader>
|
<PrecompiledHeader>
|
||||||
|
@ -158,8 +158,8 @@
|
||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)\particles;$(SolutionDir)\includes\lpng1251;$(SolutionDir)\includes\zlib-1.2.8;$(SolutionDir)\includes\fmod\inc;$(SolutionDir)\includes\vgui\include;../public;../common;../external;../pm_shared;../game_shared;../mod;../util;../ui;../engine;../cl_dll;../dlls</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)\particles;$(SolutionDir)\includes\lpng1251;$(SolutionDir)\includes\zlib-1.2.8;$(SolutionDir)\includes\fmod\inc;$(SolutionDir)\includes\vgui\include;$(SolutionDir)\includes\glew;../public;../common;../external;../pm_shared;../game_shared;../mod;../util;../ui;../engine;../cl_dll;../dlls</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;WIN32;_WINDOWS;AVH_CLIENT;USE_OLDAUTH;_X86_</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;NDEBUG;WIN32;_WINDOWS;AVH_CLIENT;USE_OLDAUTH;_X86_;GLEW_STATIC</PreprocessorDefinitions>
|
||||||
<StringPooling>true</StringPooling>
|
<StringPooling>true</StringPooling>
|
||||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
<PrecompiledHeader>
|
<PrecompiledHeader>
|
||||||
|
@ -221,8 +221,8 @@
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
|
||||||
<IntrinsicFunctions>false</IntrinsicFunctions>
|
<IntrinsicFunctions>false</IntrinsicFunctions>
|
||||||
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)\particles;$(SolutionDir)\includes\lpng1251;$(SolutionDir)\includes\zlib-1.2.8;$(SolutionDir)\includes\fmod\inc;$(SolutionDir)\includes\vgui\include;../public;../common;../external;../pm_shared;../game_shared;../mod;../util;../ui;../engine;../cl_dll;../dlls</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)\particles;$(SolutionDir)\includes\lpng1251;$(SolutionDir)\includes\zlib-1.2.8;$(SolutionDir)\includes\fmod\inc;$(SolutionDir)\includes\vgui\include;$(SolutionDir)\includes\glew;../public;../common;../external;../pm_shared;../game_shared;../mod;../util;../ui;../engine;../cl_dll;../dlls</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_ITERATOR_DEBUG_LEVEL=2;_DEBUG;DEBUG;WIN32;_WINDOWS;AVH_CLIENT;USE_OLDAUTH;_X86_;AVH_PLAYTEST_BUILD;BALANCE_ENABLED;PLAYTEST_BUILD</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH;_ITERATOR_DEBUG_LEVEL=2;_DEBUG;DEBUG;WIN32;_WINDOWS;AVH_CLIENT;USE_OLDAUTH;_X86_;AVH_PLAYTEST_BUILD;BALANCE_ENABLED;PLAYTEST_BUILD;GLEW_STATIC</PreprocessorDefinitions>
|
||||||
<StringPooling>
|
<StringPooling>
|
||||||
</StringPooling>
|
</StringPooling>
|
||||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||||
|
@ -281,6 +281,22 @@
|
||||||
</ResourceCompile>
|
</ResourceCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\includes\glew\GL\glew.c">
|
||||||
|
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Playtest|Win32'">MaxSpeed</Optimization>
|
||||||
|
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Release|Win32'">MaxSpeed</Optimization>
|
||||||
|
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Debug|Win32'">MaxSpeed</Optimization>
|
||||||
|
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Client - Playtest|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Client - Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Client - Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\util\ShaderUtil.cpp">
|
||||||
|
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Playtest|Win32'">MaxSpeed</Optimization>
|
||||||
|
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Release|Win32'">MaxSpeed</Optimization>
|
||||||
|
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Debug|Win32'">MaxSpeed</Optimization>
|
||||||
|
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Client - Playtest|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Client - Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Client - Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="ammo.cpp">
|
<ClCompile Include="ammo.cpp">
|
||||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Playtest|Win32'">MaxSpeed</Optimization>
|
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Playtest|Win32'">MaxSpeed</Optimization>
|
||||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Release|Win32'">MaxSpeed</Optimization>
|
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Release|Win32'">MaxSpeed</Optimization>
|
||||||
|
@ -564,6 +580,14 @@
|
||||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Client - Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Client - Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Client - Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Client - Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="shader.cpp">
|
||||||
|
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Playtest|Win32'">MaxSpeed</Optimization>
|
||||||
|
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Release|Win32'">MaxSpeed</Optimization>
|
||||||
|
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Debug|Win32'">MaxSpeed</Optimization>
|
||||||
|
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Client - Playtest|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Client - Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Client - Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="status_icons.cpp">
|
<ClCompile Include="status_icons.cpp">
|
||||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Playtest|Win32'">MaxSpeed</Optimization>
|
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Playtest|Win32'">MaxSpeed</Optimization>
|
||||||
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Release|Win32'">MaxSpeed</Optimization>
|
<Optimization Condition="'$(Configuration)|$(Platform)'=='Client - Release|Win32'">MaxSpeed</Optimization>
|
||||||
|
@ -1615,7 +1639,6 @@
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\util\Balance.cpp" />
|
<ClCompile Include="..\util\Balance.cpp" />
|
||||||
<ClCompile Include="..\util\Checksum.cpp" />
|
<ClCompile Include="..\util\Checksum.cpp" />
|
||||||
<ClCompile Include="..\util\GammaTable.cpp" />
|
|
||||||
<ClCompile Include="..\util\LinuxSupport.cpp" />
|
<ClCompile Include="..\util\LinuxSupport.cpp" />
|
||||||
<ClCompile Include="..\util\Mat3.cpp" />
|
<ClCompile Include="..\util\Mat3.cpp" />
|
||||||
<ClCompile Include="..\util\MathUtil.cpp" />
|
<ClCompile Include="..\util\MathUtil.cpp" />
|
||||||
|
@ -1627,6 +1650,10 @@
|
||||||
<ClCompile Include="..\textrep\TRFactory.cpp" />
|
<ClCompile Include="..\textrep\TRFactory.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\includes\glew\GL\eglew.h" />
|
||||||
|
<ClInclude Include="..\includes\glew\GL\glew.h" />
|
||||||
|
<ClInclude Include="..\includes\glew\GL\glxew.h" />
|
||||||
|
<ClInclude Include="..\includes\glew\GL\wglew.h" />
|
||||||
<ClInclude Include="..\mod\AvHAlienAbilities.h" />
|
<ClInclude Include="..\mod\AvHAlienAbilities.h" />
|
||||||
<ClInclude Include="..\mod\AvHAlienWeaponConstants.h" />
|
<ClInclude Include="..\mod\AvHAlienWeaponConstants.h" />
|
||||||
<ClInclude Include="..\mod\AvHAlienWeapons.h" />
|
<ClInclude Include="..\mod\AvHAlienWeapons.h" />
|
||||||
|
@ -1634,6 +1661,7 @@
|
||||||
<ClInclude Include="..\mod\AvHMarineWeapon.h" />
|
<ClInclude Include="..\mod\AvHMarineWeapon.h" />
|
||||||
<ClInclude Include="..\mod\AvHMarineWeaponConstants.h" />
|
<ClInclude Include="..\mod\AvHMarineWeaponConstants.h" />
|
||||||
<ClInclude Include="..\mod\AvHMarineWeapons.h" />
|
<ClInclude Include="..\mod\AvHMarineWeapons.h" />
|
||||||
|
<ClInclude Include="..\util\ShaderUtil.h" />
|
||||||
<ClInclude Include="ammo.h" />
|
<ClInclude Include="ammo.h" />
|
||||||
<ClInclude Include="ammohistory.h" />
|
<ClInclude Include="ammohistory.h" />
|
||||||
<ClInclude Include="..\game_shared\bitvec.h" />
|
<ClInclude Include="..\game_shared\bitvec.h" />
|
||||||
|
@ -1763,7 +1791,6 @@
|
||||||
<ClInclude Include="..\util\Balance.h" />
|
<ClInclude Include="..\util\Balance.h" />
|
||||||
<ClInclude Include="..\util\Checksum.h" />
|
<ClInclude Include="..\util\Checksum.h" />
|
||||||
<ClInclude Include="..\util\CString.h" />
|
<ClInclude Include="..\util\CString.h" />
|
||||||
<ClInclude Include="..\util\GammaTable.h" />
|
|
||||||
<ClInclude Include="..\util\LinuxSupport.h" />
|
<ClInclude Include="..\util\LinuxSupport.h" />
|
||||||
<ClInclude Include="..\util\Mat3.h" />
|
<ClInclude Include="..\util\Mat3.h" />
|
||||||
<ClInclude Include="..\util\MathUtil.h" />
|
<ClInclude Include="..\util\MathUtil.h" />
|
||||||
|
|
|
@ -31,6 +31,9 @@
|
||||||
<Filter Include="textrep">
|
<Filter Include="textrep">
|
||||||
<UniqueIdentifier>{ad5bbb2c-1092-4ba3-ab5b-fdfa0a33f1f5}</UniqueIdentifier>
|
<UniqueIdentifier>{ad5bbb2c-1092-4ba3-ab5b-fdfa0a33f1f5}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="Source Files\glew">
|
||||||
|
<UniqueIdentifier>{57cad65d-80b8-4d06-abb5-8ff8dc1d60cc}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="ammo.cpp">
|
<ClCompile Include="ammo.cpp">
|
||||||
|
@ -552,9 +555,6 @@
|
||||||
<ClCompile Include="..\util\Checksum.cpp">
|
<ClCompile Include="..\util\Checksum.cpp">
|
||||||
<Filter>util</Filter>
|
<Filter>util</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\util\GammaTable.cpp">
|
|
||||||
<Filter>util</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\util\LinuxSupport.cpp">
|
<ClCompile Include="..\util\LinuxSupport.cpp">
|
||||||
<Filter>util</Filter>
|
<Filter>util</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -600,6 +600,15 @@
|
||||||
<ClCompile Include="hudgl.cpp">
|
<ClCompile Include="hudgl.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="shader.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\util\ShaderUtil.cpp">
|
||||||
|
<Filter>util</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\includes\glew\GL\glew.c">
|
||||||
|
<Filter>Source Files\glew</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\mod\AvHAlienAbilities.h">
|
<ClInclude Include="..\mod\AvHAlienAbilities.h">
|
||||||
|
@ -1004,9 +1013,6 @@
|
||||||
<ClInclude Include="..\util\CString.h">
|
<ClInclude Include="..\util\CString.h">
|
||||||
<Filter>util</Filter>
|
<Filter>util</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\util\GammaTable.h">
|
|
||||||
<Filter>util</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\util\LinuxSupport.h">
|
<ClInclude Include="..\util\LinuxSupport.h">
|
||||||
<Filter>util</Filter>
|
<Filter>util</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -1052,6 +1058,21 @@
|
||||||
<ClInclude Include="hudgl.h">
|
<ClInclude Include="hudgl.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\util\ShaderUtil.h">
|
||||||
|
<Filter>util</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\includes\glew\GL\glxew.h">
|
||||||
|
<Filter>Source Files\glew</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\includes\glew\GL\wglew.h">
|
||||||
|
<Filter>Source Files\glew</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\includes\glew\GL\eglew.h">
|
||||||
|
<Filter>Source Files\glew</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\includes\glew\GL\glew.h">
|
||||||
|
<Filter>Source Files\glew</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Library Include="..\lib\public\game_controls.lib" />
|
<Library Include="..\lib\public\game_controls.lib" />
|
||||||
|
|
|
@ -87,11 +87,12 @@ void HUD_SendWeaponAnim( int iAnim, int body, int force )
|
||||||
// Don't actually change it.
|
// Don't actually change it.
|
||||||
if ( !g_runfuncs && !force )
|
if ( !g_runfuncs && !force )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
g_currentanim = iAnim;
|
g_currentanim = iAnim;
|
||||||
|
|
||||||
// Tell animation system new info
|
// Tell animation system new info
|
||||||
gEngfuncs.pfnWeaponAnim( iAnim, body );
|
gEngfuncs.pfnWeaponAnim( iAnim, body );
|
||||||
|
//gEngfuncs.Con_Printf("forcing animation g_currentanim:%d new anim:%d\n", g_currentanim, iAnim);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,6 +108,11 @@ int HUD_GetWeaponAnim( void )
|
||||||
return g_currentanim;
|
return g_currentanim;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HUD_SetWeaponAnim(int anim)
|
||||||
|
{
|
||||||
|
g_currentanim = anim;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=====================
|
=====================
|
||||||
HUD_PlaySound
|
HUD_PlaySound
|
||||||
|
|
|
@ -28,6 +28,7 @@ float UTIL_SharedRandomFloat( unsigned int seed, float low, float high );
|
||||||
int UTIL_SharedRandomLong( unsigned int seed, int low, int high );
|
int UTIL_SharedRandomLong( unsigned int seed, int low, int high );
|
||||||
|
|
||||||
int HUD_GetWeaponAnim( void );
|
int HUD_GetWeaponAnim( void );
|
||||||
|
void HUD_SetWeaponAnim(int anim);
|
||||||
void HUD_SendWeaponAnim( int iAnim, int body, int force );
|
void HUD_SendWeaponAnim( int iAnim, int body, int force );
|
||||||
void HUD_PlaySound( char *sound, float volume );
|
void HUD_PlaySound( char *sound, float volume );
|
||||||
void HUD_PlaybackEvent( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
|
void HUD_PlaybackEvent( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "mod/AvHHudConstants.h"
|
#include "mod/AvHHudConstants.h"
|
||||||
#include "mod/AvHPlayerUpgrade.h"
|
#include "mod/AvHPlayerUpgrade.h"
|
||||||
#include "mod/AvHNetworkMessages.h"
|
#include "mod/AvHNetworkMessages.h"
|
||||||
|
#include "chudmisc.h"
|
||||||
|
|
||||||
DECLARE_MESSAGE(m_Health, Health )
|
DECLARE_MESSAGE(m_Health, Health )
|
||||||
DECLARE_MESSAGE(m_Health, Damage )
|
DECLARE_MESSAGE(m_Health, Damage )
|
||||||
|
@ -66,9 +67,14 @@ int CHudHealth::Init(void)
|
||||||
m_fAttackFront = m_fAttackRear = m_fAttackRight = m_fAttackLeft = 0;
|
m_fAttackFront = m_fAttackRear = m_fAttackRight = m_fAttackLeft = 0;
|
||||||
giDmgHeight = 0;
|
giDmgHeight = 0;
|
||||||
giDmgWidth = 0;
|
giDmgWidth = 0;
|
||||||
|
m_fHealthScale = 1.0f;
|
||||||
|
|
||||||
memset(m_dmg, 0, sizeof(DAMAGE_IMAGE) * NUM_DMG_TYPES);
|
memset(m_dmg, 0, sizeof(DAMAGE_IMAGE) * NUM_DMG_TYPES);
|
||||||
|
|
||||||
|
hud_health_x = CVAR_CREATE("hud_health_x", "0", FCVAR_ARCHIVE);
|
||||||
|
hud_health_y = CVAR_CREATE("hud_health_y", "0", FCVAR_ARCHIVE);
|
||||||
|
hud_health_scale = CVAR_CREATE("hud_health_scale", "1", FCVAR_ARCHIVE);
|
||||||
|
hud_health_alphamin = CVAR_CREATE("hud_health_alphamin", "128", FCVAR_ARCHIVE);
|
||||||
|
|
||||||
gHUD.AddHudElem(this);
|
gHUD.AddHudElem(this);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -160,6 +166,91 @@ void CHudHealth::GetPainColor( int &r, int &g, int &b )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//// Old HUD drawing.
|
||||||
|
//int CHudHealth::Draw(float flTime)
|
||||||
|
//{
|
||||||
|
// int r, g, b;
|
||||||
|
// int a = 0, x, y;
|
||||||
|
// int HealthWidth;
|
||||||
|
//
|
||||||
|
// if ( /*!gHUD.GetIsAlive() ||*/ (gHUD.m_iHideHUDDisplay & HIDEHUD_HEALTH) /*|| gEngfuncs.IsSpectateOnly()*/)
|
||||||
|
// return 1;
|
||||||
|
//
|
||||||
|
// if (!m_hSprite)
|
||||||
|
// m_hSprite = LoadSprite(PAIN_NAME);
|
||||||
|
//
|
||||||
|
// // Has health changed? Flash the health #
|
||||||
|
// if (m_fFade)
|
||||||
|
// {
|
||||||
|
// m_fFade -= (gHUD.m_flTimeDelta * 20);
|
||||||
|
// if (m_fFade <= 0)
|
||||||
|
// {
|
||||||
|
// a = MIN_ALPHA;
|
||||||
|
// m_fFade = 0;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // Fade the health number back to dim
|
||||||
|
//
|
||||||
|
// a = MIN_ALPHA + (m_fFade / FADE_TIME) * 128;
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// a = MIN_ALPHA;
|
||||||
|
//
|
||||||
|
// // Potentially se upgrades and health of spectator target
|
||||||
|
// int theUpgrades = gHUD.GetHUDUpgrades();
|
||||||
|
//
|
||||||
|
// // If health is getting low, make it bright red
|
||||||
|
// int theMaxHealth = gHUD.GetHUDMaxHealth();
|
||||||
|
// if (m_iHealth <= theMaxHealth / 10)
|
||||||
|
// {
|
||||||
|
// a = 255;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// GetPainColor(r, g, b);
|
||||||
|
// ScaleColors(r, g, b, a);
|
||||||
|
//
|
||||||
|
// int theViewport[4];
|
||||||
|
// gHUD.GetViewport(theViewport);
|
||||||
|
//
|
||||||
|
// // Only draw health if we have the suit.
|
||||||
|
// if (gHUD.m_iWeaponBits & (1 << (WEAPON_SUIT)))
|
||||||
|
// {
|
||||||
|
// HealthWidth = gHUD.GetSpriteRect(gHUD.m_HUD_number_0).right - gHUD.GetSpriteRect(gHUD.m_HUD_number_0).left;
|
||||||
|
// int CrossWidth = gHUD.GetSpriteRect(m_HUD_cross).right - gHUD.GetSpriteRect(m_HUD_cross).left;
|
||||||
|
//
|
||||||
|
// y = theViewport[1] + theViewport[3] - gHUD.m_iFontHeight - gHUD.m_iFontHeight / 2;
|
||||||
|
//
|
||||||
|
// x = theViewport[0] + CrossWidth / 2;
|
||||||
|
//
|
||||||
|
// int theInset = 0;
|
||||||
|
// //if(gHUD.GetIsAlien() && !gHUD.GetIsCombatMode())
|
||||||
|
// //{
|
||||||
|
// // theInset = ScreenWidth()*kResourceEnergyBarWidth;
|
||||||
|
// //}
|
||||||
|
// x += theInset;// + kHealthLeftInset*ScreenWidth;
|
||||||
|
//
|
||||||
|
// SPR_Set(gHUD.GetSprite(m_HUD_cross), r, g, b);
|
||||||
|
// SPR_DrawAdditive(0, x, y, &gHUD.GetSpriteRect(m_HUD_cross));
|
||||||
|
//
|
||||||
|
// x += CrossWidth + HealthWidth / 2;
|
||||||
|
//
|
||||||
|
// x = gHUD.DrawHudNumber(x, y, DHN_3DIGITS | DHN_DRAWZERO, m_iHealth, r, g, b);
|
||||||
|
//
|
||||||
|
// x += HealthWidth / 2;
|
||||||
|
//
|
||||||
|
// gHUD.GetPrimaryHudColor(r, g, b);
|
||||||
|
//
|
||||||
|
// int iHeight = gHUD.m_iFontHeight;
|
||||||
|
// int iWidth = HealthWidth / 10;
|
||||||
|
// FillRGBA(x, y, iWidth, iHeight, r, g, b, a);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// DrawDamage(flTime);
|
||||||
|
// return DrawPain(flTime);
|
||||||
|
//}
|
||||||
|
|
||||||
int CHudHealth::Draw(float flTime)
|
int CHudHealth::Draw(float flTime)
|
||||||
{
|
{
|
||||||
int r, g, b;
|
int r, g, b;
|
||||||
|
@ -172,23 +263,24 @@ int CHudHealth::Draw(float flTime)
|
||||||
if ( !m_hSprite )
|
if ( !m_hSprite )
|
||||||
m_hSprite = LoadSprite(PAIN_NAME);
|
m_hSprite = LoadSprite(PAIN_NAME);
|
||||||
|
|
||||||
|
if (hud_health_alphamin)
|
||||||
|
m_iMinAlpha = max(0, min(hud_health_alphamin->value, 255));
|
||||||
|
else
|
||||||
|
m_iMinAlpha = MIN_ALPHA;
|
||||||
|
|
||||||
// Has health changed? Flash the health #
|
// Has health changed? Flash the health #
|
||||||
if (m_fFade)
|
if (m_fFade)
|
||||||
{
|
{
|
||||||
m_fFade -= (gHUD.m_flTimeDelta * 20);
|
m_fFade -= (gHUD.m_flTimeDelta * 20);
|
||||||
if (m_fFade <= 0)
|
if (m_fFade <= 0)
|
||||||
{
|
{
|
||||||
a = MIN_ALPHA;
|
|
||||||
m_fFade = 0;
|
m_fFade = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fade the health number back to dim
|
// Fade the health number back to dim
|
||||||
|
a = m_iMinAlpha + (m_fFade/FADE_TIME) * 128;
|
||||||
a = MIN_ALPHA + (m_fFade/FADE_TIME) * 128;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
a = MIN_ALPHA;
|
a = m_iMinAlpha;
|
||||||
|
|
||||||
// Potentially se upgrades and health of spectator target
|
// Potentially se upgrades and health of spectator target
|
||||||
int theUpgrades = gHUD.GetHUDUpgrades();
|
int theUpgrades = gHUD.GetHUDUpgrades();
|
||||||
|
@ -203,40 +295,56 @@ int CHudHealth::Draw(float flTime)
|
||||||
GetPainColor( r, g, b );
|
GetPainColor( r, g, b );
|
||||||
ScaleColors(r, g, b, a );
|
ScaleColors(r, g, b, a );
|
||||||
|
|
||||||
int theViewport[4];
|
|
||||||
gHUD.GetViewport(theViewport);
|
|
||||||
|
|
||||||
// Only draw health if we have the suit.
|
// Only draw health if we have the suit.
|
||||||
if (gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT)))
|
if (gHUD.m_iWeaponBits & (1<<(WEAPON_SUIT)))
|
||||||
{
|
{
|
||||||
HealthWidth = gHUD.GetSpriteRect(gHUD.m_HUD_number_0).right - gHUD.GetSpriteRect(gHUD.m_HUD_number_0).left;
|
if (hud_health_scale)
|
||||||
int CrossWidth = gHUD.GetSpriteRect(m_HUD_cross).right - gHUD.GetSpriteRect(m_HUD_cross).left;
|
{
|
||||||
|
m_fHealthScale = min(max(0.01f, hud_health_scale->value), 5.0f);
|
||||||
|
}
|
||||||
|
|
||||||
y = theViewport[1] + theViewport[3] - gHUD.m_iFontHeight - gHUD.m_iFontHeight / 2;
|
HealthWidth = (gHUD.GetSpriteRect(gHUD.m_HUD_number_0).right - gHUD.GetSpriteRect(gHUD.m_HUD_number_0).left) * m_fHealthScale;
|
||||||
|
int CrossWidth = (gHUD.GetSpriteRect(m_HUD_cross).right - gHUD.GetSpriteRect(m_HUD_cross).left) * m_fHealthScale;
|
||||||
x = theViewport[0] + CrossWidth /2;
|
|
||||||
|
|
||||||
int theInset = 0;
|
if (hud_health_x && hud_health_x->value != 0.0f)
|
||||||
//if(gHUD.GetIsAlien() && !gHUD.GetIsCombatMode())
|
{
|
||||||
//{
|
x = min(max(0.0f, hud_health_x->value), 1.0f) * gHUD.GetWidth();
|
||||||
// theInset = ScreenWidth()*kResourceEnergyBarWidth;
|
}
|
||||||
//}
|
else
|
||||||
x += theInset;// + kHealthLeftInset*ScreenWidth;
|
{
|
||||||
|
//TODO: Inset position for ultrawide monitors.
|
||||||
SPR_Set(gHUD.GetSprite(m_HUD_cross), r, g, b);
|
//if (gHUD.GetWidth() > (gHUD.GetHeight() * 1.78f)){}
|
||||||
SPR_DrawAdditive(0, x, y, &gHUD.GetSpriteRect(m_HUD_cross));
|
|
||||||
|
x = CrossWidth / 2;
|
||||||
|
}
|
||||||
|
int initialY = gHUD.GetHeight();
|
||||||
|
if (hud_health_y && hud_health_y->value != 0.0f)
|
||||||
|
{
|
||||||
|
initialY *= min(max(0.0f, hud_health_y->value), 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
y = initialY - gHUD.m_iFontHeight / 2;
|
||||||
|
|
||||||
|
gHUD.DrawHudSpriteIndex(m_HUD_cross, x, y, r, g, b, 255, m_fHealthScale, CHud::a_southwest);
|
||||||
|
|
||||||
x += CrossWidth + HealthWidth / 2;
|
x += CrossWidth + HealthWidth / 2;
|
||||||
|
|
||||||
|
//Reserve space for 3 digits by default, but allow it to expand
|
||||||
|
x += gHUD.GetHudNumberWidth(m_iHealth, 3, DHN_DRAWZERO, m_fHealthScale);
|
||||||
|
|
||||||
x = gHUD.DrawHudNumber(x, y, DHN_3DIGITS | DHN_DRAWZERO, m_iHealth, r, g, b);
|
gHUD.DrawHudNumberReverse(x, y, m_iHealth, DHN_DRAWZERO, r, g, b, 255, m_fHealthScale, CHud::a_southwest);
|
||||||
|
|
||||||
x += HealthWidth/2;
|
x += HealthWidth /2;
|
||||||
|
|
||||||
gHUD.GetPrimaryHudColor(r, g, b);
|
gHUD.GetPrimaryHudColor(r, g, b);
|
||||||
|
|
||||||
int iHeight = gHUD.m_iFontHeight;
|
int iHeight = gHUD.m_iFontHeight * -1;
|
||||||
int iWidth = HealthWidth/10;
|
int iWidth = max(1, HealthWidth /10);
|
||||||
FillRGBA(x, y, iWidth, iHeight, r, g, b, a);
|
|
||||||
|
gHUD.DrawHudFill(x, y, iWidth, iHeight, r ,g , b, a, m_fHealthScale);
|
||||||
|
|
||||||
|
gHUD.m_Battery.m_iAnchorX = x + iWidth + HealthWidth / 2;
|
||||||
|
gHUD.m_Battery.m_iAnchorY = initialY;
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawDamage(flTime);
|
DrawDamage(flTime);
|
||||||
|
|
|
@ -101,6 +101,8 @@ public:
|
||||||
float m_fAttackFront, m_fAttackRear, m_fAttackLeft, m_fAttackRight;
|
float m_fAttackFront, m_fAttackRear, m_fAttackLeft, m_fAttackRight;
|
||||||
void GetPainColor( int &r, int &g, int &b );
|
void GetPainColor( int &r, int &g, int &b );
|
||||||
float m_fFade;
|
float m_fFade;
|
||||||
|
float m_fHealthScale;
|
||||||
|
int m_iMinAlpha;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AVHHSPRITE m_hSprite;
|
AVHHSPRITE m_hSprite;
|
||||||
|
@ -112,6 +114,11 @@ private:
|
||||||
int DrawDamage(float fTime);
|
int DrawDamage(float fTime);
|
||||||
void CalcDamageDirection(vec3_t vecFrom);
|
void CalcDamageDirection(vec3_t vecFrom);
|
||||||
void UpdateTiles(float fTime, long bits);
|
void UpdateTiles(float fTime, long bits);
|
||||||
|
|
||||||
|
cvar_t* hud_health_x;
|
||||||
|
cvar_t* hud_health_y;
|
||||||
|
cvar_t* hud_health_scale;
|
||||||
|
cvar_t* hud_health_alphamin;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -151,6 +151,8 @@ int gSiegeViewHitEventID;
|
||||||
int gCommanderPointsAwardedEventID;
|
int gCommanderPointsAwardedEventID;
|
||||||
int gBlinkEffectSuccessEventID;
|
int gBlinkEffectSuccessEventID;
|
||||||
|
|
||||||
|
static float prevUseTime = 0;
|
||||||
|
|
||||||
//bool gPlayingJetpack = false;
|
//bool gPlayingJetpack = false;
|
||||||
//CGlock g_Glock;
|
//CGlock g_Glock;
|
||||||
//CCrowbar g_Crowbar;
|
//CCrowbar g_Crowbar;
|
||||||
|
@ -502,6 +504,21 @@ void CBasePlayerWeapon::ItemPostFrame( void )
|
||||||
m_fInReload = FALSE;
|
m_fInReload = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_pPlayer->pev->button & IN_USE)
|
||||||
|
{
|
||||||
|
prevUseTime = gpGlobals->time;
|
||||||
|
}
|
||||||
|
else if (gHUD.GetHUDUser3() == AVH_USER3_ALIEN_PLAYER2 && m_pPlayer->m_afButtonReleased & IN_USE && m_pPlayer->pev->weaponanim == 4)
|
||||||
|
{
|
||||||
|
switch (gHUD.GetCurrentWeaponID())
|
||||||
|
{
|
||||||
|
case AVH_WEAPON_SPIT:
|
||||||
|
case AVH_WEAPON_BILEBOMB:
|
||||||
|
this->SendWeaponAnim(7);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Properly propagate the end animation
|
// Properly propagate the end animation
|
||||||
if (this->PrevAttack2Status == true && !(m_pPlayer->pev->button & IN_ATTACK2))
|
if (this->PrevAttack2Status == true && !(m_pPlayer->pev->button & IN_ATTACK2))
|
||||||
{
|
{
|
||||||
|
@ -511,77 +528,95 @@ void CBasePlayerWeapon::ItemPostFrame( void )
|
||||||
this->SendWeaponAnim(12);
|
this->SendWeaponAnim(12);
|
||||||
break;
|
break;
|
||||||
case AVH_WEAPON_ACIDROCKET:
|
case AVH_WEAPON_ACIDROCKET:
|
||||||
this->SendWeaponAnim(8);
|
this->SendWeaponAnim(13);
|
||||||
break;
|
break;
|
||||||
case AVH_WEAPON_CLAWS:
|
case AVH_WEAPON_CLAWS:
|
||||||
this->SendWeaponAnim(9);
|
this->SendWeaponAnim(9);
|
||||||
break;
|
break;
|
||||||
case AVH_WEAPON_STOMP:
|
case AVH_WEAPON_STOMP:
|
||||||
this->SendWeaponAnim(8);
|
this->SendWeaponAnim(11);
|
||||||
break;
|
break;
|
||||||
case AVH_WEAPON_DEVOUR:
|
case AVH_WEAPON_DEVOUR:
|
||||||
this->SendWeaponAnim(11);
|
this->SendWeaponAnim(12);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( (m_pPlayer->pev->button & IN_ATTACK) && !(m_pPlayer->pev->button & IN_ATTACK2))
|
if ((m_pPlayer->pev->button & IN_ATTACK || (this->m_bAttackQueued && m_flNextPrimaryAttack <= 0.0)) && (!(m_pPlayer->pev->button & IN_ATTACK2) || gHUD.GetHUDUser3() == AVH_USER3_ALIEN_PLAYER3))
|
||||||
{
|
{
|
||||||
if ((m_fInSpecialReload == 1 || m_fInSpecialReload == 2) && m_iClip != 0)
|
if (GetCanUseWeapon())
|
||||||
{
|
|
||||||
m_fInSpecialReload = 3;
|
|
||||||
Reload();
|
|
||||||
}
|
|
||||||
else if (GetCanUseWeapon() && (m_flNextPrimaryAttack <= 0.0))
|
|
||||||
{
|
{
|
||||||
if ( (m_iClip == 0 && ii.pszAmmo1) ||
|
if ((m_fInSpecialReload == 1 || m_fInSpecialReload == 2) && m_iClip != 0)
|
||||||
(ii.iMaxClip == -1 && !m_pPlayer->m_rgAmmo[PrimaryAmmoIndex()] ) )
|
|
||||||
{
|
|
||||||
m_fFireOnEmpty = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ((gHUD.GetHUDUser3() == AVH_USER3_ALIEN_PLAYER1)
|
|
||||||
&& (gHUD.GetCurrentWeaponID() == AVH_ABILITY_LEAP)
|
|
||||||
&& (this->m_flLastAnimationPlayed + (float)BALANCE_VAR(kLeapROF) <= gpGlobals->time))
|
|
||||||
{
|
{
|
||||||
// : 0001151 predict energy too
|
m_fInSpecialReload = 3;
|
||||||
AvHAlienWeapon* theWeapon = dynamic_cast<AvHAlienWeapon *>(g_pWpns[AVH_ABILITY_LEAP]);
|
Reload();
|
||||||
if ( theWeapon && theWeapon->IsUseable() ) {
|
}
|
||||||
float theVolumeScalar = 1.0f;
|
else if (m_flNextPrimaryAttack <= 0.0)
|
||||||
cl_entity_t *player = gEngfuncs.GetLocalPlayer();
|
{
|
||||||
int theSilenceLevel = AvHGetAlienUpgradeLevel(player->curstate.iuser4, MASK_UPGRADE_6);
|
if ( (m_iClip == 0 && ii.pszAmmo1) ||
|
||||||
switch(theSilenceLevel)
|
(ii.iMaxClip == -1 && !m_pPlayer->m_rgAmmo[PrimaryAmmoIndex()] ) )
|
||||||
{
|
{
|
||||||
case 1:
|
m_fFireOnEmpty = TRUE;
|
||||||
theVolumeScalar = (float)BALANCE_VAR(kSilenceLevel1Volume);
|
}
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
theVolumeScalar = (float)BALANCE_VAR(kSilenceLevel2Volume);
|
if ((gHUD.GetHUDUser3() == AVH_USER3_ALIEN_PLAYER1)
|
||||||
break;
|
&& (gHUD.GetCurrentWeaponID() == AVH_ABILITY_LEAP)
|
||||||
case 3:
|
&& (this->m_flLastAnimationPlayed + (float)BALANCE_VAR(kLeapROF) <= gpGlobals->time))
|
||||||
theVolumeScalar = (float)BALANCE_VAR(kSilenceLevel3Volume);
|
{
|
||||||
break;
|
// : 0001151 predict energy too
|
||||||
}
|
AvHAlienWeapon* theWeapon = dynamic_cast<AvHAlienWeapon *>(g_pWpns[AVH_ABILITY_LEAP]);
|
||||||
HUD_PlaySound( kLeapSound, theVolumeScalar);
|
if ( theWeapon && theWeapon->IsUseable() ) {
|
||||||
AvHMUDeductAlienEnergy(m_pPlayer->pev->fuser3, theWeapon->GetEnergyForAttack() );
|
float theVolumeScalar = 1.0f;
|
||||||
gEngfuncs.pEventAPI->EV_WeaponAnimation(3, 2);
|
cl_entity_t *player = gEngfuncs.GetLocalPlayer();
|
||||||
this->m_flLastAnimationPlayed = gpGlobals->time;
|
int theSilenceLevel = AvHGetAlienUpgradeLevel(player->curstate.iuser4, MASK_UPGRADE_6);
|
||||||
}
|
switch(theSilenceLevel)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
theVolumeScalar = (float)BALANCE_VAR(kSilenceLevel1Volume);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
theVolumeScalar = (float)BALANCE_VAR(kSilenceLevel2Volume);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
theVolumeScalar = (float)BALANCE_VAR(kSilenceLevel3Volume);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
HUD_PlaySound( kLeapSound, theVolumeScalar);
|
||||||
|
AvHMUDeductAlienEnergy(m_pPlayer->pev->fuser3, theWeapon->GetEnergyForAttack() );
|
||||||
|
gEngfuncs.pEventAPI->EV_WeaponAnimation(3, 2);
|
||||||
|
this->m_flLastAnimationPlayed = gpGlobals->time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PrimaryAttack();
|
||||||
|
//return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (m_pPlayer->m_afButtonPressed & IN_ATTACK)
|
||||||
|
{
|
||||||
|
QueueAttack();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//#ifdef AVH_CLIENT
|
|
||||||
//if((m_iClip == 0) && ?
|
|
||||||
//#endif
|
|
||||||
PrimaryAttack();
|
|
||||||
//return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// +movement: Rewritten to allow us to use +attack2 for movement abilities
|
// +movement: Rewritten to allow us to use +attack2 for movement abilities
|
||||||
else if ((m_pPlayer->pev->button & IN_ATTACK2) && (gHUD.GetIsAlien()))
|
else if ((m_pPlayer->pev->button & IN_ATTACK2) && (gHUD.GetIsAlien()))
|
||||||
{
|
{
|
||||||
|
AvHUser3 theUser3 = gHUD.GetHUDUser3();
|
||||||
|
|
||||||
//m_flNextSecondaryAttack
|
//m_flNextSecondaryAttack
|
||||||
// Find out what kind of special movement we are using, and execute the animation for it
|
// Find out what kind of special movement we are using, and execute the animation for it
|
||||||
if (this->PrevAttack2Status == false)
|
|
||||||
|
if (theUser3 == AVH_USER3_ALIEN_PLAYER2)
|
||||||
|
{
|
||||||
|
if (GetCanUseWeapon() && m_flNextPrimaryAttack <= 0.0)
|
||||||
|
{
|
||||||
|
SecondaryAttack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (this->PrevAttack2Status == false)
|
||||||
{
|
{
|
||||||
bool enabled=false;
|
bool enabled=false;
|
||||||
// : 0001151 predict energy too
|
// : 0001151 predict energy too
|
||||||
|
@ -589,7 +624,7 @@ void CBasePlayerWeapon::ItemPostFrame( void )
|
||||||
if ( theWeapon )
|
if ( theWeapon )
|
||||||
enabled=theWeapon->IsUseable();
|
enabled=theWeapon->IsUseable();
|
||||||
|
|
||||||
switch (gHUD.GetHUDUser3())
|
switch (theUser3)
|
||||||
{
|
{
|
||||||
case AVH_USER3_ALIEN_PLAYER1:
|
case AVH_USER3_ALIEN_PLAYER1:
|
||||||
|
|
||||||
|
@ -634,22 +669,23 @@ void CBasePlayerWeapon::ItemPostFrame( void )
|
||||||
this->SendWeaponAnim(5);
|
this->SendWeaponAnim(5);
|
||||||
break;
|
break;
|
||||||
case AVH_WEAPON_DEVOUR:
|
case AVH_WEAPON_DEVOUR:
|
||||||
this->SendWeaponAnim(18);
|
this->SendWeaponAnim(19);
|
||||||
break;
|
break;
|
||||||
case AVH_WEAPON_STOMP:
|
case AVH_WEAPON_STOMP:
|
||||||
this->SendWeaponAnim(15);
|
this->SendWeaponAnim(16);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gHUD.GetHUDUser3() == AVH_USER3_ALIEN_PLAYER1)
|
if ((theUser3 == AVH_USER3_ALIEN_PLAYER1) && (this->m_flLastAnimationPlayed + BALANCE_VAR(kLeapROF) < gpGlobals->time))
|
||||||
&& (this->m_flLastAnimationPlayed + BALANCE_VAR(kLeapROF) < gpGlobals->time))
|
|
||||||
this->PrevAttack2Status = false;
|
this->PrevAttack2Status = false;
|
||||||
else
|
else
|
||||||
this->PrevAttack2Status = true;
|
this->PrevAttack2Status = true;
|
||||||
|
|
||||||
|
this->PrevAttack2Time = gpGlobals->time;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
// if (GetCanUseWeapon())
|
// if (GetCanUseWeapon())
|
||||||
// {
|
// {
|
||||||
|
@ -674,7 +710,7 @@ void CBasePlayerWeapon::ItemPostFrame( void )
|
||||||
// no fire buttons down
|
// no fire buttons down
|
||||||
|
|
||||||
m_fFireOnEmpty = FALSE;
|
m_fFireOnEmpty = FALSE;
|
||||||
|
|
||||||
// weapon is useable. Reload if empty and weapon has waited as long as it has to after firing
|
// weapon is useable. Reload if empty and weapon has waited as long as it has to after firing
|
||||||
if (m_iClip == 0 && !(ii.iFlags & ITEM_FLAG_NOAUTORELOAD) && m_flNextPrimaryAttack < 0.0)
|
if (m_iClip == 0 && !(ii.iFlags & ITEM_FLAG_NOAUTORELOAD) && m_flNextPrimaryAttack < 0.0)
|
||||||
{
|
{
|
||||||
|
@ -1210,7 +1246,7 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
|
||||||
}
|
}
|
||||||
|
|
||||||
pfrom = &from->weapondata[ i ];
|
pfrom = &from->weapondata[ i ];
|
||||||
|
|
||||||
pCurrent->m_fInReload = pfrom->m_fInReload;
|
pCurrent->m_fInReload = pfrom->m_fInReload;
|
||||||
pCurrent->m_fInSpecialReload = pfrom->m_fInSpecialReload;
|
pCurrent->m_fInSpecialReload = pfrom->m_fInSpecialReload;
|
||||||
// pCurrent->m_flPumpTime = pfrom->m_flPumpTime;
|
// pCurrent->m_flPumpTime = pfrom->m_flPumpTime;
|
||||||
|
@ -1218,6 +1254,7 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
|
||||||
pCurrent->m_flNextPrimaryAttack = pfrom->m_flNextPrimaryAttack;
|
pCurrent->m_flNextPrimaryAttack = pfrom->m_flNextPrimaryAttack;
|
||||||
pCurrent->m_flNextSecondaryAttack = pfrom->m_flNextSecondaryAttack;
|
pCurrent->m_flNextSecondaryAttack = pfrom->m_flNextSecondaryAttack;
|
||||||
pCurrent->m_flTimeWeaponIdle = pfrom->m_flTimeWeaponIdle;
|
pCurrent->m_flTimeWeaponIdle = pfrom->m_flTimeWeaponIdle;
|
||||||
|
|
||||||
if(pWeapon && (pWeapon->m_iId == pfrom->m_iId))
|
if(pWeapon && (pWeapon->m_iId == pfrom->m_iId))
|
||||||
{
|
{
|
||||||
// Predict clip
|
// Predict clip
|
||||||
|
@ -1242,8 +1279,9 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
|
||||||
pCurrent->m_flStartThrow = pfrom->fuser2;
|
pCurrent->m_flStartThrow = pfrom->fuser2;
|
||||||
pCurrent->m_flReleaseThrow = pfrom->fuser3;
|
pCurrent->m_flReleaseThrow = pfrom->fuser3;
|
||||||
// pCurrent->m_chargeReady = pfrom->iuser1;
|
// pCurrent->m_chargeReady = pfrom->iuser1;
|
||||||
// pCurrent->m_fInAttack = pfrom->iuser2;
|
pCurrent->m_fInAttack = pfrom->iuser2;
|
||||||
pCurrent->pev->iuser3 = pfrom->iuser3;
|
pCurrent->pev->iuser3 = pfrom->iuser3;
|
||||||
|
pCurrent->m_bAttackQueued = pfrom->iuser4;
|
||||||
|
|
||||||
// pCurrent->m_iSecondaryAmmoType = (int)from->client.vuser3[2];
|
// pCurrent->m_iSecondaryAmmoType = (int)from->client.vuser3[2];
|
||||||
// pCurrent->m_iPrimaryAmmoType = (int)from->client.vuser4[0];
|
// pCurrent->m_iPrimaryAmmoType = (int)from->client.vuser4[0];
|
||||||
|
@ -1390,18 +1428,50 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
|
||||||
|
|
||||||
// Make sure that weapon animation matches what the game .dll is telling us
|
// Make sure that weapon animation matches what the game .dll is telling us
|
||||||
// over the wire ( fixes some animation glitches )
|
// over the wire ( fixes some animation glitches )
|
||||||
// Ensure that the fade and onos won't get these, to play the blink and charge animations correctly
|
if (g_runfuncs && HUD_GetWeaponAnim() != to->client.weaponanim)
|
||||||
bool noRun = (to->client.iuser3 == AVH_USER3_ALIEN_PLAYER4) || (to->client.iuser3 == AVH_USER3_ALIEN_PLAYER5);
|
|
||||||
if (g_runfuncs && ( HUD_GetWeaponAnim() != to->client.weaponanim ) && !(CheckInAttack2()) && !noRun)
|
|
||||||
{
|
{
|
||||||
int body = 2;
|
int body = 2;
|
||||||
|
bool processTheAnim = true;
|
||||||
|
|
||||||
|
//gEngfuncs.Con_Printf("trying to force animation on client currentanim:%d serveranim:%d nextattack:%f time:%f\n", HUD_GetWeaponAnim(), to->client.weaponanim, to->client.m_flNextAttack, gpGlobals->time);
|
||||||
|
//// 2024 - Don't correct with +movement transitional animations since +movement animations are hacked in on the client and it bugs out. Remove most of this if alien weapons get refactored to shared code.
|
||||||
|
if (to->client.iuser3 == AVH_USER3_ALIEN_PLAYER5)
|
||||||
|
{
|
||||||
|
if ((gpGlobals->time - pWeapon->PrevAttack2Time < 1.0f) || (to->client.weaponanim > 4 && to->client.weaponanim < 21))
|
||||||
|
//(to->client.weaponanim == 27 && gpGlobals->time - pWeapon->PrevAttack2Time < 10.0f) ||
|
||||||
|
{
|
||||||
|
processTheAnim = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (to->client.iuser3 == AVH_USER3_ALIEN_PLAYER4)
|
||||||
|
{
|
||||||
|
if ((gpGlobals->time - pWeapon->PrevAttack2Time < 1.0f) || (to->client.weaponanim > 7 && to->client.weaponanim < 14))
|
||||||
|
//(to->client.weaponanim == 5 && gpGlobals->time - pWeapon->PrevAttack2Time < 10.0f) ||
|
||||||
|
{
|
||||||
|
processTheAnim = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//else if (to->client.iuser3 == AVH_USER3_ALIEN_PLAYER3 && to->client.weaponanim > 6 && to->client.weaponanim < 13)
|
||||||
|
else if (to->client.iuser3 == AVH_USER3_ALIEN_PLAYER1)
|
||||||
|
{
|
||||||
|
if (gpGlobals->time - pWeapon->PrevAttack2Time < 1.0f)
|
||||||
|
processTheAnim = false;
|
||||||
|
}
|
||||||
|
// Gorge building animation fixes since it's server side and the new transition out of it is client side.
|
||||||
|
else if (to->client.iuser3 == AVH_USER3_ALIEN_PLAYER2)
|
||||||
|
{
|
||||||
|
if (player.pev->button & IN_USE ||
|
||||||
|
(to->client.weaponanim == 4 && gpGlobals->time - prevUseTime < 10.0f) ||
|
||||||
|
(to->client.weaponanim < 2 && gpGlobals->time - prevUseTime < 1.0f) ||
|
||||||
|
(HUD_GetWeaponAnim() == 4 && to->client.weaponanim == 5))
|
||||||
|
{
|
||||||
|
processTheAnim = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Pop the model to body 0.
|
|
||||||
//if ( pWeapon == &g_Tripmine )
|
|
||||||
// body = 0;
|
|
||||||
|
|
||||||
// Force a fixed anim down to viewmodel
|
// Force a fixed anim down to viewmodel
|
||||||
HUD_SendWeaponAnim( to->client.weaponanim, body, 1 );
|
if (processTheAnim)
|
||||||
|
HUD_SendWeaponAnim(to->client.weaponanim, body, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( i = 0; i < 32; i++ )
|
for ( i = 0; i < 32; i++ )
|
||||||
|
@ -1427,8 +1497,9 @@ void HUD_WeaponsPostThink( local_state_s *from, local_state_s *to, usercmd_t *cm
|
||||||
// pto->fuser2 = pCurrent->m_flStartThrow;
|
// pto->fuser2 = pCurrent->m_flStartThrow;
|
||||||
// pto->fuser3 = pCurrent->m_flReleaseThrow;
|
// pto->fuser3 = pCurrent->m_flReleaseThrow;
|
||||||
// pto->iuser1 = pCurrent->m_chargeReady;
|
// pto->iuser1 = pCurrent->m_chargeReady;
|
||||||
// pto->iuser2 = pCurrent->m_fInAttack;
|
pto->iuser2 = pCurrent->m_fInAttack;
|
||||||
pto->iuser3 = pCurrent->pev->iuser3;
|
pto->iuser3 = pCurrent->pev->iuser3;
|
||||||
|
pto->iuser4 = pCurrent->m_bAttackQueued;
|
||||||
|
|
||||||
// Decrement weapon counters, server does this at same time ( during post think, after doing everything else )
|
// Decrement weapon counters, server does this at same time ( during post think, after doing everything else )
|
||||||
pto->m_flNextReload -= cmd->msec / 1000.0;
|
pto->m_flNextReload -= cmd->msec / 1000.0;
|
||||||
|
|
|
@ -209,9 +209,9 @@ void CHud :: Init( void )
|
||||||
m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE );
|
m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE );
|
||||||
cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" );
|
cl_lw = gEngfuncs.pfnGetCvarPointer( "cl_lw" );
|
||||||
|
|
||||||
CVAR_CREATE( "cl_showspeed", "0", 0);
|
CVAR_CREATE( "cl_showspeed", "0", FCVAR_ARCHIVE);
|
||||||
CVAR_CREATE( kvLabelMaps, "3", FCVAR_ARCHIVE);
|
CVAR_CREATE( kvLabelMaps, "3", FCVAR_ARCHIVE);
|
||||||
CVAR_CREATE( kvGammaRamp, "0", FCVAR_ARCHIVE);
|
//CVAR_CREATE( kvGammaRamp, "0", FCVAR_ARCHIVE);
|
||||||
CVAR_CREATE( kvCustomCrosshair, "1", FCVAR_ARCHIVE);
|
CVAR_CREATE( kvCustomCrosshair, "1", FCVAR_ARCHIVE);
|
||||||
CVAR_CREATE( kvHudMapZoom, "3", FCVAR_ARCHIVE);
|
CVAR_CREATE( kvHudMapZoom, "3", FCVAR_ARCHIVE);
|
||||||
CVAR_CREATE( kvLabelHivesight, "1", FCVAR_ARCHIVE);
|
CVAR_CREATE( kvLabelHivesight, "1", FCVAR_ARCHIVE);
|
||||||
|
@ -219,6 +219,7 @@ void CHud :: Init( void )
|
||||||
CVAR_CREATE( "cl_icong", "149", FCVAR_ARCHIVE);
|
CVAR_CREATE( "cl_icong", "149", FCVAR_ARCHIVE);
|
||||||
CVAR_CREATE( "cl_iconb", "221", FCVAR_ARCHIVE);
|
CVAR_CREATE( "cl_iconb", "221", FCVAR_ARCHIVE);
|
||||||
|
|
||||||
|
CVAR_CREATE("hud_style", "1", FCVAR_ARCHIVE);
|
||||||
CVAR_CREATE("cl_weaponswap", "2", FCVAR_ARCHIVE | FCVAR_USERINFO);
|
CVAR_CREATE("cl_weaponswap", "2", FCVAR_ARCHIVE | FCVAR_USERINFO);
|
||||||
CVAR_CREATE("hud_teamhealthalert", "95", FCVAR_ARCHIVE);
|
CVAR_CREATE("hud_teamhealthalert", "95", FCVAR_ARCHIVE);
|
||||||
CVAR_CREATE("hud_mapnames", "5", FCVAR_ARCHIVE);
|
CVAR_CREATE("hud_mapnames", "5", FCVAR_ARCHIVE);
|
||||||
|
@ -227,7 +228,9 @@ void CHud :: Init( void )
|
||||||
CVAR_CREATE("hud_mapnamesGreen", "255", FCVAR_ARCHIVE);
|
CVAR_CREATE("hud_mapnamesGreen", "255", FCVAR_ARCHIVE);
|
||||||
CVAR_CREATE("hud_mapnamesBlue", "255", FCVAR_ARCHIVE);
|
CVAR_CREATE("hud_mapnamesBlue", "255", FCVAR_ARCHIVE);
|
||||||
CVAR_CREATE("hud_nameinfo", "1", FCVAR_ARCHIVE);
|
CVAR_CREATE("hud_nameinfo", "1", FCVAR_ARCHIVE);
|
||||||
CVAR_CREATE("hud_drawwaypoints", "2", FCVAR_ARCHIVE);
|
CVAR_CREATE("hud_waypoint_draw", "2", FCVAR_ARCHIVE);
|
||||||
|
CVAR_CREATE("hud_waypoint_blink", "2", FCVAR_ARCHIVE);
|
||||||
|
m_pCvarWidescreen = gEngfuncs.pfnGetCvarPointer("gl_widescreen_yfov");
|
||||||
|
|
||||||
m_pSpriteList = NULL;
|
m_pSpriteList = NULL;
|
||||||
|
|
||||||
|
@ -326,7 +329,22 @@ void CHud :: VidInit( void )
|
||||||
|
|
||||||
gHUD.SetViewport(theViewPort);
|
gHUD.SetViewport(theViewPort);
|
||||||
|
|
||||||
if (CVAR_GET_FLOAT("hud_style") == 2.0f)
|
//Determine if we're playing in windowed mode so we can do mouse centering correctly later.
|
||||||
|
for (Uint32 id = 0; id < UINT32_MAX; ++id)
|
||||||
|
{
|
||||||
|
SDL_Window* theWindow = SDL_GetWindowFromID(id);
|
||||||
|
if (theWindow)
|
||||||
|
{
|
||||||
|
if (!(SDL_GetWindowFlags(theWindow) & SDL_WINDOW_FULLSCREEN))
|
||||||
|
{
|
||||||
|
m_bWindowed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CVAR_GET_FLOAT("hud_style") >= 2.0f)
|
||||||
{
|
{
|
||||||
mFont.Load("sprites/nl/font_arial");
|
mFont.Load("sprites/nl/font_arial");
|
||||||
mSmallFont.Load("sprites/nl/font_arialsmall");
|
mSmallFont.Load("sprites/nl/font_arialsmall");
|
||||||
|
@ -350,14 +368,25 @@ void CHud :: VidInit( void )
|
||||||
else
|
else
|
||||||
m_iRes = 640;
|
m_iRes = 640;
|
||||||
|
|
||||||
|
// HUD scaling
|
||||||
|
//m_iConHeight = m_iRes * 0.75F;
|
||||||
|
m_iConHeight = 600; // Replicate 800x600 scale since NS seems to have been designed for that.
|
||||||
|
|
||||||
|
m_flScaleY = ScreenHeight() / (float)m_iConHeight;
|
||||||
|
m_flScaleX = m_flScaleY;
|
||||||
|
|
||||||
|
m_flOffsetY = 0.0F;
|
||||||
|
|
||||||
|
m_bIsWidescreen = m_pCvarWidescreen->value == 0.0F;
|
||||||
|
|
||||||
// Only load this once
|
// Only load this once
|
||||||
if ( !m_pSpriteList )
|
if ( !m_pSpriteList || gHUD.GetReInitHUD())
|
||||||
{
|
{
|
||||||
// we need to load the hud.txt, and all sprites within
|
// we need to load the hud.txt, and all sprites within
|
||||||
if (CVAR_GET_FLOAT("hud_style") == 2.0f)
|
if (CVAR_GET_FLOAT("hud_style") == 3.0f)
|
||||||
m_pSpriteList = SPR_GetList("sprites/hudnl.txt", &m_iSpriteCountAllRes);
|
m_pSpriteList = SPR_GetList("sprites/hudnl.txt", &m_iSpriteCountAllRes);
|
||||||
else
|
else
|
||||||
m_pSpriteList = SPR_GetList("sprites/hud.txt", &m_iSpriteCountAllRes);
|
m_pSpriteList = SPR_GetList("sprites/hud.txt", &m_iSpriteCountAllRes);
|
||||||
|
|
||||||
if (m_pSpriteList)
|
if (m_pSpriteList)
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,6 +30,7 @@ class TeamFortressViewport;
|
||||||
class AvHHud;
|
class AvHHud;
|
||||||
#include "AvHHud.h"
|
#include "AvHHud.h"
|
||||||
extern AvHHud gHUD;
|
extern AvHHud gHUD;
|
||||||
|
extern CPostProcessShader g_PostProcessShader;
|
||||||
|
|
||||||
#include "wrect.h"
|
#include "wrect.h"
|
||||||
#include "cl_dll.h"
|
#include "cl_dll.h"
|
||||||
|
|
|
@ -10,13 +10,13 @@ int CHudCrosshairs::Init()
|
||||||
{
|
{
|
||||||
m_iFlags = HUD_ACTIVE;
|
m_iFlags = HUD_ACTIVE;
|
||||||
|
|
||||||
cl_cross = CVAR_CREATE("cl_cross", "0", FCVAR_ARCHIVE);
|
cl_cross = CVAR_CREATE("cl_cross", "1", FCVAR_ARCHIVE);
|
||||||
cl_cross_color = CVAR_CREATE("cl_cross_color", "255 255 255", FCVAR_ARCHIVE);
|
cl_cross_color = CVAR_CREATE("cl_cross_color", "255 255 255", FCVAR_ARCHIVE);
|
||||||
cl_cross_alpha = CVAR_CREATE("cl_cross_alpha", "255", FCVAR_ARCHIVE);
|
cl_cross_alpha = CVAR_CREATE("cl_cross_alpha", "255", FCVAR_ARCHIVE);
|
||||||
cl_cross_thickness = CVAR_CREATE("cl_cross_thickness", "2", FCVAR_ARCHIVE);
|
cl_cross_thickness = CVAR_CREATE("cl_cross_thickness", "2", FCVAR_ARCHIVE);
|
||||||
cl_cross_size = CVAR_CREATE("cl_cross_size", "6", FCVAR_ARCHIVE);
|
cl_cross_size = CVAR_CREATE("cl_cross_size", "6", FCVAR_ARCHIVE);
|
||||||
cl_cross_gap = CVAR_CREATE("cl_cross_gap", "3", FCVAR_ARCHIVE);
|
cl_cross_gap = CVAR_CREATE("cl_cross_gap", "3", FCVAR_ARCHIVE);
|
||||||
cl_cross_outline = CVAR_CREATE("cl_cross_outline", "2", FCVAR_ARCHIVE);
|
cl_cross_outline = CVAR_CREATE("cl_cross_outline", "1", FCVAR_ARCHIVE);
|
||||||
cl_cross_outline_alpha = CVAR_CREATE("cl_cross_outline_alpha", "", FCVAR_ARCHIVE);
|
cl_cross_outline_alpha = CVAR_CREATE("cl_cross_outline_alpha", "", FCVAR_ARCHIVE);
|
||||||
cl_cross_outline_inner = CVAR_CREATE("cl_cross_outline_inner", "0", FCVAR_ARCHIVE);
|
cl_cross_outline_inner = CVAR_CREATE("cl_cross_outline_inner", "0", FCVAR_ARCHIVE);
|
||||||
cl_cross_circle_radius = CVAR_CREATE("cl_cross_circle_radius", "0", FCVAR_ARCHIVE);
|
cl_cross_circle_radius = CVAR_CREATE("cl_cross_circle_radius", "0", FCVAR_ARCHIVE);
|
||||||
|
@ -31,10 +31,12 @@ int CHudCrosshairs::Init()
|
||||||
cl_cross_dot_alpha = CVAR_CREATE("cl_cross_dot_alpha", "", FCVAR_ARCHIVE);
|
cl_cross_dot_alpha = CVAR_CREATE("cl_cross_dot_alpha", "", FCVAR_ARCHIVE);
|
||||||
cl_cross_dot_outline = CVAR_CREATE("cl_cross_dot_outline", "0", FCVAR_ARCHIVE);
|
cl_cross_dot_outline = CVAR_CREATE("cl_cross_dot_outline", "0", FCVAR_ARCHIVE);
|
||||||
cl_cross_dot_outline_alpha = CVAR_CREATE("cl_cross_dot_outline_alpha", "", FCVAR_ARCHIVE);
|
cl_cross_dot_outline_alpha = CVAR_CREATE("cl_cross_dot_outline_alpha", "", FCVAR_ARCHIVE);
|
||||||
|
cl_cross_dot_round = CVAR_CREATE("cl_cross_dot_round", "0", FCVAR_ARCHIVE);
|
||||||
cl_cross_line_top = CVAR_CREATE("cl_cross_line_top", "1", FCVAR_ARCHIVE);
|
cl_cross_line_top = CVAR_CREATE("cl_cross_line_top", "1", FCVAR_ARCHIVE);
|
||||||
cl_cross_line_bottom = CVAR_CREATE("cl_cross_line_bottom", "1", FCVAR_ARCHIVE);
|
cl_cross_line_bottom = CVAR_CREATE("cl_cross_line_bottom", "1", FCVAR_ARCHIVE);
|
||||||
cl_cross_line_left = CVAR_CREATE("cl_cross_line_left", "1", FCVAR_ARCHIVE);
|
cl_cross_line_left = CVAR_CREATE("cl_cross_line_left", "1", FCVAR_ARCHIVE);
|
||||||
cl_cross_line_right = CVAR_CREATE("cl_cross_line_right", "1", FCVAR_ARCHIVE);
|
cl_cross_line_right = CVAR_CREATE("cl_cross_line_right", "1", FCVAR_ARCHIVE);
|
||||||
|
cl_cross_scaling = CVAR_CREATE("cl_cross_scaling", "1", FCVAR_ARCHIVE);
|
||||||
|
|
||||||
gHUD.AddHudElem(this);
|
gHUD.AddHudElem(this);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -62,9 +64,33 @@ int CHudCrosshairs::Draw(float time)
|
||||||
|
|
||||||
unsigned char r, g, b;
|
unsigned char r, g, b;
|
||||||
if (sscanf(cl_cross_color->string, "%hhu %hhu %hhu", &r, &g, &b) != 3) {
|
if (sscanf(cl_cross_color->string, "%hhu %hhu %hhu", &r, &g, &b) != 3) {
|
||||||
r = 0;
|
r = 255;
|
||||||
g = 255;
|
g = 255;
|
||||||
b = 0;
|
b = 255;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char outalpha;
|
||||||
|
if (sscanf(cl_cross_outline_alpha->string, "%hhu", &outalpha) != 1)
|
||||||
|
outalpha = alpha;
|
||||||
|
|
||||||
|
|
||||||
|
float scalar = 1.0f;
|
||||||
|
if (cl_cross_scaling->value != 0)
|
||||||
|
{
|
||||||
|
// Scale from 1080 Y res, as it's what the default crosshairs are designed for, but don't scale when resolution is close to 1080, as it looks bad.
|
||||||
|
const float screenscale = ScreenHeight() / 1080; //ScreenHeight() * 0.000926f
|
||||||
|
// Lowering scale looks like junk, don't bother.
|
||||||
|
//if (screenscale < 0.75f)
|
||||||
|
//{
|
||||||
|
// scalar = 1.0f / round(1080.0f / ScreenHeight());
|
||||||
|
// //scalar = 0.5f;
|
||||||
|
//}
|
||||||
|
if (screenscale > 1.0f)
|
||||||
|
{
|
||||||
|
scalar = screenscale;
|
||||||
|
}
|
||||||
|
// Additional scaling with the cvar value if desired.
|
||||||
|
scalar *= cl_cross_scaling->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,38 +99,35 @@ int CHudCrosshairs::Draw(float time)
|
||||||
HudGL gl;
|
HudGL gl;
|
||||||
|
|
||||||
// Draw the outline.
|
// Draw the outline.
|
||||||
// TODO: this contains a terrible amount of repeating complex code.
|
// TODO: Swap out lines for rectangles to fix the line thickness limit of 10.
|
||||||
//
|
// The lines can also be changed to one rectangle with the one downside being in cases where the cross alpha is <255, the center of each line will be slightly darker.
|
||||||
// Possible solution: can be changed to this with the one downside being in rare cases where cl_cross_thickness is high AND its alpha is <255, the center of each line will be slightly darker.
|
// Example below is for bottom line. It would also cause certain crosshairs that have outlines on invisible cross lines to not look right.
|
||||||
// Example below is for bottom line. Would also cause certain crosshairs that have outlines on invisible cross lines to not look right.
|
// gl.rectangle(Vector2D(center.x + offset, center.y + gap /*- outline_width*/), Vector2D(center.x - offset, center.y + gap + size + outline_width));
|
||||||
// gl.rectangle(Vector2D(center.x + offset, center.y + gap - half_width), Vector2D(center.x - offset, center.y + gap + size + half_width));
|
if (cl_cross_outline->value > 0.0f && cl_cross_thickness->value > 0.0f && cl_cross_size->value > 0.0f) {
|
||||||
if (cl_cross_outline->value > 0.0f) {
|
|
||||||
unsigned char outalpha;
|
|
||||||
if (sscanf(cl_cross_outline_alpha->string, "%hhu", &outalpha) != 1)
|
float size = cl_cross_size->value * scalar;
|
||||||
outalpha = alpha;
|
float gap = cl_cross_gap->value * scalar;
|
||||||
|
float half_thickness = min(cl_cross_thickness->value * scalar, ScreenHeight() * 0.3f) * 0.5f;
|
||||||
|
float outline_width = cl_cross_outline->value * scalar;
|
||||||
|
float offset = half_thickness + outline_width;
|
||||||
|
|
||||||
gl.color(0, 0, 0, outalpha);
|
gl.color(0, 0, 0, outalpha);
|
||||||
gl.line_width(cl_cross_outline->value);
|
gl.line_width(outline_width * 2.0f);
|
||||||
|
|
||||||
float size = cl_cross_size->value;
|
|
||||||
float gap = cl_cross_gap->value;
|
|
||||||
float half_thickness = cl_cross_thickness->value / 2.0f;
|
|
||||||
float half_width = cl_cross_outline->value / 2.0f;
|
|
||||||
float offset = half_thickness + half_width;
|
|
||||||
|
|
||||||
// Top line
|
// Top line
|
||||||
if (cl_cross_line_top->value) {
|
if (cl_cross_line_top->value) {
|
||||||
gl.line(Vector2D(center.x - offset, center.y - gap - size), Vector2D(center.x + offset, center.y - gap - size));
|
gl.line(Vector2D(center.x - offset, center.y - gap - size), Vector2D(center.x + offset, center.y - gap - size));
|
||||||
if (cl_cross_outline_inner->value == 0.0f)
|
if (cl_cross_outline_inner->value == 0.0f)
|
||||||
{
|
{
|
||||||
gl.line(Vector2D(center.x + half_thickness, center.y - gap - size + half_width), Vector2D(center.x + half_thickness, center.y - gap));
|
gl.line(Vector2D(center.x + half_thickness, center.y - gap - size + outline_width), Vector2D(center.x + half_thickness, center.y - gap));
|
||||||
gl.line(Vector2D(center.x - half_thickness, center.y - gap), Vector2D(center.x - half_thickness, center.y - gap - size + half_width));
|
gl.line(Vector2D(center.x - half_thickness, center.y - gap), Vector2D(center.x - half_thickness, center.y - gap - size + outline_width));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gl.line(Vector2D(center.x + half_thickness, center.y - gap - size + half_width), Vector2D(center.x + half_thickness, center.y - gap - half_width));
|
gl.line(Vector2D(center.x + half_thickness, center.y - gap - size + outline_width), Vector2D(center.x + half_thickness, center.y - gap - outline_width));
|
||||||
gl.line(Vector2D(center.x + offset, center.y - gap), Vector2D(center.x - offset, center.y - gap));
|
gl.line(Vector2D(center.x + offset, center.y - gap), Vector2D(center.x - offset, center.y - gap));
|
||||||
gl.line(Vector2D(center.x - half_thickness, center.y - gap - half_width), Vector2D(center.x - half_thickness, center.y - gap - size + half_width));
|
gl.line(Vector2D(center.x - half_thickness, center.y - gap - outline_width), Vector2D(center.x - half_thickness, center.y - gap - size + outline_width));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,14 +136,14 @@ int CHudCrosshairs::Draw(float time)
|
||||||
gl.line(Vector2D(center.x - offset, center.y + gap + size), Vector2D(center.x + offset, center.y + gap + size));
|
gl.line(Vector2D(center.x - offset, center.y + gap + size), Vector2D(center.x + offset, center.y + gap + size));
|
||||||
if (cl_cross_outline_inner->value == 0.0f)
|
if (cl_cross_outline_inner->value == 0.0f)
|
||||||
{
|
{
|
||||||
gl.line(Vector2D(center.x + half_thickness, center.y + gap + size - half_width), Vector2D(center.x + half_thickness, center.y + gap));
|
gl.line(Vector2D(center.x + half_thickness, center.y + gap + size - outline_width), Vector2D(center.x + half_thickness, center.y + gap));
|
||||||
gl.line(Vector2D(center.x - half_thickness, center.y + gap), Vector2D(center.x - half_thickness, center.y + gap + size - half_width));
|
gl.line(Vector2D(center.x - half_thickness, center.y + gap), Vector2D(center.x - half_thickness, center.y + gap + size - outline_width));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gl.line(Vector2D(center.x + half_thickness, center.y + gap + size - half_width), Vector2D(center.x + half_thickness, center.y + gap + half_width));
|
gl.line(Vector2D(center.x + half_thickness, center.y + gap + size - outline_width), Vector2D(center.x + half_thickness, center.y + gap + outline_width));
|
||||||
gl.line(Vector2D(center.x + offset, center.y + gap), Vector2D(center.x - offset, center.y + gap));
|
gl.line(Vector2D(center.x + offset, center.y + gap), Vector2D(center.x - offset, center.y + gap));
|
||||||
gl.line(Vector2D(center.x - half_thickness, center.y + gap + half_width), Vector2D(center.x - half_thickness, center.y + gap + size - half_width));
|
gl.line(Vector2D(center.x - half_thickness, center.y + gap + outline_width), Vector2D(center.x - half_thickness, center.y + gap + size - outline_width));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,14 +152,14 @@ int CHudCrosshairs::Draw(float time)
|
||||||
gl.line(Vector2D(center.x - gap - size, center.y - offset), Vector2D(center.x - gap - size, center.y + offset));
|
gl.line(Vector2D(center.x - gap - size, center.y - offset), Vector2D(center.x - gap - size, center.y + offset));
|
||||||
if (cl_cross_outline_inner->value == 0.0f)
|
if (cl_cross_outline_inner->value == 0.0f)
|
||||||
{
|
{
|
||||||
gl.line(Vector2D(center.x - gap - size + half_width, center.y + half_thickness), Vector2D(center.x - gap, center.y + half_thickness));
|
gl.line(Vector2D(center.x - gap - size + outline_width, center.y + half_thickness), Vector2D(center.x - gap, center.y + half_thickness));
|
||||||
gl.line(Vector2D(center.x - gap, center.y - half_thickness), Vector2D(center.x - gap - size + half_width, center.y - half_thickness));
|
gl.line(Vector2D(center.x - gap, center.y - half_thickness), Vector2D(center.x - gap - size + outline_width, center.y - half_thickness));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gl.line(Vector2D(center.x - gap - size + half_width, center.y + half_thickness), Vector2D(center.x - gap - half_width, center.y + half_thickness));
|
gl.line(Vector2D(center.x - gap - size + outline_width, center.y + half_thickness), Vector2D(center.x - gap - outline_width, center.y + half_thickness));
|
||||||
gl.line(Vector2D(center.x - gap, center.y + offset), Vector2D(center.x - gap, center.y - offset));
|
gl.line(Vector2D(center.x - gap, center.y + offset), Vector2D(center.x - gap, center.y - offset));
|
||||||
gl.line(Vector2D(center.x - gap - half_width, center.y - half_thickness), Vector2D(center.x - gap - size + half_width, center.y - half_thickness));
|
gl.line(Vector2D(center.x - gap - outline_width, center.y - half_thickness), Vector2D(center.x - gap - size + outline_width, center.y - half_thickness));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,93 +168,141 @@ int CHudCrosshairs::Draw(float time)
|
||||||
gl.line(Vector2D(center.x + gap + size, center.y - offset), Vector2D(center.x + gap + size, center.y + offset));
|
gl.line(Vector2D(center.x + gap + size, center.y - offset), Vector2D(center.x + gap + size, center.y + offset));
|
||||||
if (cl_cross_outline_inner->value == 0.0f)
|
if (cl_cross_outline_inner->value == 0.0f)
|
||||||
{
|
{
|
||||||
gl.line(Vector2D(center.x + gap + size - half_width, center.y + half_thickness), Vector2D(center.x + gap, center.y + half_thickness));
|
gl.line(Vector2D(center.x + gap + size - outline_width, center.y + half_thickness), Vector2D(center.x + gap, center.y + half_thickness));
|
||||||
gl.line(Vector2D(center.x + gap, center.y - half_thickness), Vector2D(center.x + gap + size - half_width, center.y - half_thickness));
|
gl.line(Vector2D(center.x + gap, center.y - half_thickness), Vector2D(center.x + gap + size - outline_width, center.y - half_thickness));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gl.line(Vector2D(center.x + gap + size - half_width, center.y + half_thickness), Vector2D(center.x + gap + half_width, center.y + half_thickness));
|
gl.line(Vector2D(center.x + gap + size - outline_width, center.y + half_thickness), Vector2D(center.x + gap + outline_width, center.y + half_thickness));
|
||||||
gl.line(Vector2D(center.x + gap, center.y + offset), Vector2D(center.x + gap, center.y - offset));
|
gl.line(Vector2D(center.x + gap, center.y + offset), Vector2D(center.x + gap, center.y - offset));
|
||||||
gl.line(Vector2D(center.x + gap + half_width, center.y - half_thickness), Vector2D(center.x + gap + size - half_width, center.y - half_thickness));
|
gl.line(Vector2D(center.x + gap + outline_width, center.y - half_thickness), Vector2D(center.x + gap + size - outline_width, center.y - half_thickness));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char dotout;
|
float dotout;
|
||||||
if (sscanf(cl_cross_dot_outline->string, "%hhu", &dotout) != 1)
|
|
||||||
dotout = cl_cross_outline->value;
|
if (cl_cross_dot_outline->string[0] == 0)
|
||||||
|
{
|
||||||
|
dotout = cl_cross_outline->value * scalar;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
dotout = cl_cross_dot_outline->value * scalar;
|
||||||
|
}
|
||||||
// Dot outline
|
// Dot outline
|
||||||
if (cl_cross_dot_size->value > 0.0f && dotout > 0.0f) {
|
if (cl_cross_dot_size->value > 0.0f && dotout > 0.0f) {
|
||||||
unsigned char dotoutalpha;
|
unsigned char dotoutalpha;
|
||||||
if (sscanf(cl_cross_circle_outline_alpha->string, "%hhu", &dotoutalpha) != 1)
|
if (sscanf(cl_cross_dot_outline_alpha->string, "%hhu", &dotoutalpha) != 1)
|
||||||
dotoutalpha = alpha;
|
dotoutalpha = outalpha;
|
||||||
|
|
||||||
gl.color(0, 0, 0, dotoutalpha);
|
gl.color(0, 0, 0, dotoutalpha);
|
||||||
|
|
||||||
float size = cl_cross_dot_size->value;
|
float size = min(cl_cross_dot_size->value * scalar, ScreenHeight() * 0.2f);
|
||||||
Vector2D offset = Vector2D(size / 2.0f, size / 2.0f);
|
|
||||||
float dot_half_width = dotout / 2.0f;
|
if (cl_cross_dot_round->value)
|
||||||
|
{
|
||||||
|
size *= 0.5f;
|
||||||
|
if (old_round_dot_outline_radius != size || old_round_dot_outline_thickness != dotout) {
|
||||||
|
// Recompute the circle points.
|
||||||
|
round_dot_outline_points = HudGL::compute_circle(size + (dotout * 0.5f), dotout);
|
||||||
|
old_round_dot_outline_radius = size;
|
||||||
|
old_round_dot_outline_thickness = dotout;
|
||||||
|
}
|
||||||
|
|
||||||
gl.line(Vector2D(center.x - offset.x - dot_half_width, center.y - offset.y), Vector2D(center.x + offset.x + dot_half_width, center.y - offset.y));
|
gl.circle(center, round_dot_outline_points);
|
||||||
gl.line(Vector2D(center.x + offset.x, center.y - offset.y + dot_half_width), Vector2D(center.x + offset.x, center.y + offset.y - dot_half_width));
|
}
|
||||||
gl.line(Vector2D(center.x - offset.x, center.y - offset.y + dot_half_width), Vector2D(center.x - offset.x, center.y + offset.y - dot_half_width));
|
else
|
||||||
gl.line(Vector2D(center.x - offset.x - dot_half_width, center.y + offset.y), Vector2D(center.x + offset.x + dot_half_width, center.y + offset.y));
|
{
|
||||||
|
//TOFIX - Not a true outline, will be seen behind transparent dots
|
||||||
|
size += dotout * 2.0f;
|
||||||
|
Vector2D offset = Vector2D(size / 2.0f, size / 2.0f);
|
||||||
|
gl.rectangle(center - offset, center + offset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char circleout;
|
float circleout;
|
||||||
if (sscanf(cl_cross_circle_outline->string, "%hhu", &circleout) != 1)
|
if (cl_cross_circle_outline->string[0] == 0)
|
||||||
circleout = cl_cross_outline->value;
|
{
|
||||||
|
circleout = cl_cross_outline->value * scalar;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
circleout = cl_cross_circle_outline->value * scalar;
|
||||||
|
}
|
||||||
// Circle outline
|
// Circle outline
|
||||||
if (cl_cross_circle_radius->value > 0.0f && cl_cross_circle_thickness->value > 0.0f && circleout > 0.0f) {
|
if (cl_cross_circle_radius->value > 0.0f && cl_cross_circle_thickness->value > 0.0f && circleout > 0.0f) {
|
||||||
|
|
||||||
unsigned char circleoutalpha;
|
unsigned char circleoutalpha;
|
||||||
if (sscanf(cl_cross_circle_outline_alpha->string, "%hhu", &circleoutalpha) != 1)
|
if (sscanf(cl_cross_circle_outline_alpha->string, "%hhu", &circleoutalpha) != 1)
|
||||||
circleoutalpha = alpha;
|
circleoutalpha = outalpha;
|
||||||
unsigned char circleoutinner;
|
|
||||||
if (sscanf(cl_cross_circle_outline_inner->string, "%hhu", &circleoutinner) != 1)
|
bool circleoutinner = cl_cross_outline_inner->value;
|
||||||
circleoutinner = cl_cross_outline_inner->value;
|
|
||||||
|
|
||||||
gl.color(0, 0, 0, circleoutalpha);
|
gl.color(0, 0, 0, circleoutalpha);
|
||||||
|
|
||||||
auto radius = cl_cross_circle_radius->value;
|
auto radius = cl_cross_circle_radius->value * scalar;
|
||||||
|
|
||||||
if (circleoutinner == 0.0f)
|
float thickness;
|
||||||
|
|
||||||
|
if (!circleoutinner)
|
||||||
{
|
{
|
||||||
radius += (cl_cross_circle_thickness->value * 0.5f) + (circleout * 0.5f);
|
radius += cl_cross_circle_thickness->value * scalar * 0.5f;
|
||||||
gl.line_width(circleout);
|
thickness = circleout;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gl.line_width(cl_cross_circle_thickness->value + circleout);
|
//TOFIX - Not a true outline, will be seen behind transparent circles
|
||||||
|
thickness = cl_cross_circle_thickness->value * scalar + (circleout * 2.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (old_circle_radius != radius) {
|
if (old_circle_outline_radius != radius || old_circle_outline_thickness != thickness) {
|
||||||
// Recompute the circle points.
|
// Recompute the circle points.
|
||||||
circle_points = HudGL::compute_circle(radius);
|
circle_outline_points = HudGL::compute_circle(radius, thickness);
|
||||||
old_circle_radius = radius;
|
old_circle_outline_radius = radius;
|
||||||
|
old_circle_outline_thickness = thickness;
|
||||||
}
|
}
|
||||||
gl.circle(center, circle_points);
|
gl.circle(center, circle_outline_points);
|
||||||
}
|
}
|
||||||
|
|
||||||
gl.color(r, g, b, alpha);
|
gl.color(r, g, b, alpha);
|
||||||
|
|
||||||
// Draw the crosshairs.
|
// Draw the crosshairs.
|
||||||
if (cl_cross_thickness->value > 0.0f) {
|
if (cl_cross_thickness->value > 0.0f && cl_cross_size->value > 0.0f) {
|
||||||
//gl.line_width(cl_cross_thickness->value);
|
|
||||||
//clamp dot size to prevent using it as a full screen transparent mask for highlighting eneimies like with the /nvg night vision server plugin.
|
float size;
|
||||||
gl.line_width(min(cl_cross_thickness->value, ScreenHeight() * 0.3f));
|
float gap = cl_cross_gap->value * scalar;
|
||||||
|
|
||||||
float size = cl_cross_size->value;
|
// Box crosshair. This is needed since line thickness seems to cap out at 10 on my system.
|
||||||
float gap = cl_cross_gap->value;
|
if (cl_cross_thickness->value > cl_cross_size->value) {
|
||||||
|
gl.line_width(cl_cross_size->value * scalar);
|
||||||
|
float half_size = cl_cross_size->value * scalar * 0.5f;
|
||||||
|
float half_thickness = cl_cross_thickness->value * scalar * 0.5f;
|
||||||
|
|
||||||
|
if (cl_cross_line_top->value)
|
||||||
|
gl.line(Vector2D(center.x - half_thickness, center.y - gap - half_size), Vector2D(center.x + half_thickness, center.y - gap - half_size));
|
||||||
|
if (cl_cross_line_bottom->value)
|
||||||
|
gl.line(Vector2D(center.x - half_thickness, center.y + gap + half_size), Vector2D(center.x + half_thickness, center.y + gap + half_size));
|
||||||
|
if (cl_cross_line_left->value)
|
||||||
|
gl.line(Vector2D(center.x - gap - half_size, center.y + half_thickness), Vector2D(center.x - gap - half_size, center.y - half_thickness));
|
||||||
|
if (cl_cross_line_right->value)
|
||||||
|
gl.line(Vector2D(center.x + gap + half_size, center.y + half_thickness), Vector2D(center.x + gap + half_size, center.y - half_thickness));
|
||||||
|
}
|
||||||
|
// Normal cross.
|
||||||
|
else {
|
||||||
|
gl.line_width(cl_cross_thickness->value * scalar);
|
||||||
|
size = cl_cross_size->value * scalar;
|
||||||
|
|
||||||
|
if (cl_cross_line_top->value)
|
||||||
|
gl.line(Vector2D(center.x, center.y - gap - size), Vector2D(center.x, center.y - gap));
|
||||||
|
if (cl_cross_line_bottom->value)
|
||||||
|
gl.line(Vector2D(center.x, center.y + gap + size), Vector2D(center.x, center.y + gap));
|
||||||
|
if (cl_cross_line_left->value)
|
||||||
|
gl.line(Vector2D(center.x - gap - size, center.y), Vector2D(center.x - gap, center.y));
|
||||||
|
if (cl_cross_line_right->value)
|
||||||
|
gl.line(Vector2D(center.x + gap + size, center.y), Vector2D(center.x + gap, center.y));
|
||||||
|
}
|
||||||
|
|
||||||
if (cl_cross_line_top->value)
|
|
||||||
gl.line(Vector2D(center.x, center.y - gap - size), Vector2D(center.x, center.y - gap));
|
|
||||||
if (cl_cross_line_bottom->value)
|
|
||||||
gl.line(Vector2D(center.x, center.y + gap + size), Vector2D(center.x, center.y + gap));
|
|
||||||
if (cl_cross_line_left->value)
|
|
||||||
gl.line(Vector2D(center.x - gap - size, center.y), Vector2D(center.x - gap, center.y));
|
|
||||||
if (cl_cross_line_right->value)
|
|
||||||
gl.line(Vector2D(center.x + gap + size, center.y), Vector2D(center.x + gap, center.y));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the circle.
|
// Draw the circle.
|
||||||
|
@ -249,14 +320,14 @@ int CHudCrosshairs::Draw(float time)
|
||||||
{
|
{
|
||||||
gl.color(r, g, b, circlealpha);
|
gl.color(r, g, b, circlealpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
gl.line_width(cl_cross_circle_thickness->value);
|
|
||||||
|
|
||||||
float radius = cl_cross_circle_radius->value;
|
float radius = cl_cross_circle_radius->value * scalar;
|
||||||
if (old_circle_radius != radius) {
|
float thickness = cl_cross_circle_thickness->value * scalar;
|
||||||
|
if (old_circle_radius != radius || old_circle_thickness != thickness) {
|
||||||
// Recompute the circle points.
|
// Recompute the circle points.
|
||||||
circle_points = HudGL::compute_circle(radius);
|
circle_points = HudGL::compute_circle(radius, thickness);
|
||||||
old_circle_radius = radius;
|
old_circle_radius = radius;
|
||||||
|
old_circle_thickness = thickness;
|
||||||
}
|
}
|
||||||
|
|
||||||
gl.circle(center, circle_points);
|
gl.circle(center, circle_points);
|
||||||
|
@ -278,12 +349,26 @@ int CHudCrosshairs::Draw(float time)
|
||||||
gl.color(r, g, b, dotalpha);
|
gl.color(r, g, b, dotalpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
//float size = cl_cross_dot_size->value;
|
//float size = cl_cross_dot_size->value * scalar;
|
||||||
//clamp dot size to prevent using it as a full screen transparent mask for highlighting eneimies like with the /nvg night vision server plugin.
|
//clamp dot size to prevent using it as a full screen transparent mask for highlighting eneimies like with the /nvg night vision server plugin.
|
||||||
float size = min(cl_cross_dot_size->value, ScreenHeight() * 0.2f);
|
float size = min(cl_cross_dot_size->value * scalar, ScreenHeight() * 0.2f);
|
||||||
Vector2D offset = Vector2D(size / 2.0f, size / 2.0f);
|
Vector2D offset = Vector2D(size / 2.0f, size / 2.0f);
|
||||||
|
|
||||||
gl.rectangle(center - offset, center + offset);
|
if (cl_cross_dot_round->value)
|
||||||
|
{
|
||||||
|
size *= 0.5f;
|
||||||
|
if (old_round_dot_radius != size) {
|
||||||
|
// Recompute the circle points.
|
||||||
|
round_dot_points = HudGL::compute_circle(size);
|
||||||
|
old_round_dot_radius = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
gl.round_dot(center, round_dot_points);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gl.rectangle(center - offset, center + offset);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -27,13 +27,24 @@ class CHudCrosshairs : public CHudBase
|
||||||
cvar_t* cl_cross_dot_alpha;
|
cvar_t* cl_cross_dot_alpha;
|
||||||
cvar_t* cl_cross_dot_outline;
|
cvar_t* cl_cross_dot_outline;
|
||||||
cvar_t* cl_cross_dot_outline_alpha;
|
cvar_t* cl_cross_dot_outline_alpha;
|
||||||
|
cvar_t* cl_cross_dot_round;
|
||||||
cvar_t* cl_cross_line_top;
|
cvar_t* cl_cross_line_top;
|
||||||
cvar_t* cl_cross_line_bottom;
|
cvar_t* cl_cross_line_bottom;
|
||||||
cvar_t* cl_cross_line_left;
|
cvar_t* cl_cross_line_left;
|
||||||
cvar_t* cl_cross_line_right;
|
cvar_t* cl_cross_line_right;
|
||||||
|
cvar_t* cl_cross_scaling;
|
||||||
|
|
||||||
float old_circle_radius;
|
float old_circle_radius;
|
||||||
|
float old_circle_thickness;
|
||||||
std::vector<Vector2D> circle_points;
|
std::vector<Vector2D> circle_points;
|
||||||
|
float old_circle_outline_radius;
|
||||||
|
float old_circle_outline_thickness;
|
||||||
|
std::vector<Vector2D> circle_outline_points;
|
||||||
|
float old_round_dot_radius;
|
||||||
|
std::vector<Vector2D> round_dot_points;
|
||||||
|
float old_round_dot_outline_radius;
|
||||||
|
float old_round_dot_outline_thickness;
|
||||||
|
std::vector<Vector2D> round_dot_outline_points;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual int Init();
|
virtual int Init();
|
||||||
|
|
|
@ -21,9 +21,13 @@
|
||||||
#include "mod/AvHFont.h"
|
#include "mod/AvHFont.h"
|
||||||
|
|
||||||
#include "vgui_TeamFortressViewport.h"
|
#include "vgui_TeamFortressViewport.h"
|
||||||
|
#include "common/com_model.h"
|
||||||
|
//#include "r_studioint.h"
|
||||||
|
|
||||||
#define MAX_LOGO_FRAMES 56
|
#define MAX_LOGO_FRAMES 56
|
||||||
|
|
||||||
|
//extern engine_studio_api_t IEngineStudio;
|
||||||
|
|
||||||
int grgLogoFrame[MAX_LOGO_FRAMES] =
|
int grgLogoFrame[MAX_LOGO_FRAMES] =
|
||||||
{
|
{
|
||||||
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 13, 13, 13, 13, 13, 12, 11, 10, 9, 8, 14, 15,
|
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 13, 13, 13, 13, 13, 12, 11, 10, 9, 8, 14, 15,
|
||||||
|
@ -106,6 +110,22 @@ int CHud :: Redraw( float flTime, int intermission )
|
||||||
if ( m_flTimeDelta < 0 )
|
if ( m_flTimeDelta < 0 )
|
||||||
m_flTimeDelta = 0;
|
m_flTimeDelta = 0;
|
||||||
|
|
||||||
|
bool bWantWidescreen = m_pCvarWidescreen->value != 0.0F;
|
||||||
|
|
||||||
|
if (bWantWidescreen != m_bIsWidescreen)
|
||||||
|
{
|
||||||
|
if (bWantWidescreen)
|
||||||
|
{
|
||||||
|
m_iConWidth = m_iConHeight * (ScreenWidth() / (float)ScreenHeight());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_iConWidth = m_iRes;
|
||||||
|
}
|
||||||
|
m_flOffsetX = (ScreenWidth() - m_iConWidth * m_flScaleX) / 2.0F;
|
||||||
|
m_bIsWidescreen = bWantWidescreen;
|
||||||
|
}
|
||||||
|
|
||||||
// Bring up the scoreboard during intermission
|
// Bring up the scoreboard during intermission
|
||||||
if (gViewPort)
|
if (gViewPort)
|
||||||
{
|
{
|
||||||
|
@ -318,22 +338,261 @@ int CHud :: DrawHudStringReverse( int xpos, int ypos, int iMinX, char *szString,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int CHud :: DrawHudNumber( int x, int y, int iFlags, int iNumber, int r, int g, int b)
|
//// Old metod before scaling.
|
||||||
|
//int CHud :: DrawHudNumber( int x, int y, int iFlags, int iNumber, int r, int g, int b)
|
||||||
|
//{
|
||||||
|
// int iWidth = GetSpriteRect(m_HUD_number_0).right - GetSpriteRect(m_HUD_number_0).left;
|
||||||
|
// int k;
|
||||||
|
//
|
||||||
|
// if (iNumber > 0)
|
||||||
|
// {
|
||||||
|
// // SPR_Draw 100's
|
||||||
|
// if (iNumber >= 100)
|
||||||
|
// {
|
||||||
|
// k = iNumber/100;
|
||||||
|
// SPR_Set(GetSprite(m_HUD_number_0 + k), r, g, b );
|
||||||
|
// SPR_DrawAdditive( 0, x, y, &GetSpriteRect(m_HUD_number_0 + k));
|
||||||
|
// x += iWidth;
|
||||||
|
// }
|
||||||
|
// else if (iFlags & (DHN_3DIGITS))
|
||||||
|
// {
|
||||||
|
// //SPR_DrawAdditive( 0, x, y, &rc );
|
||||||
|
// x += iWidth;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // SPR_Draw 10's
|
||||||
|
// if (iNumber >= 10)
|
||||||
|
// {
|
||||||
|
// k = (iNumber % 100)/10;
|
||||||
|
// SPR_Set(GetSprite(m_HUD_number_0 + k), r, g, b );
|
||||||
|
// SPR_DrawAdditive( 0, x, y, &GetSpriteRect(m_HUD_number_0 + k));
|
||||||
|
// x += iWidth;
|
||||||
|
// }
|
||||||
|
// else if (iFlags & (DHN_3DIGITS | DHN_2DIGITS))
|
||||||
|
// {
|
||||||
|
// //SPR_DrawAdditive( 0, x, y, &rc );
|
||||||
|
// x += iWidth;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // SPR_Draw ones
|
||||||
|
// k = iNumber % 10;
|
||||||
|
// SPR_Set(GetSprite(m_HUD_number_0 + k), r, g, b );
|
||||||
|
// SPR_DrawAdditive(0, x, y, &GetSpriteRect(m_HUD_number_0 + k));
|
||||||
|
// x += iWidth;
|
||||||
|
// }
|
||||||
|
// else if (iFlags & DHN_DRAWZERO)
|
||||||
|
// {
|
||||||
|
// SPR_Set(GetSprite(m_HUD_number_0), r, g, b );
|
||||||
|
//
|
||||||
|
// // SPR_Draw 100's
|
||||||
|
// if (iFlags & (DHN_3DIGITS))
|
||||||
|
// {
|
||||||
|
// //SPR_DrawAdditive( 0, x, y, &rc );
|
||||||
|
// x += iWidth;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (iFlags & (DHN_3DIGITS | DHN_2DIGITS))
|
||||||
|
// {
|
||||||
|
// //SPR_DrawAdditive( 0, x, y, &rc );
|
||||||
|
// x += iWidth;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // SPR_Draw ones
|
||||||
|
//
|
||||||
|
// SPR_DrawAdditive( 0, x, y, &GetSpriteRect(m_HUD_number_0));
|
||||||
|
// x += iWidth;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return x;
|
||||||
|
//}
|
||||||
|
|
||||||
|
// Toodles' sprite scaling with additional scaling option added.
|
||||||
|
void CHud::DrawHudSprite(AVHHSPRITE pic, int frame, wrect_t * rect, int x, int y, int r, int g, int b, int a, float scale, hudalign_e alignment)
|
||||||
{
|
{
|
||||||
int iWidth = GetSpriteRect(m_HUD_number_0).right - GetSpriteRect(m_HUD_number_0).left;
|
auto sprw = gEngfuncs.pfnSPR_Width(pic, frame);
|
||||||
|
auto sprh = gEngfuncs.pfnSPR_Height(pic, frame);
|
||||||
|
|
||||||
|
if (!rect)
|
||||||
|
{
|
||||||
|
static wrect_t rc;
|
||||||
|
rc.left = 0;
|
||||||
|
rc.right = sprw;
|
||||||
|
rc.top = 0;
|
||||||
|
rc.bottom = sprh;
|
||||||
|
rect = &rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
float xf = x;
|
||||||
|
float yf = y;
|
||||||
|
auto width = (rect->right - rect->left) * scale;
|
||||||
|
auto height = (rect->bottom - rect->top) * scale;
|
||||||
|
|
||||||
|
switch (alignment)
|
||||||
|
{
|
||||||
|
case a_north:
|
||||||
|
case a_center:
|
||||||
|
case a_south:
|
||||||
|
xf -= width / 2.0F - 0.5F;
|
||||||
|
break;
|
||||||
|
case a_northeast:
|
||||||
|
case a_east:
|
||||||
|
case a_southeast:
|
||||||
|
xf -= width;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (alignment)
|
||||||
|
{
|
||||||
|
case a_west:
|
||||||
|
case a_center:
|
||||||
|
case a_east:
|
||||||
|
yf -= height / 2.0F - 0.5F;
|
||||||
|
break;
|
||||||
|
case a_southwest:
|
||||||
|
case a_south:
|
||||||
|
case a_southeast:
|
||||||
|
yf -= height;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//// No software mode in NS.
|
||||||
|
//if (!IEngineStudio.IsHardware())
|
||||||
|
//{
|
||||||
|
// x += m_flOffsetX;
|
||||||
|
// y += m_flOffsetY;
|
||||||
|
|
||||||
|
// ScaleColors(r, g, b, a);
|
||||||
|
// gEngfuncs.pfnSPR_Set(pic, r, g, b);
|
||||||
|
|
||||||
|
// // Toodles FIXME: Hack for the crosshair.
|
||||||
|
// if (alignment == a_center)
|
||||||
|
// {
|
||||||
|
// gEngfuncs.pfnSPR_DrawHoles(frame, x, y, rect);
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// gEngfuncs.pfnSPR_DrawAdditive(frame, x, y, rect);
|
||||||
|
// }
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
|
||||||
|
auto pSprite = const_cast<model_t*>(gEngfuncs.GetSpritePointer(pic));
|
||||||
|
|
||||||
|
auto x1 = roundf(m_flOffsetX + xf * m_flScaleX);
|
||||||
|
auto y1 = roundf(m_flOffsetY + yf * m_flScaleY);
|
||||||
|
auto x2 = roundf(m_flOffsetX + (xf + width) * m_flScaleX);
|
||||||
|
auto y2 = roundf(m_flOffsetY + (yf + height) * m_flScaleY);
|
||||||
|
|
||||||
|
auto left = rect->left / (float)sprw;
|
||||||
|
auto right = rect->right / (float)sprw;
|
||||||
|
auto top = rect->top / (float)sprh;
|
||||||
|
auto bottom = rect->bottom / (float)sprh;
|
||||||
|
|
||||||
|
gEngfuncs.pTriAPI->SpriteTexture(pSprite, frame);
|
||||||
|
|
||||||
|
auto rendermode = kRenderTransAdd;
|
||||||
|
|
||||||
|
// Toodles FIXME: Hack for the crosshair.
|
||||||
|
if (alignment == a_center)
|
||||||
|
{
|
||||||
|
rendermode = kRenderTransAlpha;
|
||||||
|
}
|
||||||
|
|
||||||
|
gEngfuncs.pTriAPI->Color4fRendermode(r / 255.0F, g / 255.0F, b / 255.0F, a / 255.0F, rendermode);
|
||||||
|
gEngfuncs.pTriAPI->RenderMode(rendermode);
|
||||||
|
|
||||||
|
gEngfuncs.pTriAPI->Begin(TRI_QUADS);
|
||||||
|
|
||||||
|
gEngfuncs.pTriAPI->TexCoord2f(left, top);
|
||||||
|
gEngfuncs.pTriAPI->Vertex3f(x1, y1, 0);
|
||||||
|
|
||||||
|
gEngfuncs.pTriAPI->TexCoord2f(right, top);
|
||||||
|
gEngfuncs.pTriAPI->Vertex3f(x2, y1, 0);
|
||||||
|
|
||||||
|
gEngfuncs.pTriAPI->TexCoord2f(right, bottom);
|
||||||
|
gEngfuncs.pTriAPI->Vertex3f(x2, y2, 0);
|
||||||
|
|
||||||
|
gEngfuncs.pTriAPI->TexCoord2f(left, bottom);
|
||||||
|
gEngfuncs.pTriAPI->Vertex3f(x1, y2, 0);
|
||||||
|
|
||||||
|
gEngfuncs.pTriAPI->End();
|
||||||
|
gEngfuncs.pTriAPI->RenderMode(kRenderNormal);
|
||||||
|
}
|
||||||
|
|
||||||
|
//void CHud::DrawHudSprite(AVHHSPRITE pic, int frame, wrect_t* rect, int x, int y, hudcolor_e color, int a, hudalign_e alignment)
|
||||||
|
//{
|
||||||
|
// int r, g, b;
|
||||||
|
// GetColor(r, g, b, color);
|
||||||
|
// DrawHudSprite(pic, frame, rect, x, y, r, g, b, a, alignment);
|
||||||
|
//}
|
||||||
|
|
||||||
|
void CHud::DrawHudSpriteIndex(int index, int x, int y, int r, int g, int b, int a, float scale, hudalign_e alignment)
|
||||||
|
{
|
||||||
|
DrawHudSprite(GetSprite(index), 0, &GetSpriteRect(index), x, y, r, g, b, a, scale, alignment);
|
||||||
|
}
|
||||||
|
|
||||||
|
//void CHud::DrawHudSpriteIndex(int index, int x, int y, hudcolor_e color, int a, hudalign_e alignment)
|
||||||
|
//{
|
||||||
|
// int r, g, b;
|
||||||
|
// GetColor(r, g, b, color);
|
||||||
|
// DrawHudSprite(GetSprite(index), 0, &GetSpriteRect(index), x, y, r, g, b, a, alignment);
|
||||||
|
//}
|
||||||
|
|
||||||
|
void CHud::DrawHudFill(int x, int y, int w, int h, int r, int g, int b, int a, float scale)
|
||||||
|
{
|
||||||
|
x = roundf(m_flOffsetX + x * m_flScaleX);
|
||||||
|
y = roundf(m_flOffsetY + y * m_flScaleY);
|
||||||
|
w = roundf(w * m_flScaleX * scale);
|
||||||
|
h = roundf(h * m_flScaleY * scale);
|
||||||
|
|
||||||
|
gEngfuncs.pfnFillRGBA(x, y, w, h, r, g, b, a);
|
||||||
|
}
|
||||||
|
|
||||||
|
//void CHud::DrawHudFill(int x, int y, int w, int h, hudcolor_e color, int a)
|
||||||
|
//{
|
||||||
|
// int r, g, b;
|
||||||
|
// GetColor(r, g, b, color);
|
||||||
|
// DrawHudFill(x, y, w, h, r, g, b, a);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//int CHud::DrawHudString(int xpos, int ypos, int iMaxX, const char* szIt, int r, int g, int b)
|
||||||
|
//{
|
||||||
|
// auto x1 = roundf(m_flOffsetX + xpos * m_flScaleX);
|
||||||
|
// auto y1 = roundf(m_flOffsetY + ypos * m_flScaleY);
|
||||||
|
// return (gEngfuncs.pfnDrawString(x1, y1, szIt, r, g, b) - m_flOffsetX) / m_flScaleX;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//// draws a string from right to left (right-aligned)
|
||||||
|
//int CHud::DrawHudStringReverse(int xpos, int ypos, int iMinX, const char* szString, int r, int g, int b)
|
||||||
|
//{
|
||||||
|
// auto x1 = roundf(m_flOffsetX + xpos * m_flScaleX);
|
||||||
|
// auto y1 = roundf(m_flOffsetY + ypos * m_flScaleY);
|
||||||
|
// return (gEngfuncs.pfnDrawStringReverse(x1, y1, szString, r, g, b) - m_flOffsetX) / m_flScaleX;
|
||||||
|
//}
|
||||||
|
|
||||||
|
int CHud::DrawHudNumber(int x, int y, int iFlags, int iNumber, int r, int g, int b, int a, float scale, hudalign_e alignment)
|
||||||
|
{
|
||||||
|
int iWidth = (GetSpriteRect(m_HUD_number_0).right - GetSpriteRect(m_HUD_number_0).left) * scale;
|
||||||
int k;
|
int k;
|
||||||
|
|
||||||
if (iNumber > 0)
|
if (iNumber > 0)
|
||||||
{
|
{
|
||||||
|
// Draw 1000's
|
||||||
|
if (iNumber >= 1000)
|
||||||
|
{
|
||||||
|
k = iNumber / 1000;
|
||||||
|
DrawHudSpriteIndex(m_HUD_number_0 + k, x, y, r, g, b, a, scale, alignment);
|
||||||
|
x += iWidth;
|
||||||
|
}
|
||||||
|
|
||||||
// SPR_Draw 100's
|
// SPR_Draw 100's
|
||||||
if (iNumber >= 100)
|
if (iNumber >= 100)
|
||||||
{
|
{
|
||||||
k = iNumber/100;
|
k = (iNumber % 1000) / 100;
|
||||||
SPR_Set(GetSprite(m_HUD_number_0 + k), r, g, b );
|
DrawHudSpriteIndex(m_HUD_number_0 + k, x, y, r, g, b, a, scale, alignment);
|
||||||
SPR_DrawAdditive( 0, x, y, &GetSpriteRect(m_HUD_number_0 + k));
|
|
||||||
x += iWidth;
|
x += iWidth;
|
||||||
}
|
}
|
||||||
else if (iFlags & (DHN_3DIGITS))
|
else if ((iFlags & DHN_3DIGITS) != 0)
|
||||||
{
|
{
|
||||||
//SPR_DrawAdditive( 0, x, y, &rc );
|
//SPR_DrawAdditive( 0, x, y, &rc );
|
||||||
x += iWidth;
|
x += iWidth;
|
||||||
|
@ -342,12 +601,11 @@ int CHud :: DrawHudNumber( int x, int y, int iFlags, int iNumber, int r, int g,
|
||||||
// SPR_Draw 10's
|
// SPR_Draw 10's
|
||||||
if (iNumber >= 10)
|
if (iNumber >= 10)
|
||||||
{
|
{
|
||||||
k = (iNumber % 100)/10;
|
k = (iNumber % 100) / 10;
|
||||||
SPR_Set(GetSprite(m_HUD_number_0 + k), r, g, b );
|
DrawHudSpriteIndex(m_HUD_number_0 + k, x, y, r, g, b, a, scale, alignment);
|
||||||
SPR_DrawAdditive( 0, x, y, &GetSpriteRect(m_HUD_number_0 + k));
|
|
||||||
x += iWidth;
|
x += iWidth;
|
||||||
}
|
}
|
||||||
else if (iFlags & (DHN_3DIGITS | DHN_2DIGITS))
|
else if ((iFlags & (DHN_3DIGITS | DHN_2DIGITS)) != 0)
|
||||||
{
|
{
|
||||||
//SPR_DrawAdditive( 0, x, y, &rc );
|
//SPR_DrawAdditive( 0, x, y, &rc );
|
||||||
x += iWidth;
|
x += iWidth;
|
||||||
|
@ -355,36 +613,39 @@ int CHud :: DrawHudNumber( int x, int y, int iFlags, int iNumber, int r, int g,
|
||||||
|
|
||||||
// SPR_Draw ones
|
// SPR_Draw ones
|
||||||
k = iNumber % 10;
|
k = iNumber % 10;
|
||||||
SPR_Set(GetSprite(m_HUD_number_0 + k), r, g, b );
|
DrawHudSpriteIndex(m_HUD_number_0 + k, x, y, r, g, b, a, scale, alignment);
|
||||||
SPR_DrawAdditive(0, x, y, &GetSpriteRect(m_HUD_number_0 + k));
|
|
||||||
x += iWidth;
|
x += iWidth;
|
||||||
}
|
}
|
||||||
else if (iFlags & DHN_DRAWZERO)
|
else if ((iFlags & DHN_DRAWZERO) != 0)
|
||||||
{
|
{
|
||||||
SPR_Set(GetSprite(m_HUD_number_0), r, g, b );
|
|
||||||
|
|
||||||
// SPR_Draw 100's
|
// SPR_Draw 100's
|
||||||
if (iFlags & (DHN_3DIGITS))
|
if ((iFlags & DHN_3DIGITS) != 0)
|
||||||
{
|
{
|
||||||
//SPR_DrawAdditive( 0, x, y, &rc );
|
//SPR_DrawAdditive( 0, x, y, &rc );
|
||||||
x += iWidth;
|
x += iWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iFlags & (DHN_3DIGITS | DHN_2DIGITS))
|
if ((iFlags & (DHN_3DIGITS | DHN_2DIGITS)) != 0)
|
||||||
{
|
{
|
||||||
//SPR_DrawAdditive( 0, x, y, &rc );
|
//SPR_DrawAdditive( 0, x, y, &rc );
|
||||||
x += iWidth;
|
x += iWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SPR_Draw ones
|
// SPR_Draw ones
|
||||||
|
|
||||||
SPR_DrawAdditive( 0, x, y, &GetSpriteRect(m_HUD_number_0));
|
DrawHudSpriteIndex(m_HUD_number_0, x, y, r, g, b, a, scale, alignment);
|
||||||
x += iWidth;
|
x += iWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//int CHud::DrawHudNumber(int x, int y, int iFlags, int iNumber, hudcolor_e color, int a, hudalign_e alignment)
|
||||||
|
//{
|
||||||
|
// int r, g, b;
|
||||||
|
// GetColor(r, g, b, color);
|
||||||
|
// return DrawHudNumber(x, y, iFlags, iNumber, r, g, b, a, alignment);
|
||||||
|
//}
|
||||||
|
|
||||||
int CHud::GetNumWidth( int iNumber, int iFlags )
|
int CHud::GetNumWidth( int iNumber, int iFlags )
|
||||||
{
|
{
|
||||||
|
@ -412,4 +673,81 @@ int CHud::GetNumWidth( int iNumber, int iFlags )
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int CHud::GetHudNumberWidth(int number, int width, int flags, float scale)
|
||||||
|
{
|
||||||
|
const int digitWidth = (GetSpriteRect(m_HUD_number_0).right - GetSpriteRect(m_HUD_number_0).left) * scale;
|
||||||
|
|
||||||
|
int totalDigits = 0;
|
||||||
|
|
||||||
|
if (number > 0)
|
||||||
|
{
|
||||||
|
totalDigits = static_cast<int>(log10(number)) + 1;
|
||||||
|
}
|
||||||
|
else if ((flags & DHN_DRAWZERO) != 0)
|
||||||
|
{
|
||||||
|
totalDigits = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
totalDigits = max(totalDigits, width);
|
||||||
|
|
||||||
|
return totalDigits * digitWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
int CHud::DrawHudNumberReverse(int x, int y, int number, int flags, int r, int g, int b, int a, float scale, hudalign_e alignment)
|
||||||
|
{
|
||||||
|
if (number > 0 || (flags & DHN_DRAWZERO) != 0)
|
||||||
|
{
|
||||||
|
const int digitWidth = (GetSpriteRect(m_HUD_number_0).right - GetSpriteRect(m_HUD_number_0).left) * scale;
|
||||||
|
|
||||||
|
int remainder = number;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
const int digit = remainder % 10;
|
||||||
|
const int digitSpriteIndex = m_HUD_number_0 + digit;
|
||||||
|
|
||||||
|
//This has to happen *before* drawing because we're drawing in reverse
|
||||||
|
x -= digitWidth;
|
||||||
|
|
||||||
|
DrawHudSpriteIndex(digitSpriteIndex, x, y, r, g, b, a, scale, alignment);
|
||||||
|
|
||||||
|
remainder /= 10;
|
||||||
|
} while (remainder > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
//int CHud::DrawHudNumberReverse(int x, int y, int number, int flags, hudcolor_e color, int a, hudalign_e alignment)
|
||||||
|
//{
|
||||||
|
// int r, g, b;
|
||||||
|
// GetColor(r, g, b, color);
|
||||||
|
// return DrawHudNumberReverse(x, y, number, flags, r, g, b, a, alignment);
|
||||||
|
//}
|
||||||
|
|
||||||
|
//int CHud::DrawHudString(const char* string, int x, int y)
|
||||||
|
//{
|
||||||
|
// auto x1 = roundf (m_flOffsetX + x * m_flScaleX);
|
||||||
|
// auto y1 = roundf (m_flOffsetY + y * m_flScaleY);
|
||||||
|
// return (gEngfuncs.pfnDrawConsoleString(x1, y1, (char*)string) - m_flOffsetX) / m_flScaleX;
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//void CHud::GetHudStringSize(const char* string, int& width, int& height)
|
||||||
|
//{
|
||||||
|
// gEngfuncs.pfnDrawConsoleStringLen(string, &width, &height);
|
||||||
|
// width /= m_flScaleX;
|
||||||
|
// height /= m_flScaleY;
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//int CHud::HudStringLen(const char* string)
|
||||||
|
//{
|
||||||
|
// int width, height;
|
||||||
|
// GetHudStringSize(string, width, height);
|
||||||
|
// return width;
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//void CHud::GetChatInputPosition(int& x, int& y)
|
||||||
|
//{
|
||||||
|
// x = roundf (m_flOffsetX + m_SayText.m_iBaseX * m_flScaleX);
|
||||||
|
// y = roundf (m_flOffsetY + (m_SayText.m_iBaseY + m_SayText.m_iLineHeight) * m_flScaleY);
|
||||||
|
//}
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
#include "vgui_TeamFortressViewport.h"
|
#include "vgui_TeamFortressViewport.h"
|
||||||
#include "vgui_SpectatorPanel.h"
|
#include "vgui_SpectatorPanel.h"
|
||||||
#include "common/hltv.h"
|
#include "common/hltv.h"
|
||||||
|
#include "AvHServerVariables.h"
|
||||||
|
#include "ammohistory.h"
|
||||||
|
|
||||||
#include "pm_shared/pm_shared.h"
|
#include "pm_shared/pm_shared.h"
|
||||||
#include "pm_shared/pm_defs.h"
|
#include "pm_shared/pm_defs.h"
|
||||||
|
@ -492,7 +494,7 @@ int CHudSpectator::Draw(float flTime)
|
||||||
|
|
||||||
bool CHudSpectator::IsInOverviewMode() const
|
bool CHudSpectator::IsInOverviewMode() const
|
||||||
{
|
{
|
||||||
return g_iUser1 && m_overviewMode && gHUD.GetIsNSMode();
|
return g_iUser1 && m_overviewMode && gHUD.GetIsNSMode() /*&& g_iUser1 != OBS_ROAMING*/;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHudSpectator::SetOverviewMode(bool overviewMode)
|
void CHudSpectator::SetOverviewMode(bool overviewMode)
|
||||||
|
@ -561,7 +563,7 @@ void CHudSpectator::DrawOverviewMap()
|
||||||
gEngfuncs.pTriAPI->CullFace(TRI_NONE);
|
gEngfuncs.pTriAPI->CullFace(TRI_NONE);
|
||||||
|
|
||||||
gEngfuncs.pTriAPI->SpriteTexture((struct model_s*)(gEngfuncs.GetSpritePointer(m_hsprWhite)), 0);
|
gEngfuncs.pTriAPI->SpriteTexture((struct model_s*)(gEngfuncs.GetSpritePointer(m_hsprWhite)), 0);
|
||||||
float gammaScale = 1.0f / gHUD.GetGammaSlope();
|
float gammaScale = 1.0f/* / gHUD.GetGammaSlope()*/;
|
||||||
|
|
||||||
// Draw the background.
|
// Draw the background.
|
||||||
|
|
||||||
|
@ -853,58 +855,41 @@ void CHudSpectator::HandleButtonsDown( int ButtonPressed )
|
||||||
|
|
||||||
int theNewMainMode = g_iUser1;
|
int theNewMainMode = g_iUser1;
|
||||||
|
|
||||||
// Jump changes main window modes
|
// Crouch toggles the overview mode
|
||||||
|
if (gHUD.GetIsNSMode() && ButtonPressed & IN_DUCK)
|
||||||
|
{
|
||||||
|
bool theInOverviewMode = gHUD.m_Spectator.IsInOverviewMode();
|
||||||
|
gHUD.m_Spectator.SetOverviewMode(!theInOverviewMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Jump changes spectator modes
|
||||||
if ( ButtonPressed & IN_JUMP )
|
if ( ButtonPressed & IN_JUMP )
|
||||||
{
|
{
|
||||||
bool theFirstPerson = (g_iUser1 == OBS_IN_EYE);
|
theNewMainMode++;
|
||||||
bool theInOverviewMode = gHUD.m_Spectator.IsInOverviewMode();
|
|
||||||
|
|
||||||
// NS
|
AvHPlayMode CurrPlayMode = gHUD.GetPlayMode();
|
||||||
if(gHUD.GetIsNSMode())
|
|
||||||
{
|
float FreeSpecMode = gHUD.GetServerVariableFloat(kvFreeSpectatorMode);
|
||||||
// First-person full -> chase camera full -> firstperson with overview -> chase camera with overview
|
if (FreeSpecMode == 0 || (FreeSpecMode == 1 && gHUD.GetPlayMode() != PLAYMODE_OBSERVER))
|
||||||
if(theFirstPerson && !theInOverviewMode)
|
{
|
||||||
{
|
while (theNewMainMode == OBS_CHASE_FREE || theNewMainMode == OBS_ROAMING)
|
||||||
gHUD.m_Spectator.SetMode(OBS_CHASE_LOCKED);
|
{
|
||||||
//gHUD.m_Spectator.SetOverviewMode(false);
|
theNewMainMode++;
|
||||||
}
|
}
|
||||||
else if(!theFirstPerson && !theInOverviewMode)
|
}
|
||||||
{
|
|
||||||
gHUD.m_Spectator.SetMode(OBS_IN_EYE);
|
if (theNewMainMode > OBS_IN_EYE)
|
||||||
gHUD.m_Spectator.SetOverviewMode(true);
|
{
|
||||||
}
|
theNewMainMode = OBS_CHASE_LOCKED;
|
||||||
else if(theFirstPerson && theInOverviewMode)
|
}
|
||||||
{
|
|
||||||
gHUD.m_Spectator.SetMode(OBS_CHASE_LOCKED);
|
gHUD.m_Spectator.SetMode(theNewMainMode);
|
||||||
//gHUD.m_Spectator.SetOverviewMode(true);
|
|
||||||
}
|
|
||||||
else if(!theFirstPerson && theInOverviewMode)
|
|
||||||
{
|
|
||||||
gHUD.m_Spectator.SetMode(OBS_IN_EYE);
|
|
||||||
gHUD.m_Spectator.SetOverviewMode(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Combat
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// First-person full -> chase camera full
|
|
||||||
if(theFirstPerson)
|
|
||||||
{
|
|
||||||
gHUD.m_Spectator.SetMode(OBS_CHASE_LOCKED);
|
|
||||||
gHUD.m_Spectator.SetOverviewMode(false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gHUD.m_Spectator.SetMode(OBS_IN_EYE);
|
|
||||||
gHUD.m_Spectator.SetOverviewMode(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//g_iUser1 = theNewMainMode;
|
//g_iUser1 = theNewMainMode;
|
||||||
|
|
||||||
// Attack moves to the next player
|
// Attack moves to the next player
|
||||||
if ( ButtonPressed & (IN_MOVELEFT | IN_MOVERIGHT) )
|
if (g_iUser1 != OBS_ROAMING && ButtonPressed & (IN_MOVELEFT | IN_MOVERIGHT) )
|
||||||
{
|
{
|
||||||
FindNextPlayer( (ButtonPressed & IN_MOVELEFT) ? true:false );
|
FindNextPlayer( (ButtonPressed & IN_MOVELEFT) ? true:false );
|
||||||
|
|
||||||
|
@ -1037,25 +1022,43 @@ void CHudSpectator::HandleButtonsUp( int ButtonPressed )
|
||||||
|
|
||||||
void CHudSpectator::SetMode(int iNewMainMode)
|
void CHudSpectator::SetMode(int iNewMainMode)
|
||||||
{
|
{
|
||||||
|
int NewMode = iNewMainMode;
|
||||||
|
|
||||||
|
if (NewMode == OBS_CHASE_FREE || NewMode == OBS_ROAMING)
|
||||||
|
{
|
||||||
|
float FreeSpecMode = gHUD.GetServerVariableFloat(kvFreeSpectatorMode);
|
||||||
|
if ((FreeSpecMode == 0 || (FreeSpecMode == 1.0f && gHUD.GetPlayMode() != PLAYMODE_OBSERVER)) && !gEngfuncs.IsSpectateOnly())
|
||||||
|
{
|
||||||
|
if (g_iUser1 != OBS_CHASE_FREE && g_iUser1 != OBS_ROAMING)
|
||||||
|
{
|
||||||
|
NewMode = g_iUser1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
NewMode = OBS_IN_EYE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// if value == -1 keep old value
|
// if value == -1 keep old value
|
||||||
if ( iNewMainMode == -1 )
|
if (NewMode == -1 )
|
||||||
iNewMainMode = g_iUser1;
|
NewMode = g_iUser1;
|
||||||
|
|
||||||
// main modes ettings will override inset window settings
|
// main modes ettings will override inset window settings
|
||||||
if ( iNewMainMode != g_iUser1 )
|
if (NewMode != g_iUser1 )
|
||||||
{
|
{
|
||||||
// if we are NOT in HLTV mode, main spectator mode is set on server
|
// if we are NOT in HLTV mode, main spectator mode is set on server
|
||||||
if ( !gEngfuncs.IsSpectateOnly() )
|
if ( !gEngfuncs.IsSpectateOnly() )
|
||||||
{
|
{
|
||||||
char cmdstring[32];
|
char cmdstring[32];
|
||||||
// forward command to server
|
// forward command to server
|
||||||
sprintf(cmdstring,"specmode %i",iNewMainMode );
|
sprintf(cmdstring,"specmode %i", NewMode);
|
||||||
gEngfuncs.pfnServerCmd(cmdstring);
|
gEngfuncs.pfnServerCmd(cmdstring);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( !g_iUser2 && (iNewMainMode !=OBS_ROAMING ) ) // make sure we have a target
|
if ( !g_iUser2 && (NewMode != OBS_ROAMING ) ) // make sure we have a target
|
||||||
{
|
{
|
||||||
// choose last Director object if still available
|
// choose last Director object if still available
|
||||||
if ( IsActivePlayer( gEngfuncs.GetEntityByIndex( m_lastPrimaryObject ) ) )
|
if ( IsActivePlayer( gEngfuncs.GetEntityByIndex( m_lastPrimaryObject ) ) )
|
||||||
|
@ -1069,7 +1072,7 @@ void CHudSpectator::SetMode(int iNewMainMode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ( iNewMainMode )
|
switch (NewMode)
|
||||||
{
|
{
|
||||||
case OBS_CHASE_LOCKED:
|
case OBS_CHASE_LOCKED:
|
||||||
g_iUser1 = OBS_CHASE_LOCKED;
|
g_iUser1 = OBS_CHASE_LOCKED;
|
||||||
|
@ -1116,11 +1119,15 @@ void CHudSpectator::SetMode(int iNewMainMode)
|
||||||
m_crosshairRect.bottom = 24;
|
m_crosshairRect.bottom = 24;
|
||||||
|
|
||||||
gHUD.SetCurrentCrosshair( m_hCrosshair, m_crosshairRect, 255, 255, 255 );
|
gHUD.SetCurrentCrosshair( m_hCrosshair, m_crosshairRect, 255, 255, 255 );
|
||||||
|
|
||||||
|
gWR.SetWeaponConfig(nullptr, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
memset( &m_crosshairRect,0,sizeof(m_crosshairRect) );
|
memset( &m_crosshairRect,0,sizeof(m_crosshairRect) );
|
||||||
gHUD.SetCurrentCrosshair( 0, m_crosshairRect, 0, 0, 0 );
|
gHUD.SetCurrentCrosshair( 0, m_crosshairRect, 0, 0, 0 );
|
||||||
|
|
||||||
|
gWR.SetWeaponConfig(nullptr, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//char string[128];
|
//char string[128];
|
||||||
|
@ -1884,12 +1891,16 @@ void CHudSpectator::CheckSettings()
|
||||||
m_crosshairRect.bottom = 24;
|
m_crosshairRect.bottom = 24;
|
||||||
|
|
||||||
gHUD.SetCurrentCrosshair( m_hCrosshair, m_crosshairRect, 255, 255, 255 );
|
gHUD.SetCurrentCrosshair( m_hCrosshair, m_crosshairRect, 255, 255, 255 );
|
||||||
|
|
||||||
|
gWR.SetWeaponConfig(nullptr, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
memset( &m_crosshairRect,0,sizeof(m_crosshairRect) );
|
memset( &m_crosshairRect,0,sizeof(m_crosshairRect) );
|
||||||
gHUD.SetCurrentCrosshair( 0, m_crosshairRect, 0, 0, 0 );
|
gHUD.SetCurrentCrosshair( 0, m_crosshairRect, 0, 0, 0 );
|
||||||
}
|
|
||||||
|
gWR.SetWeaponConfig(nullptr, -1);
|
||||||
|
}
|
||||||
|
|
||||||
// Removed by mmcguire.
|
// Removed by mmcguire.
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -41,47 +41,46 @@ int CHud::UpdateClientData(client_data_t *cdata, float time)
|
||||||
|
|
||||||
Think();
|
Think();
|
||||||
|
|
||||||
//cdata->fov = m_iFOV;
|
cdata->fov = m_iFOV;
|
||||||
|
|
||||||
float width = ScreenWidth();
|
//// Horizontal+ widescreen view correction - Removed after HL25 update
|
||||||
float height = ScreenHeight();
|
//float width = ScreenWidth();
|
||||||
|
//float height = ScreenHeight();
|
||||||
|
|
||||||
// Horizontal+ widescreen view correction - engine uses vertical- cropping
|
//// Cvar to let players use old widescreen. Only allow it to change when not alive so it can't be used as a zoom toggle.
|
||||||
|
//if (!gHUD.GetIsAlive(false))
|
||||||
|
//{
|
||||||
|
// wstoggle = CVAR_GET_FLOAT("cl_widescreen") != 0;
|
||||||
|
//}
|
||||||
|
|
||||||
// Cvar to let players use old widescreen. Only allow it to change when not alive so it can't be used as a zoom toggle.
|
//if (wstoggle)
|
||||||
if (!gHUD.GetIsAlive(false))
|
//{
|
||||||
{
|
// m_wsFOV = atanf(tan(m_iFOV * M_PI / 360) * 0.75 * width / height) * 360 / M_PI;
|
||||||
wstoggle = CVAR_GET_FLOAT("cl_widescreen") != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (wstoggle)
|
// //clamp for game balance
|
||||||
{
|
// if (m_iFOV == 105 && m_wsFOV > 121)
|
||||||
m_wsFOV = atanf(tan(m_iFOV * M_PI / 360) * 0.75 * width / height) * 360 / M_PI;
|
// {
|
||||||
|
// m_wsFOV = 120;
|
||||||
|
// }
|
||||||
|
// else if (m_iFOV == 100 && m_wsFOV > 117)
|
||||||
|
// {
|
||||||
|
// m_wsFOV = 116;
|
||||||
|
// }
|
||||||
|
// else if (m_iFOV == 90 && m_wsFOV > 107)
|
||||||
|
// {
|
||||||
|
// m_wsFOV = 106;
|
||||||
|
// }
|
||||||
|
// else if (m_wsFOV < 90)
|
||||||
|
// {
|
||||||
|
// m_wsFOV = 90;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//else
|
||||||
|
//{
|
||||||
|
// m_wsFOV = m_iFOV;
|
||||||
|
//}
|
||||||
|
|
||||||
//clamp for game balance
|
//cdata->fov = m_wsFOV;
|
||||||
if (m_iFOV == 105 && m_wsFOV > 121)
|
|
||||||
{
|
|
||||||
m_wsFOV = 120;
|
|
||||||
}
|
|
||||||
else if (m_iFOV == 100 && m_wsFOV > 117)
|
|
||||||
{
|
|
||||||
m_wsFOV = 116;
|
|
||||||
}
|
|
||||||
else if (m_iFOV == 90 && m_wsFOV > 107)
|
|
||||||
{
|
|
||||||
m_wsFOV = 106;
|
|
||||||
}
|
|
||||||
else if (m_wsFOV < 90)
|
|
||||||
{
|
|
||||||
m_wsFOV = 90;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_wsFOV = m_iFOV;
|
|
||||||
}
|
|
||||||
|
|
||||||
cdata->fov = m_wsFOV;
|
|
||||||
|
|
||||||
CL_ResetButtonBits( m_iKeyBits );
|
CL_ResetButtonBits( m_iKeyBits );
|
||||||
|
|
||||||
|
|
|
@ -52,11 +52,21 @@ void HudGL::line(const Vector2D& start, const Vector2D& end) const {
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
//#ifdef __APPLE__
|
|
||||||
////Remove when OSX builds with c++11
|
|
||||||
//#else
|
|
||||||
void HudGL::circle(const Vector2D& center, const std::vector<Vector2D>& points) const {
|
void HudGL::circle(const Vector2D& center, const std::vector<Vector2D>& points) const {
|
||||||
glBegin(GL_LINE_STRIP);
|
glBegin(GL_TRIANGLE_STRIP);
|
||||||
|
|
||||||
|
for (const Vector2D& point : points)
|
||||||
|
glVertex2f(center.x + point.x, center.y + point.y);
|
||||||
|
|
||||||
|
glVertex2f(center.x + points[0].x, center.y + points[0].y);
|
||||||
|
glVertex2f(center.x + points[1].x, center.y + points[1].y);
|
||||||
|
glEnd();
|
||||||
|
}
|
||||||
|
|
||||||
|
void HudGL::round_dot(const Vector2D& center, const std::vector<Vector2D>& points) const {
|
||||||
|
glBegin(GL_TRIANGLE_FAN);
|
||||||
|
|
||||||
|
glVertex2f(center.x, center.y);
|
||||||
|
|
||||||
for (const Vector2D& point : points)
|
for (const Vector2D& point : points)
|
||||||
glVertex2f(center.x + point.x, center.y + point.y);
|
glVertex2f(center.x + point.x, center.y + point.y);
|
||||||
|
@ -64,7 +74,6 @@ void HudGL::circle(const Vector2D& center, const std::vector<Vector2D>& points)
|
||||||
glVertex2f(center.x + points[0].x, center.y + points[0].y);
|
glVertex2f(center.x + points[0].x, center.y + points[0].y);
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
//#endif
|
|
||||||
|
|
||||||
void HudGL::rectangle(const Vector2D& corner_a, const Vector2D& corner_b) const {
|
void HudGL::rectangle(const Vector2D& corner_a, const Vector2D& corner_b) const {
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
|
@ -75,9 +84,6 @@ void HudGL::rectangle(const Vector2D& corner_a, const Vector2D& corner_b) const
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
//#ifdef __APPLE__
|
|
||||||
////Remove when OSX builds with c++11
|
|
||||||
//#else
|
|
||||||
std::vector<Vector2D> HudGL::compute_circle(float radius) {
|
std::vector<Vector2D> HudGL::compute_circle(float radius) {
|
||||||
// Maximum allowed distance between the circle and the rendered line segment.
|
// Maximum allowed distance between the circle and the rendered line segment.
|
||||||
const float MAX_ERROR = 0.1f;
|
const float MAX_ERROR = 0.1f;
|
||||||
|
@ -94,4 +100,23 @@ std::vector<Vector2D> HudGL::compute_circle(float radius) {
|
||||||
|
|
||||||
return points;
|
return points;
|
||||||
}
|
}
|
||||||
//#endif
|
|
||||||
|
std::vector<Vector2D> HudGL::compute_circle(float radius, float thickness) {
|
||||||
|
// Maximum allowed distance between the circle and the rendered line segment.
|
||||||
|
const float MAX_ERROR = 0.1f;
|
||||||
|
const unsigned segment_count =
|
||||||
|
static_cast<unsigned>(std::ceil(M_PI / std::acos((radius - MAX_ERROR) / radius)));
|
||||||
|
const unsigned point_count = segment_count * 2;
|
||||||
|
float half_thickness = thickness * 0.5f;
|
||||||
|
|
||||||
|
std::vector<Vector2D> points;
|
||||||
|
points.reserve(point_count);
|
||||||
|
|
||||||
|
for (unsigned i = 0; i < segment_count; ++i) {
|
||||||
|
float angle = static_cast<float>(M_PI * 2 * i / segment_count);
|
||||||
|
points.emplace_back((radius + half_thickness) * std::cos(angle), (radius + half_thickness) * std::sin(angle));
|
||||||
|
points.emplace_back((radius - half_thickness) * std::cos(angle), (radius - half_thickness) * std::sin(angle));
|
||||||
|
}
|
||||||
|
|
||||||
|
return points;
|
||||||
|
}
|
||||||
|
|
|
@ -9,16 +9,10 @@ public:
|
||||||
void color(unsigned char r, unsigned char g, unsigned char b, unsigned char a) const;
|
void color(unsigned char r, unsigned char g, unsigned char b, unsigned char a) const;
|
||||||
void line_width(float width) const;
|
void line_width(float width) const;
|
||||||
void line(const Vector2D& start, const Vector2D& end) const;
|
void line(const Vector2D& start, const Vector2D& end) const;
|
||||||
//#ifdef __APPLE__
|
|
||||||
// //Remove when OSX builds with c++11
|
|
||||||
//#else
|
|
||||||
void circle(const Vector2D& center, const std::vector<Vector2D>& points) const;
|
void circle(const Vector2D& center, const std::vector<Vector2D>& points) const;
|
||||||
//#endif
|
void round_dot(const Vector2D& center, const std::vector<Vector2D>& points) const;
|
||||||
void rectangle(const Vector2D& corner_a, const Vector2D& corner_b) const;
|
void rectangle(const Vector2D& corner_a, const Vector2D& corner_b) const;
|
||||||
|
|
||||||
//#ifdef __APPLE__
|
|
||||||
// //Remove when OSX builds with c++11
|
|
||||||
//#else
|
|
||||||
static std::vector<Vector2D> compute_circle(float radius);
|
static std::vector<Vector2D> compute_circle(float radius);
|
||||||
//#endif
|
static std::vector<Vector2D> compute_circle(float radius, float thickness);
|
||||||
};
|
};
|
||||||
|
|
|
@ -61,6 +61,7 @@ extern "C"
|
||||||
#include "mod/AvHScrollHandler.h"
|
#include "mod/AvHScrollHandler.h"
|
||||||
#include "mod/AvHCommanderModeHandler.h"
|
#include "mod/AvHCommanderModeHandler.h"
|
||||||
#include "util/Mat3.h"
|
#include "util/Mat3.h"
|
||||||
|
#include "mod/AvHBasePlayerWeaponConstants.h"
|
||||||
|
|
||||||
#include "engine/APIProxy.h"
|
#include "engine/APIProxy.h"
|
||||||
#include "Exports.h"
|
#include "Exports.h"
|
||||||
|
@ -106,6 +107,11 @@ extern cvar_t *in_joystick;
|
||||||
int in_impulse = 0;
|
int in_impulse = 0;
|
||||||
int in_cancel = 0;
|
int in_cancel = 0;
|
||||||
|
|
||||||
|
bool pistolHandlerDown = false;
|
||||||
|
|
||||||
|
extern int g_iVisibleMouse;
|
||||||
|
int g_iVguiSideMouse;
|
||||||
|
|
||||||
cvar_t *m_pitch;
|
cvar_t *m_pitch;
|
||||||
cvar_t *m_yaw;
|
cvar_t *m_yaw;
|
||||||
cvar_t *m_forward;
|
cvar_t *m_forward;
|
||||||
|
@ -135,16 +141,17 @@ cvar_t *cl_highdetail;
|
||||||
cvar_t *cl_cmhotkeys;
|
cvar_t *cl_cmhotkeys;
|
||||||
//cvar_t *cl_forcedefaultfov;
|
//cvar_t *cl_forcedefaultfov;
|
||||||
cvar_t *cl_dynamiclights;
|
cvar_t *cl_dynamiclights;
|
||||||
cvar_t *r_dynamic;
|
|
||||||
cvar_t *cl_buildmessages;
|
cvar_t *cl_buildmessages;
|
||||||
cvar_t *cl_particleinfo;
|
cvar_t *cl_particleinfo;
|
||||||
cvar_t *cl_widescreen;
|
//cvar_t *cl_widescreen;
|
||||||
cvar_t *cl_ambientsound;
|
cvar_t *cl_ambientsound;
|
||||||
cvar_t *senslock;
|
cvar_t *senslock;
|
||||||
cvar_t *hud_style;
|
|
||||||
cvar_t *cl_chatbeep;
|
cvar_t *cl_chatbeep;
|
||||||
cvar_t *cl_mutemenu;
|
cvar_t *cl_mutemenu;
|
||||||
cvar_t *cl_weaponcfgs;
|
cvar_t *cl_weaponcfgs;
|
||||||
|
cvar_t *cl_pistoltrigger;
|
||||||
|
cvar_t *cl_cmcancellast;
|
||||||
|
cvar_t *cl_teamcfgs;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============================================================================
|
===============================================================================
|
||||||
|
@ -563,14 +570,44 @@ Return 1 to allow engine to process the key, otherwise, act on it as needed
|
||||||
int CL_DLLEXPORT HUD_Key_Event( int down, int keynum, const char *pszCurrentBinding )
|
int CL_DLLEXPORT HUD_Key_Event( int down, int keynum, const char *pszCurrentBinding )
|
||||||
{
|
{
|
||||||
// RecClKeyEvent(down, keynum, pszCurrentBinding);
|
// RecClKeyEvent(down, keynum, pszCurrentBinding);
|
||||||
|
|
||||||
|
// 2024 - Check mouse button presses when the cursor is visible to fix issues with VGUI registering mouse4/5 as left click. Previously these were blocked in inputw32.
|
||||||
|
// Also note that g_iVguiSideMouseRelease is set in inputw32, because for some reason side mouse button releases in VGUI mode don't get sent here.
|
||||||
|
if (g_iVisibleMouse && (keynum >= K_MOUSE1 && keynum <= K_MOUSE5))
|
||||||
|
{
|
||||||
|
switch (keynum)
|
||||||
|
{
|
||||||
|
case K_MOUSE1:
|
||||||
|
case K_MOUSE2:
|
||||||
|
g_iVguiSideMouse = 0;
|
||||||
|
return 0;
|
||||||
|
case K_MOUSE3:
|
||||||
|
g_iVguiSideMouse = 0;
|
||||||
|
// Allow mouse3 binds while commanding since commander VGUI currently doesn't use it.
|
||||||
|
if (!gHUD.GetInTopDownMode())
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case K_MOUSE4:
|
||||||
|
case K_MOUSE5:
|
||||||
|
g_iVguiSideMouse = keynum;
|
||||||
|
|
||||||
|
if (!gHUD.GetInTopDownMode())
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check to see if the event has any outlawed commands in it.
|
||||||
|
float theBlockScripts = gHUD.GetServerVariableFloat(kvBlockScripts);
|
||||||
|
|
||||||
// Check to see if the event has any outlawed commands in it.
|
|
||||||
float theBlockScripts = gHUD.GetServerVariableFloat(kvBlockScripts);
|
|
||||||
|
|
||||||
if (theBlockScripts && AvHContainsBlockedCommands(pszCurrentBinding))
|
if (theBlockScripts && AvHContainsBlockedCommands(pszCurrentBinding))
|
||||||
{
|
{
|
||||||
if(down)//: only show when going down.
|
if(down)//: only show when going down.
|
||||||
gEngfuncs.pfnCenterPrint("Scripting is not allowed on this server.\n");
|
gEngfuncs.pfnCenterPrint("Scripting is not allowed on this server.\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -584,15 +621,15 @@ int CL_DLLEXPORT HUD_Key_Event( int down, int keynum, const char *pszCurrentBind
|
||||||
|
|
||||||
int theProcessKeyBinding = 1;
|
int theProcessKeyBinding = 1;
|
||||||
|
|
||||||
// char theKeyBinding[256] = "none";
|
// char theKeyBinding[256] = "none";
|
||||||
// if(pszCurrentBinding)
|
// if(pszCurrentBinding)
|
||||||
// {
|
// {
|
||||||
// sprintf(theKeyBinding, pszCurrentBinding);
|
// sprintf(theKeyBinding, pszCurrentBinding);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// char theMessage[512];
|
// char theMessage[512];
|
||||||
// sprintf(theMessage, "%s (down: %d, keynum %d)", theKeyBinding, down, keynum);
|
// sprintf(theMessage, "%s (down: %d, keynum %d)", theKeyBinding, down, keynum);
|
||||||
// CenterPrint(theMessage);
|
// CenterPrint(theMessage);
|
||||||
|
|
||||||
if(gViewPort /*&& gViewPort->IsOptionsMenuVisible()*/)
|
if(gViewPort /*&& gViewPort->IsOptionsMenuVisible()*/)
|
||||||
{
|
{
|
||||||
|
@ -808,7 +845,7 @@ void IN_AttackUp(void)
|
||||||
in_cancel = 0;
|
in_cancel = 0;
|
||||||
|
|
||||||
// Attack2up only for onos so it can end +attack onos charges. Attack2up for all causes blink and leap to cancel if you release attack while blinking or leaping.
|
// Attack2up only for onos so it can end +attack onos charges. Attack2up for all causes blink and leap to cancel if you release attack while blinking or leaping.
|
||||||
if (g_iUser3 == AVH_USER3_ALIEN_PLAYER5)
|
if (gHUD.GetCurrentWeaponID() == AVH_ABILITY_CHARGE)
|
||||||
{
|
{
|
||||||
IN_Attack2Up();
|
IN_Attack2Up();
|
||||||
}
|
}
|
||||||
|
@ -824,6 +861,35 @@ void IN_AttackUpForced(void)
|
||||||
KeyUpForced( &in_attack );
|
KeyUpForced( &in_attack );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void IN_AttackHandlerDown(void)
|
||||||
|
{
|
||||||
|
if (gHUD.GetCurrentWeaponID() == AVH_WEAPON_PISTOL && cl_pistoltrigger && cl_pistoltrigger->value)
|
||||||
|
{
|
||||||
|
IN_AttackDown();
|
||||||
|
IN_AttackUp();
|
||||||
|
pistolHandlerDown = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IN_AttackDown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void IN_AttackHandlerUp(void)
|
||||||
|
{
|
||||||
|
// Pistol binary trigger. Check if attack was down, otherwise the engine will fire the pistol when closing the console or tabbing in as it calls every -command.
|
||||||
|
if (gHUD.GetCurrentWeaponID() == AVH_WEAPON_PISTOL && cl_pistoltrigger && cl_pistoltrigger->value && pistolHandlerDown)
|
||||||
|
{
|
||||||
|
IN_AttackDown();
|
||||||
|
IN_AttackUp();
|
||||||
|
pistolHandlerDown = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IN_AttackUp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Special handling
|
// Special handling
|
||||||
void IN_Cancel(void)
|
void IN_Cancel(void)
|
||||||
{
|
{
|
||||||
|
@ -1161,6 +1227,11 @@ void CL_DLLEXPORT CL_CreateMove ( float frametime, struct usercmd_s *cmd, int ac
|
||||||
theProcessedMove = true;
|
theProcessedMove = true;
|
||||||
theIsSendingSpecialEvent = true;
|
theIsSendingSpecialEvent = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Clear the impulse so it doesn't execute once leaving the chair.
|
||||||
|
in_impulse = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!theProcessedMove && gHUD.GetAndClearSelectionEvent(theMouseNormPos, theTechEvent))
|
if(!theProcessedMove && gHUD.GetAndClearSelectionEvent(theMouseNormPos, theTechEvent))
|
||||||
|
@ -1530,6 +1601,86 @@ void EchoDev(void)
|
||||||
gEngfuncs.Con_Printf("%s\n", gEngfuncs.Cmd_Argv(1));
|
gEngfuncs.Con_Printf("%s\n", gEngfuncs.Cmd_Argv(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NsPreset(void)
|
||||||
|
{
|
||||||
|
int presetChoice = atoi(gEngfuncs.Cmd_Argv(1));
|
||||||
|
bool printToChat = gViewPort;
|
||||||
|
char execText[1024];
|
||||||
|
//char localizedText[1024];
|
||||||
|
|
||||||
|
switch (presetChoice)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
ClientCmd("exec presetcfgs/AV/ns32.cfg");
|
||||||
|
|
||||||
|
if (printToChat)
|
||||||
|
{
|
||||||
|
// Localize later.
|
||||||
|
//sprintf(localizedText, CHudTextMessage::BufferedLocaliseTextString("#Preset1"));
|
||||||
|
snprintf(execText, 1024, "%c** %s\n", HUD_PRINTTALK, "Classic NS audio/visual presets applied. Left click once to fix bug. See console for details.");
|
||||||
|
gHUD.m_TextMessage.MsgFunc_TextMsg(NULL, (int)strlen(execText) + 1, execText);
|
||||||
|
ClientCmd("echo \"NOTE: You must left click once after applying these settings, or your next left click won't register. It's an HL engine bug.\""); // Use echo or it's out of order.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClientCmd("toggleconsole");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
ClientCmd("exec presetcfgs/AV/newdefault.cfg");
|
||||||
|
|
||||||
|
if (printToChat)
|
||||||
|
{
|
||||||
|
// Localize later.
|
||||||
|
//sprintf(localizedText, CHudTextMessage::BufferedLocaliseTextString("#Preset2"));
|
||||||
|
snprintf(execText, 1024, "%c** %s\n", HUD_PRINTTALK, "NS 3.3 audio/visual presets applied. Left click once to fix bug. See console for details. ");
|
||||||
|
gHUD.m_TextMessage.MsgFunc_TextMsg(NULL, (int)strlen(execText) + 1, execText);
|
||||||
|
ClientCmd("echo \"NOTE: You must left click once after applying these settings, or your next left click won't register. It's an HL engine bug.\""); // Use echo or it's out of order.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClientCmd("toggleconsole");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
ClientCmd("exec presetcfgs/AV/competitive.cfg");
|
||||||
|
|
||||||
|
if (printToChat)
|
||||||
|
{
|
||||||
|
// Localize later.
|
||||||
|
//sprintf(localizedText, CHudTextMessage::BufferedLocaliseTextString("#Preset3"));
|
||||||
|
snprintf(execText, 1024, "%c** %s\n", HUD_PRINTTALK, "Competitive audio/visual presets applied. Left click once to fix bug. See console for details.");
|
||||||
|
gHUD.m_TextMessage.MsgFunc_TextMsg(NULL, (int)strlen(execText) + 1, execText);
|
||||||
|
ClientCmd("echo \"NOTE: You must left click once after applying these settings, or your next left click won't register. It's an HL engine bug.\""); // Use echo or it's out of order.
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClientCmd("toggleconsole");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
gEngfuncs.Con_Printf("NS configuration preset selector. Usage:\n1: apply NS 3.2 settings\n2: apply NS 3.3 settings\n3: apply competitive settings\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void NsRates(void)
|
||||||
|
{
|
||||||
|
int ratesChoice = atoi(gEngfuncs.Cmd_Argv(1));
|
||||||
|
char execText[30];
|
||||||
|
|
||||||
|
if (ratesChoice >= 1 && ratesChoice <= 20)
|
||||||
|
{
|
||||||
|
snprintf(execText, 30, "exec presetcfgs/rates/%d.cfg", ratesChoice);
|
||||||
|
ClientCmd(execText);
|
||||||
|
}
|
||||||
|
// Don't show this if 0 is entered as an arg, as it's the normal behavior for the blank default setting in options.
|
||||||
|
else if (gEngfuncs.Cmd_Argc() <= 1 || ratesChoice != 0)
|
||||||
|
{
|
||||||
|
gEngfuncs.Con_Printf("nsrates selects from preset network rate commands. Start from \"nsrates 1\" and increase the number until your connection feels stable.\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
============
|
============
|
||||||
InitInput
|
InitInput
|
||||||
|
@ -1561,8 +1712,8 @@ void InitInput (void)
|
||||||
gEngfuncs.pfnAddCommand ("-moveright", IN_MoverightUp);
|
gEngfuncs.pfnAddCommand ("-moveright", IN_MoverightUp);
|
||||||
gEngfuncs.pfnAddCommand ("+speed", IN_SpeedDown);
|
gEngfuncs.pfnAddCommand ("+speed", IN_SpeedDown);
|
||||||
gEngfuncs.pfnAddCommand ("-speed", IN_SpeedUp);
|
gEngfuncs.pfnAddCommand ("-speed", IN_SpeedUp);
|
||||||
gEngfuncs.pfnAddCommand ("+attack", IN_AttackDown);
|
gEngfuncs.pfnAddCommand ("+attack", IN_AttackHandlerDown);
|
||||||
gEngfuncs.pfnAddCommand ("-attack", IN_AttackUp);
|
gEngfuncs.pfnAddCommand ("-attack", IN_AttackHandlerUp);
|
||||||
//gEngfuncs.pfnAddCommand ("+movement", IN_Attack2Down);
|
//gEngfuncs.pfnAddCommand ("+movement", IN_Attack2Down);
|
||||||
//gEngfuncs.pfnAddCommand ("-movement", IN_Attack2Up);
|
//gEngfuncs.pfnAddCommand ("-movement", IN_Attack2Up);
|
||||||
gEngfuncs.pfnAddCommand ("+use", IN_UseDown);
|
gEngfuncs.pfnAddCommand ("+use", IN_UseDown);
|
||||||
|
@ -1604,6 +1755,8 @@ void InitInput (void)
|
||||||
|
|
||||||
gEngfuncs.pfnAddCommand("nsversion", NsVersion);
|
gEngfuncs.pfnAddCommand("nsversion", NsVersion);
|
||||||
gEngfuncs.pfnAddCommand("echodev", EchoDev);
|
gEngfuncs.pfnAddCommand("echodev", EchoDev);
|
||||||
|
gEngfuncs.pfnAddCommand("nspreset", NsPreset);
|
||||||
|
gEngfuncs.pfnAddCommand("nsrates", NsRates);
|
||||||
|
|
||||||
lookstrafe = gEngfuncs.pfnRegisterVariable ( "lookstrafe", "0", FCVAR_ARCHIVE );
|
lookstrafe = gEngfuncs.pfnRegisterVariable ( "lookstrafe", "0", FCVAR_ARCHIVE );
|
||||||
lookspring = gEngfuncs.pfnRegisterVariable ( "lookspring", "0", FCVAR_ARCHIVE );
|
lookspring = gEngfuncs.pfnRegisterVariable ( "lookspring", "0", FCVAR_ARCHIVE );
|
||||||
|
@ -1627,8 +1780,8 @@ void InitInput (void)
|
||||||
|
|
||||||
cl_autohelp = gEngfuncs.pfnRegisterVariable ( kvAutoHelp, "1.0", FCVAR_ARCHIVE );
|
cl_autohelp = gEngfuncs.pfnRegisterVariable ( kvAutoHelp, "1.0", FCVAR_ARCHIVE );
|
||||||
cl_centerentityid = gEngfuncs.pfnRegisterVariable ( kvCenterEntityID, "0.0", FCVAR_ARCHIVE );
|
cl_centerentityid = gEngfuncs.pfnRegisterVariable ( kvCenterEntityID, "0.0", FCVAR_ARCHIVE );
|
||||||
cl_musicenabled = gEngfuncs.pfnRegisterVariable ( kvMusicEnabled, "0", FCVAR_ARCHIVE );
|
cl_musicenabled = gEngfuncs.pfnRegisterVariable ( kvMusicEnabled, "1", FCVAR_ARCHIVE );
|
||||||
cl_musicvolume = gEngfuncs.pfnRegisterVariable ( kvMusicVolume, "1", FCVAR_ARCHIVE );
|
cl_musicvolume = gEngfuncs.pfnRegisterVariable ( kvMusicVolume, "0.6", FCVAR_ARCHIVE );
|
||||||
cl_musicdir = gEngfuncs.pfnRegisterVariable ( kvMusicDirectory, "", FCVAR_ARCHIVE);
|
cl_musicdir = gEngfuncs.pfnRegisterVariable ( kvMusicDirectory, "", FCVAR_ARCHIVE);
|
||||||
cl_musicdelay = gEngfuncs.pfnRegisterVariable ( kvMusicDelay, "90", FCVAR_ARCHIVE);
|
cl_musicdelay = gEngfuncs.pfnRegisterVariable ( kvMusicDelay, "90", FCVAR_ARCHIVE);
|
||||||
cl_dynamiclights = gEngfuncs.pfnRegisterVariable ( kvDynamicLights, "1", FCVAR_ARCHIVE );
|
cl_dynamiclights = gEngfuncs.pfnRegisterVariable ( kvDynamicLights, "1", FCVAR_ARCHIVE );
|
||||||
|
@ -1638,13 +1791,17 @@ void InitInput (void)
|
||||||
cl_cmhotkeys = gEngfuncs.pfnRegisterVariable ( kvCMHotkeys, "qwerasdfzxcv", FCVAR_ARCHIVE );
|
cl_cmhotkeys = gEngfuncs.pfnRegisterVariable ( kvCMHotkeys, "qwerasdfzxcv", FCVAR_ARCHIVE );
|
||||||
//cl_forcedefaultfov = gEngfuncs.pfnRegisterVariable ( kvForceDefaultFOV, "0", FCVAR_ARCHIVE );
|
//cl_forcedefaultfov = gEngfuncs.pfnRegisterVariable ( kvForceDefaultFOV, "0", FCVAR_ARCHIVE );
|
||||||
cl_particleinfo = gEngfuncs.pfnRegisterVariable ( kvParticleInfo, "0", FCVAR_ARCHIVE );
|
cl_particleinfo = gEngfuncs.pfnRegisterVariable ( kvParticleInfo, "0", FCVAR_ARCHIVE );
|
||||||
cl_widescreen = gEngfuncs.pfnRegisterVariable ( kvWidescreen, "1", FCVAR_ARCHIVE );
|
//cl_widescreen = gEngfuncs.pfnRegisterVariable ( kvWidescreen, "1", FCVAR_ARCHIVE );
|
||||||
cl_ambientsound = gEngfuncs.pfnRegisterVariable ( kvAmbientSound, "0", FCVAR_ARCHIVE);
|
cl_ambientsound = gEngfuncs.pfnRegisterVariable ( kvAmbientSound, "0.6", FCVAR_ARCHIVE);
|
||||||
senslock = gEngfuncs.pfnRegisterVariable ("senslock", "0", FCVAR_ARCHIVE);
|
senslock = gEngfuncs.pfnRegisterVariable ("senslock", "0", FCVAR_ARCHIVE);
|
||||||
hud_style = gEngfuncs.pfnRegisterVariable ("hud_style", "1", FCVAR_ARCHIVE);
|
|
||||||
cl_chatbeep = gEngfuncs.pfnRegisterVariable ("cl_chatbeep", "1", FCVAR_ARCHIVE);
|
cl_chatbeep = gEngfuncs.pfnRegisterVariable ("cl_chatbeep", "1", FCVAR_ARCHIVE);
|
||||||
cl_mutemenu = gEngfuncs.pfnRegisterVariable ("cl_mutemenu", "3", FCVAR_ARCHIVE);
|
cl_mutemenu = gEngfuncs.pfnRegisterVariable ("cl_mutemenu", "3", FCVAR_ARCHIVE);
|
||||||
cl_weaponcfgs = gEngfuncs.pfnRegisterVariable ("cl_weaponcfgs", "1", FCVAR_ARCHIVE);
|
cl_weaponcfgs = gEngfuncs.pfnRegisterVariable ("cl_weaponcfgs", "1", FCVAR_ARCHIVE);
|
||||||
|
cl_pistoltrigger = gEngfuncs.pfnRegisterVariable ("cl_pistoltrigger", "1", FCVAR_ARCHIVE);
|
||||||
|
cl_cmcancellast = gEngfuncs.pfnRegisterVariable("cl_cmcancellast", "0", FCVAR_ARCHIVE);
|
||||||
|
cl_teamcfgs = gEngfuncs.pfnRegisterVariable("cl_teamcfgs", "1", FCVAR_ARCHIVE);
|
||||||
|
|
||||||
|
gEngfuncs.pfnRegisterVariable("cl_placebo", "0", 0); // Junk command for options menu dividers.
|
||||||
|
|
||||||
// Initialize third person camera controls.
|
// Initialize third person camera controls.
|
||||||
CAM_Init();
|
CAM_Init();
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue