Cleanup
This commit is contained in:
@@ -140,22 +140,17 @@ rotateCamera cfig w
|
|||||||
| Just ltime <- pkeys ^? ix SDL.ButtonLeft
|
| Just ltime <- pkeys ^? ix SDL.ButtonLeft
|
||||||
, Just rtime <- pkeys ^? ix SDL.ButtonRight
|
, Just rtime <- pkeys ^? ix SDL.ButtonRight
|
||||||
, rtime > 0
|
, rtime > 0
|
||||||
, ltime > rtime =
|
, ltime > rtime
|
||||||
|
, Just rotation <-
|
||||||
|
angleBetween (w ^. input . mousePos)
|
||||||
|
<$> (w ^. input . heldPos . at SDL.ButtonRight) =
|
||||||
w & wCam . camRot -~ rotation
|
w & wCam . camRot -~ rotation
|
||||||
| otherwise = ifConfigWallRotate cfig (w ^. input . mouseButtons) w
|
| _gameplay_rotate_to_wall cfig
|
||||||
|
, isNothing $ pkeys ^? ix SDL.ButtonRight =
|
||||||
|
rotateToOverlappingWall w
|
||||||
|
| otherwise = w
|
||||||
where
|
where
|
||||||
pkeys = w ^. input . mouseButtons
|
pkeys = w ^. input . mouseButtons
|
||||||
rotation =
|
|
||||||
maybe
|
|
||||||
0
|
|
||||||
(angleBetween $ w ^. input . mousePos)
|
|
||||||
(w ^. input . heldPos . at SDL.ButtonRight)
|
|
||||||
|
|
||||||
ifConfigWallRotate :: Configuration -> M.Map MouseButton Int -> World -> World
|
|
||||||
ifConfigWallRotate cfig mbs
|
|
||||||
| _gameplay_rotate_to_wall cfig && not (SDL.ButtonRight `M.member` mbs) =
|
|
||||||
rotateToOverlappingWall
|
|
||||||
| otherwise = id
|
|
||||||
|
|
||||||
rotateToOverlappingWall :: World -> World
|
rotateToOverlappingWall :: World -> World
|
||||||
rotateToOverlappingWall w =
|
rotateToOverlappingWall w =
|
||||||
|
|||||||
Reference in New Issue
Block a user