Tweak camera movement

This commit is contained in:
2024-12-31 09:54:57 +00:00
parent e12e4777b2
commit ede08ff1db
6 changed files with 79 additions and 79 deletions
-9
View File
@@ -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)