Use NewIntMap InvInt for crInv
This commit is contained in:
@@ -237,7 +237,7 @@ updateMouseClickInGame cfig w = case w ^. input . mouseContext of
|
||||
OverCombFiltInv (0, j) -> fromMaybe w $ do
|
||||
str <-
|
||||
fmap (take 5) $
|
||||
w ^? cWorld . lWorld . creatures . ix 0 . crInv . ix j
|
||||
w ^? cWorld . lWorld . creatures . ix 0 . crInv . ix (NInt j)
|
||||
>>= \k -> w ^? cWorld . lWorld . items . ix k
|
||||
>>= (listToMaybe . basicItemDisplay)
|
||||
return . (worldEventFlags . at CombineInventoryChange ?~ ()) $
|
||||
@@ -542,7 +542,7 @@ tryCombine (i, j) w = fromMaybe w $ do
|
||||
CombinableItem is it <- sss ^? ix i . ssItems . ix j . siPayload . _Just
|
||||
p <- w ^? cWorld . lWorld . creatures . ix 0 . crPos
|
||||
return $
|
||||
(createItemYou it (foldr (destroyInvItem 0) w (sort is)))
|
||||
(createItemYou it (foldr (destroyInvItem 0 . NInt) w (sort is)))
|
||||
& soundStart InventorySound p wrench1S Nothing
|
||||
& hud . hudElement . diSelection . _Just . _3 .~ mempty
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user