Move scroll smoothing to central location

This commit is contained in:
2023-03-26 22:16:03 +01:00
parent b093219153
commit e5906eefa3
6 changed files with 12 additions and 38 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ sniperRifle =
& itParams . gunBarrels .~ SingleBarrel 0
& itUse . heldAim . aimZoom .~ defaultItZoom{_izMax = 0.5, _izMin = 0.5,_izFac = 1}
& itUse . heldScroll .~ HeldScrollZoom -- zoomLongGun
& itScope .~ ZoomScope (V2 0 0) 0 1 0.5 False
& itScope .~ ZoomScope (V2 0 0) 1 0.5 False
& itUse . useTargeting ?~ TargetLaser
machineGun :: Item
+1 -1
View File
@@ -32,7 +32,7 @@ latchkey _ =
binoculars :: Item
binoculars =
defaultHeldItem
& itScope .~ ZoomScope (V2 0 0) 0 1 0.5 False
& itScope .~ ZoomScope (V2 0 0) 1 0.5 False
& itType . iyBase .~ HELD BINOCULARS
& itUse . heldAim . aimHandlePos .~ 5
& itUse . heldAim . aimMuzPos .~ 10
-19
View File
@@ -1,19 +0,0 @@
module Dodge.Item.Weapon.ZoomScope where
import Dodge.Data.Item
import LensHelp
-- should be possible without the creature
setZoomScopeChange :: Float -> Item -> Item
setZoomScopeChange x
| x > 0 = itScope . scopeZoomChange %~ (max 0 . (+ xi))
| x < 0 = itScope . scopeZoomChange %~ (min 0 . (+ xi))
| otherwise = id
where
xi | x > 2 = 20
| x > 1 = 10
| x > 0 = 1
| x < -2 = - 20
| x < -1 = - 10
| x < -0 = - 1
| otherwise = 0