Start implementing attachable scroll items

This commit is contained in:
2023-11-08 18:39:38 +00:00
parent 8f0dd8cd1b
commit f26d380c1b
20 changed files with 119 additions and 116 deletions
+8 -4
View File
@@ -26,10 +26,14 @@ updateWheelEvent yi w = case w ^. hud . hudElement of
-- functions that modify the inventory should be centralised so that
-- this lock can be sensibly applied, perhaps
| w ^?! cWorld . lWorld . creatures . ix 0 . crInvLock -> w
| rbDown -> case (yourItem w ^? _Just . itUse . heldScroll, _rbOptions w) of
(_, EquipOptions{}) -> w & rbOptions . opSel %~ scrollRBOption yi rbscrollmax
(Nothing, _) -> closeObjScrollDir y w
(Just f, _) -> doHeldScroll f y (you w) w
-- | rbDown -> case (yourItem w ^? _Just . itUse . heldScroll, _rbOptions w) of
-- (_, EquipOptions{}) -> w & rbOptions . opSel %~ scrollRBOption yi rbscrollmax
-- (Nothing, _) -> closeObjScrollDir y w
-- (Just f, _) -> doHeldScroll f y (you w) w
| rbDown -> case (yourScrollAttachment w, _rbOptions w) of
(_,EquipOptions{}) -> w & rbOptions . opSel %~ scrollRBOption yi rbscrollmax
(Nothing, _) -> w -- closeObjScrollDir y w
(Just (invid,hs), _) -> doHeldScroll invid hs y w
| lbDown -> w & wCam . camZoom +~ y
| invKeyDown -> changeSwapSel yi w
| otherwise -> stopSoundFrom (CrReloadSound 0) $ scrollAugInvSel yi w