Continue item use refactor
This commit is contained in:
@@ -177,9 +177,15 @@ pressedMBEffectsTopInventory pkeys w
|
||||
, Just rtime <- pkeys ^? ix SDL.ButtonRight
|
||||
, ltime <= rtime && inTopInv =
|
||||
--youhammerdown $
|
||||
useSelectedItem 0 w
|
||||
--useSelectedItem 0 w
|
||||
fromMaybe w $ do
|
||||
invid <- w ^? cWorld . lWorld . creatures . ix 0
|
||||
. crManipulation . manObject . imSelectedItem
|
||||
return $ useItem invid (f ltime) w
|
||||
| otherwise = w
|
||||
where
|
||||
f 0 = InitialPress
|
||||
f _ = ShortPress
|
||||
-- youhammerdown = set (cWorld . lWorld . creatures . ix 0 . crHammerPosition) HammerDown
|
||||
inTopInv = case w ^. hud . hudElement of
|
||||
DisplayInventory{_subInventory = NoSubInventory{}} -> True
|
||||
|
||||
Reference in New Issue
Block a user