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 . floorItems . at itid .~ Nothing
|
||||
& updateselectionextra invid
|
||||
& updateselection (invid ^. unNInt)
|
||||
& updatecloseitemset
|
||||
& maybeselect invid
|
||||
& cWorld . highlightItems . at itid ?~ 20
|
||||
@@ -53,8 +54,10 @@ tryPutItemInInv mcipos itid w = do
|
||||
updatecloseitemset = fromMaybe id $ do
|
||||
i <- mcipos
|
||||
return $ hud . diSections . ix 3 . ssSet %~ IS.deleteShift i
|
||||
updateselectionextra i = (hud . diSections . ix 0 . ssSet %~ IS.map (f i))
|
||||
. (hud . diSelection . _Just . slInt %~ f i)
|
||||
updateselectionextra i = hud . diSections . ix 0 . ssSet %~ IS.map (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
|
||||
| otherwise = i
|
||||
|
||||
|
||||
Reference in New Issue
Block a user