Space only picks up filtered close items

This commit is contained in:
2024-11-25 15:47:32 +00:00
parent bbf95c91d8
commit 32f0d287e8
4 changed files with 15 additions and 7 deletions
+6 -4
View File
@@ -100,7 +100,7 @@ updateMouseHeldInGame cfig w = case w ^. input . mouseContext of
is <- w ^? hud . hudElement . diSelectionExtra
return $ if concurrentIS is
then shiftInvItems k x ab bn is ss w
else collectInvItems is w
else collectInvItems k is w
_ -> w
where
ldp = invDisplayParams w
@@ -231,8 +231,9 @@ concurrentIS = go . IS.minView
(j, js) <- IS.minView is
return $ i + 1 == j && go (Just (j, js))
collectInvItems :: IS.IntSet -> World -> World
collectInvItems is w = fromMaybe w $ do
collectInvItems :: Int -> IS.IntSet -> World -> World
collectInvItems secid is w = fromMaybe w $ do
guard $ secid == 0
(j, js) <- IS.minView is
return $ h j js w
where
@@ -494,7 +495,8 @@ selCloseObj w = selobj <|> firstcitem <|> firstcbut
fmap Right $ w ^? cWorld . lWorld . buttons . ix k
_ -> Nothing
firstcitem = do
NInt k <- w ^? hud . closeItems . ix 0
k' <- (w ^? hud . hudElement . diSections . ix 3 . ssItems) >>= (fmap fst . IM.lookupMin)
NInt k <- w ^? hud . closeItems . ix k'
fmap Left $ w ^? cWorld . lWorld . floorItems . unNIntMap . ix k
firstcbut = do
k <- w ^? hud . closeButtons . ix 0