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 , _itConsumption :: ItemConsumption
, _itUse :: ItemUse , _itUse :: ItemUse
, _itFloorPict :: Item -> SPic , _itFloorPict :: Item -> SPic
-- , _itZoom :: ItZoom
, _itEquipPict :: Creature -> Int -> SPic , _itEquipPict :: Creature -> Int -> SPic
, _itScroll :: Float -> Creature -> Item -> Item , _itScroll :: Float -> Creature -> Item -> Item
, _itIdentity :: ItemIdentity , _itIdentity :: ItemIdentity
+3 -8
View File
@@ -153,20 +153,15 @@ zoomNoItem
zoomNoItem = min 20 . max 0.2 zoomNoItem = min 20 . max 0.2
{- Automatically sets the zoom of the camera according to the surrounding walls. -} {- Automatically sets the zoom of the camera according to the surrounding walls. -}
autoZoomCamera :: Configuration -> World -> World autoZoomCamera :: Configuration -> World -> World
autoZoomCamera cfig w autoZoomCamera cfig w = w & cameraZoom %~ changeZoom
-- | 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
where where
camPos = _cameraViewFrom w camPos = _cameraViewFrom w
wallZoom = farWallDist camPos cfig w wallZoom = farWallDist camPos cfig w
idealZoom idealZoom
| SDL.ButtonRight `S.member` _mouseButtons w | SDL.ButtonRight `S.member` _mouseButtons w
= theScopeZoom * maybe zoomNoItem zoomFromItem (yourItem w ^? itUse . useAim . aimZoom) wallZoom = theScopeZoom * maybe zoomNoItem zoomFromItem (yourItem w ^? itUse . useAim . aimZoom) wallZoom
| otherwise | otherwise = zoomNoItem wallZoom
= maybe zoomNoItem zoomFromItem (yourItem w ^? itZoom) wallZoom -- = maybe zoomNoItem zoomFromItem (yourItem w ^? itZoom) wallZoom
changeZoom curZoom changeZoom curZoom
| curZoom > idealZoom + 0.01 = ((zoomOutSpeed-1)*curZoom + idealZoom) / zoomOutSpeed | curZoom > idealZoom + 0.01 = ((zoomOutSpeed-1)*curZoom + idealZoom) / zoomOutSpeed
| curZoom < idealZoom - 0.01 = ((zoomInSpeed -1)*curZoom + idealZoom) / zoomInSpeed | curZoom < idealZoom - 0.01 = ((zoomInSpeed -1)*curZoom + idealZoom) / zoomInSpeed