Skip to content

Commit 45d91b3

Browse files
committed
add crosshairreloadfade.patch
closes #38
1 parent 1a515e8 commit 45d91b3

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ apply-patches:
5454
$(PATCH) < patches/clientdemo.patch
5555
$(PATCH) < patches/colored_weapon_trails.patch
5656
$(PATCH) < patches/serverevents.patch
57+
$(PATCH) < patches/crosshairreloadfade.patch
5758
unix2dos src/vcpp/sauerbraten.nsi
5859
unix2dos src/vcpp/sauerbraten.vcxproj
5960
cd src && make depend

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ This repository contains the source for my client mod, as well as the patches ap
3232
- [checkupdate.patch](#checkupdatepatch)
3333
- [clientdemo.patch](#clientdemopatch)
3434
- [colored_weapon_trails.patch](#colored_weapon_trailspatch)
35+
- [crosshairreloadfade.patch](#crosshairreloadfadepatch)
3536
- [Server Patches](#server-patches)
3637
- [authservers.patch](#authserverspatch)
3738
- [serverlogging.patch](#serverloggingpatch)
@@ -235,6 +236,10 @@ Client-side demos record the game as you experience it, and work independently o
235236
- adds the `trailcolor[shotgun|chaingun|rocketlauncher|rifle|grenadelauncher|pistol]` vars that change the respective weapon's projectile/particle trail
236237
- adds the `settrailcolor <SG|CG|RL|RI|GL|PI> <color>` command (for convenience: changing the variables directly also works)
237238

239+
### [crosshairreloadfade.patch](./patches/crosshairreloadfade.patch)
240+
241+
- adds `crosshairreloadfade` variable: set to 0 to disable the "crosshair-goes-dark-while-weapon-reloads" effect
242+
238243

239244
## Server Patches
240245

patches/crosshairreloadfade.patch

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git src/fpsgame/fps.cpp src/fpsgame/fps.cpp
2+
index 15e4aec..1f6919b 100644
3+
--- src/fpsgame/fps.cpp
4+
+++ src/fpsgame/fps.cpp
5+
@@ -1135,6 +1135,8 @@ namespace game
6+
}
7+
}
8+
9+
+ MOD(VARP, crosshairreloadfade, 0, 1, 1);
10+
+
11+
int selectcrosshair(vec &color)
12+
{
13+
fpsent *d = hudplayer();
14+
@@ -1159,7 +1161,7 @@ namespace game
15+
if(d->health<=25) color = vec(1, 0, 0);
16+
else if(d->health<=50) color = vec(1, 0.5f, 0);
17+
}
18+
- if(d->gunwait) color.mul(0.5f);
19+
+ if(d->gunwait && crosshairreloadfade) color.mul(0.5f);
20+
return crosshair;
21+
}
22+

src/fpsgame/fps.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,8 @@ namespace game
11351135
}
11361136
}
11371137

1138+
MOD(VARP, crosshairreloadfade, 0, 1, 1);
1139+
11381140
int selectcrosshair(vec &color)
11391141
{
11401142
fpsent *d = hudplayer();
@@ -1159,7 +1161,7 @@ namespace game
11591161
if(d->health<=25) color = vec(1, 0, 0);
11601162
else if(d->health<=50) color = vec(1, 0.5f, 0);
11611163
}
1162-
if(d->gunwait) color.mul(0.5f);
1164+
if(d->gunwait && crosshairreloadfade) color.mul(0.5f);
11631165
return crosshair;
11641166
}
11651167

0 commit comments

Comments
 (0)