Fold aiming parameters into item use datatype
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user