Partially working scroll time item

This commit is contained in:
2022-10-27 18:42:38 +01:00
parent 35f2992fe4
commit c6b500c219
2 changed files with 19 additions and 7 deletions
+2 -1
View File
@@ -53,7 +53,7 @@ pressedMBEffectsNoInventory :: M.Map MouseButton Bool -> World -> World
pressedMBEffectsNoInventory pkeys w
| isDown ButtonLeft && isDown ButtonRight && inTopInv =
useItem (you w) w & hammers . ix DoubleMouseHam .~ HammerDown
| isDown ButtonLeft && inTopInv
| justPressedDown ButtonLeft && inTopInv
&& w ^?! hammers . ix DoubleMouseHam == HammerUp =
useLeftItem (_yourID (_cWorld w)) w
| isDown ButtonLeft && inTopInv =
@@ -68,6 +68,7 @@ pressedMBEffectsNoInventory pkeys w
inTopInv = case _hudElement (_hud (_cWorld w)) of
DisplayInventory NoSubInventory -> True
_ -> False
justPressedDown but = (pkeys ^. at but) == Just False
isDown but = but `M.member` pkeys
rotation = angleBetween (_mousePos w) (_clickMousePos w)