Allow close items to be collected using selection sets

This commit is contained in:
2026-05-18 10:02:24 +01:00
parent e8d09f773c
commit b353263b0e
2 changed files with 198 additions and 198 deletions
+3 -3
View File
@@ -129,7 +129,6 @@ changeSwapSelSet yi w
swapSelSet :: (Int -> IS.IntSet -> World -> World) -> World -> World
swapSelSet f w = fromMaybe w $ do
-- Sel j i is' <- w ^. hud . diSelection
Sel j i <- w ^. hud . diSelection
is' <- w ^? hud . diSections . ix j . ssSet
let is = if IS.null is'
@@ -179,13 +178,14 @@ concurrentIS = go . IS.minView
collectInvItems :: Int -> IS.IntSet -> World -> World
collectInvItems secid is w = fromMaybe w $ do
guard $ secid == 0
guard $ secid == 0 || secid == 3
(j, js) <- IS.minView is
return $ h j js w
where
h j js w' = fromMaybe w' $ do
(k, ks) <- IS.minView js
return . h (j + 1) ks $ swapInvItems (\_ _ -> Just (j + 1)) k w'
-- return . h (j + 1) ks $ swapInvItems (\_ _ -> Just (j + 1)) k w'
return . h (j + 1) ks $ swapItemWith (\_ _ -> Just (j + 1)) (secid,k) w'
changeSwapSel :: Int -> World -> World
changeSwapSel yi w