Fix bug pickup up items scrolling down by inventory position
This commit is contained in:
@@ -38,6 +38,7 @@ tryPutItemInInv mcipos itid w = do
|
|||||||
& cWorld . lWorld . items . ix itid . itLocation .~ itloc
|
& cWorld . lWorld . items . ix itid . itLocation .~ itloc
|
||||||
& cWorld . lWorld . floorItems . at itid .~ Nothing
|
& cWorld . lWorld . floorItems . at itid .~ Nothing
|
||||||
& updateselectionextra invid
|
& updateselectionextra invid
|
||||||
|
& updateselection (invid ^. unNInt)
|
||||||
& updatecloseitemset
|
& updatecloseitemset
|
||||||
& maybeselect invid
|
& maybeselect invid
|
||||||
& cWorld . highlightItems . at itid ?~ 20
|
& cWorld . highlightItems . at itid ?~ 20
|
||||||
@@ -53,8 +54,10 @@ tryPutItemInInv mcipos itid w = do
|
|||||||
updatecloseitemset = fromMaybe id $ do
|
updatecloseitemset = fromMaybe id $ do
|
||||||
i <- mcipos
|
i <- mcipos
|
||||||
return $ hud . diSections . ix 3 . ssSet %~ IS.deleteShift i
|
return $ hud . diSections . ix 3 . ssSet %~ IS.deleteShift i
|
||||||
updateselectionextra i = (hud . diSections . ix 0 . ssSet %~ IS.map (f i))
|
updateselectionextra i = hud . diSections . ix 0 . ssSet %~ IS.map (f i)
|
||||||
. (hud . diSelection . _Just . slInt %~ f i)
|
updateselection i = case w ^. hud . diSelection of
|
||||||
|
Just (Sel 0 j) | j >= i -> hud . diSelection . _Just . slInt +~ 1
|
||||||
|
_ -> id
|
||||||
f j i | i >= _unNInt j = i + 1
|
f j i | i >= _unNInt j = i + 1
|
||||||
| otherwise = i
|
| otherwise = i
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user