Remove non-aiming item zoom

This commit is contained in:
2021-11-29 16:56:19 +00:00
parent 89a80a0c77
commit e9ff591a28
2 changed files with 3 additions and 9 deletions
-1
View File
@@ -333,7 +333,6 @@ data Item
, _itConsumption :: ItemConsumption
, _itUse :: ItemUse
, _itFloorPict :: Item -> SPic
-- , _itZoom :: ItZoom
, _itEquipPict :: Creature -> Int -> SPic
, _itScroll :: Float -> Creature -> Item -> Item
, _itIdentity :: ItemIdentity
+3 -8
View File
@@ -153,20 +153,15 @@ zoomNoItem
zoomNoItem = min 20 . max 0.2
{- Automatically sets the zoom of the camera according to the surrounding walls. -}
autoZoomCamera :: Configuration -> World -> World
autoZoomCamera cfig w
-- | zoomInKey (_keyConfig w) `S.member` _keys w
-- = zoomCamBy 0.01 w
-- | zoomOutKey (_keyConfig w) `S.member` _keys w
-- = zoomCamBy (-0.01) w
= w & cameraZoom %~ changeZoom
autoZoomCamera cfig w = w & cameraZoom %~ changeZoom
where
camPos = _cameraViewFrom w
wallZoom = farWallDist camPos cfig w
idealZoom
| SDL.ButtonRight `S.member` _mouseButtons w
= theScopeZoom * maybe zoomNoItem zoomFromItem (yourItem w ^? itUse . useAim . aimZoom) wallZoom
| otherwise
= maybe zoomNoItem zoomFromItem (yourItem w ^? itZoom) wallZoom
| otherwise = zoomNoItem wallZoom
-- = maybe zoomNoItem zoomFromItem (yourItem w ^? itZoom) wallZoom
changeZoom curZoom
| curZoom > idealZoom + 0.01 = ((zoomOutSpeed-1)*curZoom + idealZoom) / zoomOutSpeed
| curZoom < idealZoom - 0.01 = ((zoomInSpeed -1)*curZoom + idealZoom) / zoomInSpeed