Tweak camera movement
This commit is contained in:
@@ -100,7 +100,6 @@ tryAssignHotkey w sc = fromMaybe w $ do
|
||||
cr <- w ^? cWorld . lWorld . creatures . ix 0
|
||||
invid <- cr ^? crManipulation . manObject . imSelectedItem
|
||||
itid <- cr ^? crInv . ix invid . itID
|
||||
--return $ w & cWorld . lWorld . creatures . ix 0 %~ assignHotkey itid (scancodeToHotkey sc)
|
||||
return $ w & cWorld . lWorld %~ assignHotkey itid (scancodeToHotkey sc)
|
||||
|
||||
{- | The order of these MAY be important, in particular the setting of crMvAim
|
||||
@@ -180,17 +179,9 @@ pressedMBEffectsTopInventory pkeys w
|
||||
, Just rtime <- pkeys ^? ix SDL.ButtonRight
|
||||
, ltime <= rtime && inTopInv
|
||||
= youhammerdown $ useSelectedItem 0 w
|
||||
| Just _ <- pkeys ^? ix SDL.ButtonLeft
|
||||
, Just _ <- pkeys ^? ix SDL.ButtonRight
|
||||
= w & wCam . camRot -~ rotation
|
||||
| otherwise = w
|
||||
where
|
||||
youhammerdown = set (cWorld . lWorld . creatures . ix 0 . crHammerPosition) HammerDown
|
||||
inTopInv = case w ^. hud . hudElement of
|
||||
DisplayInventory{_subInventory = NoSubInventory{}} -> True
|
||||
_ -> False
|
||||
rotation =
|
||||
maybe
|
||||
0
|
||||
(angleBetween $ w ^. input . mousePos)
|
||||
(w ^. input . heldPos . at SDL.ButtonRight)
|
||||
|
||||
Reference in New Issue
Block a user