Allow for scrolling alteRifle
This commit is contained in:
@@ -61,11 +61,14 @@ selectedItemScroll :: Int -> World -> World
|
|||||||
selectedItemScroll scrollamount w = fromMaybe w $ do
|
selectedItemScroll scrollamount w = fromMaybe w $ do
|
||||||
i <- you w ^? crManipulation . manObject . imSelectedItem
|
i <- you w ^? crManipulation . manObject . imSelectedItem
|
||||||
itm <- you w ^? crInv . ix i
|
itm <- you w ^? crInv . ix i
|
||||||
return $ itemScroll scrollamount itm w
|
return $ itemScroll scrollamount i itm w
|
||||||
|
|
||||||
itemScroll :: Int -> Item -> World -> World
|
itemScroll :: Int -> Int -> Item -> World -> World
|
||||||
itemScroll yi itm w = case itm ^. itType of
|
itemScroll yi invid itm w = case itm ^. itType of
|
||||||
ATTACH ZOOMSCOPE -> updateScopeZoom w
|
ATTACH ZOOMSCOPE -> updateScopeZoom w
|
||||||
|
HELD ALTERIFLE | yi /= 0 -> w
|
||||||
|
& cWorld . lWorld . creatures . ix 0 . crInv . ix invid
|
||||||
|
. itUse . heldAim . aimMuzzles . ix 0 . mzAmmoSlot %~ ((`mod` 2) . (+1))
|
||||||
_ -> w
|
_ -> w
|
||||||
|
|
||||||
-- note that your _crInvLock does not apply to this TODO check that this is what
|
-- note that your _crInvLock does not apply to this TODO check that this is what
|
||||||
|
|||||||
Reference in New Issue
Block a user