mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 14:51:46 +00:00
Add LookScale variable on weapon
This variable allows a weapon to set a custom look sensitivity multiplier without fiddling with FOVScale / DesiredFOV hacks.
This commit is contained in:
parent
0fa4e03db6
commit
ae1a1df02d
3 changed files with 3 additions and 0 deletions
|
@ -757,6 +757,7 @@ static int LookAdjust(int look)
|
|||
players[consoleplayer].ReadyWeapon != NULL) // No adjustment if no weapon.
|
||||
{
|
||||
auto scale = players[consoleplayer].ReadyWeapon->FloatVar(NAME_FOVScale);
|
||||
scale *= players[consoleplayer].ReadyWeapon->FloatVar(NAME_LookScale);
|
||||
if (scale > 0) // No adjustment if it is non-positive.
|
||||
{
|
||||
look = int(look * scale);
|
||||
|
|
|
@ -1029,6 +1029,7 @@ xx(Kickback)
|
|||
xx(MinSelAmmo1)
|
||||
xx(bDehAmmo)
|
||||
xx(FOVScale)
|
||||
xx(LookScale)
|
||||
xx(YAdjust)
|
||||
xx(Crosshair)
|
||||
xx(WeaponFlags)
|
||||
|
|
|
@ -28,6 +28,7 @@ class Weapon : StateProvider
|
|||
Ammo Ammo1, Ammo2; // In-inventory instance variables
|
||||
Weapon SisterWeapon;
|
||||
double FOVScale;
|
||||
double LookScale; // Multiplier for look sensitivity (like FOV scaling but without the zooming)
|
||||
int Crosshair; // 0 to use player's crosshair
|
||||
bool GivenAsMorphWeapon;
|
||||
bool bAltFire; // Set when this weapon's alternate fire is used.
|
||||
|
|
Loading…
Reference in a new issue