Broken commit
This commit is contained in:
@@ -6,6 +6,7 @@ module Dodge.Update.Camera (
|
||||
) where
|
||||
|
||||
import Bound
|
||||
import Control.Applicative
|
||||
import Control.Monad
|
||||
import Data.Foldable
|
||||
import qualified Data.Map.Strict as M
|
||||
@@ -75,7 +76,7 @@ updateInGameCamera cfig w =
|
||||
& updateBounds cfig
|
||||
& over wCam (setViewDistance cfig)
|
||||
& wCam %~ moveZoomCamera cfig (w ^. input) (you w)
|
||||
& updateScopeZoom
|
||||
-- & updateScopeZoom
|
||||
& rotateCamera cfig
|
||||
|
||||
moveZoomCamera :: Configuration -> Input -> Creature -> Camera -> Camera
|
||||
@@ -97,14 +98,19 @@ moveZoomCamera cfig theinput cr campos =
|
||||
mitm ^? _Just . itScope . remotePos
|
||||
mscopeoffset = do
|
||||
guard (SDL.ButtonRight `M.member` _mouseButtons theinput)
|
||||
mitm ^? _Just . itScope . remotePos
|
||||
i <- cr ^? crManipulation . manObject . inInventory . ispItem
|
||||
(cr ^? crInv . ix (i - 1) . itUse . attachParams . scrollAttachParams . opticPos)
|
||||
<|> (mitm ^? _Just . itScope . remotePos)
|
||||
newcen = cpos +.+ fromMaybe (V2 0 0) mscopeoffset +.+ offset
|
||||
offset =
|
||||
rotateV (campos ^. camRot) $
|
||||
((newzoom - newDefaultZoom) / (newDefaultZoom * newzoom)) *.* _mousePos theinput
|
||||
newzoom = case mitm ^? _Just . itScope of
|
||||
-- Just zs@ZoomScope{} -> _scopeZoom zs
|
||||
_ -> newDefaultZoom * newItemZoom
|
||||
newzoom = fromMaybe (newDefaultZoom * newItemZoom) $ do
|
||||
i <- cr ^? crManipulation . manObject . inInventory . ispItem
|
||||
(cr ^? crInv . ix (i - 1) . itUse . attachParams . scrollAttachParams . opticZoom)
|
||||
-- case mitm ^? _Just . itScope of
|
||||
---- Just zs@ZoomScope{} -> _scopeZoom zs
|
||||
-- _ -> newDefaultZoom * newItemZoom
|
||||
idealDefaultZoom = clipZoom wallZoom
|
||||
newDefaultZoom = case mitm ^? _Just . itScope of
|
||||
-- Just zs@ZoomScope{} -> _scopeZoom zs
|
||||
|
||||
Reference in New Issue
Block a user