Remove data Hammers
This commit is contained in:
@@ -43,19 +43,20 @@ handleHotkeys w
|
||||
|| SDL.ScancodeRShift `M.member` _pressedKeys (_input w) =
|
||||
foldl' tryAssignHotkey w allHotkeys
|
||||
| otherwise =
|
||||
foldl'
|
||||
M.foldl'
|
||||
useHotkey
|
||||
w
|
||||
(M.intersection thehotkeys (M.filter (== InitialPress) (w ^. input . pressedKeys)))
|
||||
(M.intersectionWith (,) thehotkeys (w ^. input . pressedKeys))
|
||||
where
|
||||
thehotkeys = M.mapKeys hotkeyToScancode $ w ^. cWorld . lWorld . hotkeys
|
||||
|
||||
useHotkey :: World -> NewInt ItmInt -> World
|
||||
useHotkey w (NInt itid) = fromMaybe w $ do
|
||||
useHotkey :: World -> (NewInt ItmInt,PressType) -> World
|
||||
useHotkey w (NInt itid,pt) = fromMaybe w $ do
|
||||
invid <- w ^? cWorld . lWorld . itemLocations . ix itid . ilInvID
|
||||
cr <- w ^? cWorld . lWorld . creatures . ix 0
|
||||
itmloc <- allInvLocs (cr ^. crInv) ^? ix invid . _2 . locLDT
|
||||
return $ heldEffectNoHammerCheck (bimap (^. iatType) (^. _1) itmloc) cr w
|
||||
return $ useItem invid pt w
|
||||
-- cr <- w ^? cWorld . lWorld . creatures . ix 0
|
||||
-- itmloc <- allInvLocs (cr ^. crInv) ^? ix invid . _2 . locLDT
|
||||
-- return $ heldEffectNoHammerCheck (bimap (^. iatType) (^. _1) itmloc) cr w
|
||||
|
||||
allHotkeys :: [SDL.Scancode]
|
||||
allHotkeys = map hotkeyToScancode [minBound .. maxBound]
|
||||
@@ -176,8 +177,6 @@ pressedMBEffectsTopInventory pkeys w
|
||||
| Just ltime <- pkeys ^? ix SDL.ButtonLeft
|
||||
, Just rtime <- pkeys ^? ix SDL.ButtonRight
|
||||
, ltime <= rtime && inTopInv =
|
||||
--youhammerdown $
|
||||
--useSelectedItem 0 w
|
||||
fromMaybe w $ do
|
||||
invid <- w ^? cWorld . lWorld . creatures . ix 0
|
||||
. crManipulation . manObject . imSelectedItem
|
||||
|
||||
Reference in New Issue
Block a user