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
+4 -4
View File
@@ -82,7 +82,7 @@ drawRootCursor w sss msel ldp cfig = fromMaybe mempty $ do
guard $ i == 0
inv' <- w ^? cWorld . lWorld . creatures . ix 0 . crInv
let inv = fmap (\k -> w ^?! cWorld . lWorld . items . ix k) inv'
(x, y) <- getRootItemBounds j inv
(x, y) <- getRootItemBounds j $ _unNIntMap inv
return $
drawSSMultiCursor
sss
@@ -94,11 +94,11 @@ drawRootCursor w sss msel ldp cfig = fromMaybe mempty $ do
getRootItemBounds :: Int -> IM.IntMap Item -> Maybe (Int, Int)
getRootItemBounds i inv = do
let ia = invIndents inv -- why indents? why OItem?
let ia = invIndents $ NIntMap inv -- why indents? why OItem?
itm <- ia ^? ix i . _2
let root = locToTop itm
x <- locDTRightmost root ^? locDT . dtValue . _1 . itLocation . ilInvID
y <- locDTLeftmost root ^? locDT . dtValue . _1 . itLocation . ilInvID
x <- locDTRightmost root ^? locDT . dtValue . _1 . itLocation . ilInvID . unNInt
y <- locDTLeftmost root ^? locDT . dtValue . _1 . itLocation . ilInvID . unNInt
return (x, y)
drawMouseOver :: Configuration -> World -> Picture