Tweak display, scrolling of item values
This commit is contained in:
@@ -2,6 +2,7 @@ module Dodge.Update.Scroll (
|
||||
updateWheelEvent,
|
||||
) where
|
||||
|
||||
import Padding
|
||||
import Control.Monad
|
||||
import qualified Data.Map.Strict as M
|
||||
import Data.Maybe
|
||||
@@ -48,24 +49,18 @@ selectedItemScroll yi w = do
|
||||
|
||||
itemScroll :: Int -> Int -> Item -> World -> World
|
||||
itemScroll yi invid itm w
|
||||
| isJust $ itm ^? itUse . uInt =
|
||||
w
|
||||
& cWorld . lWorld . creatures . ix 0 . crInv . ix invid
|
||||
. itUse
|
||||
. uInt
|
||||
+~ yi
|
||||
| isJust $ itm ^? itUse . uInt = w & itmlens . itUse . uInt +~ yi
|
||||
| Just xs <- itm ^? itUse . uaParams . apProjectiles = w
|
||||
& itmlens . itUse . uaParams . apProjectiles .~ rotateList yi xs
|
||||
| ATTACH ZOOMSCOPE <- itm ^. itType = updateScopeZoom invid w
|
||||
| HELD ALTERIFLE <- itm ^. itType
|
||||
, yi /= 0 =
|
||||
w
|
||||
& cWorld . lWorld . creatures . ix 0 . crInv . ix invid
|
||||
. itUse
|
||||
. heldAim
|
||||
. aimMuzzles
|
||||
. ix 0
|
||||
. mzAmmoSlot
|
||||
& itmlens . itUse . heldAim . aimMuzzles . ix 0 . mzAmmoSlot
|
||||
%~ ((`mod` 2) . (+ 1))
|
||||
| otherwise = w
|
||||
where
|
||||
itmlens = cWorld . lWorld . creatures . ix 0 . crInv . ix invid
|
||||
|
||||
-- note that your _crInvLock does not apply to this TODO check that this is what
|
||||
-- is wanted
|
||||
|
||||
Reference in New Issue
Block a user