Tweak display, scrolling of item values

This commit is contained in:
2025-01-07 21:10:29 +00:00
parent b3cf10bd26
commit 5fa5bdf21e
18 changed files with 367 additions and 384 deletions
+7 -12
View File
@@ -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