Use NewIntMap InvInt for crInv

This commit is contained in:
2025-08-25 10:21:59 +01:00
parent 25e64d5378
commit 3f6f1b4019
38 changed files with 437 additions and 406 deletions
+2 -2
View File
@@ -52,7 +52,7 @@ selectedItemScroll :: Int -> World -> Maybe World
selectedItemScroll yi w = do
i <- you w ^? crManipulation . manObject . imSelectedItem
itm <- you w ^? crInv . ix i >>= \k -> w ^? cWorld . lWorld . items . ix k
return $ itemScroll yi i itm w
return $ itemScroll yi (_unNInt i) itm w
itemScroll :: Int -> Int -> Item -> World -> World
itemScroll yi invid itm w
@@ -84,7 +84,7 @@ updateScopeZoom i w
w & wppointer %~ doScopeZoom (w ^. input . smoothScrollAmount) (w ^. input . mousePos)
| otherwise = w & wppointer %~ resetscope
where
itid = w ^?! cWorld . lWorld . creatures . ix 0 . crInv . ix i
itid = w ^?! cWorld . lWorld . creatures . ix 0 . crInv . ix (NInt i)
wppointer = cWorld . lWorld . items . ix itid . itUse . uScope
resetscope (OpticScope _ _ defz) = OpticScope (V2 0 0) defz defz