Fold aiming parameters into item use datatype

This commit is contained in:
2021-11-27 18:10:05 +00:00
parent 8639b2d428
commit 652af6b0a9
24 changed files with 135 additions and 155 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ moveCamera w = w
where
aimRangeFactor
| _cameraZoom w == 0 = 0
| otherwise = fromMaybe 0 (yourItem w ^? itAimingRange) / _cameraZoom w
| otherwise = fromMaybe 0 (yourItem w ^? itUse . useAim . aimRange) / _cameraZoom w
aimingMult
| SDL.ButtonRight `S.member` _mouseButtons w = 1
| otherwise = 0
@@ -164,7 +164,7 @@ autoZoomCamera w
wallZoom = farWallDist camPos w
idealZoom
| SDL.ButtonRight `S.member` _mouseButtons w
= theScopeZoom * maybe zoomNoItem zoomFromItem (yourItem w ^? itAimZoom) wallZoom
= theScopeZoom * maybe zoomNoItem zoomFromItem (yourItem w ^? itUse . useAim . aimZoom) wallZoom
| otherwise
= maybe zoomNoItem zoomFromItem (yourItem w ^? itZoom) wallZoom
changeZoom curZoom