Allow close items to be collected using selection sets
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user