Add modules to items, upgrades the can persist through combinations

This commit is contained in:
2022-02-20 14:13:12 +00:00
parent 3f20398ed0
commit 7afc367abc
16 changed files with 108 additions and 32 deletions
+3 -3
View File
@@ -18,15 +18,15 @@ updateUsingInput w = if _carteDisplay w
updatePressedButtons :: S.Set MouseButton -> World -> World
updatePressedButtons pkeys w
| lbPressed && rbPressed = tryUseItem (you w) w
| lbPressed && rbPressed && inTopInv = tryUseItem (you w) w
| lbPressed &&
(_inventoryMode w == TopInventory || _rewinding w == RewindingLastFrame)
(inTopInv || _timeFlow w == RewindingLastFrame)
= useLeftItem (_yourID w) w
-- | lbPressed = w
| mbPressed = w & clickMousePos .~ _mousePos w
& cameraRot -~ rotation
| otherwise = w
where
inTopInv = _inventoryMode w == TopInventory
lbPressed = ButtonLeft `S.member` pkeys
rbPressed = ButtonRight `S.member` pkeys
mbPressed = ButtonMiddle `S.member` pkeys