Continue item use refactor

This commit is contained in:
2024-12-31 11:25:56 +00:00
parent 6aa3c701bc
commit 9e2dc995e9
5 changed files with 15 additions and 6 deletions
+7 -1
View File
@@ -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