Remove non-aiming item zoom
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user