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
-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