Work on inventory dragging
This commit is contained in:
@@ -313,14 +313,23 @@ endCombineRegex w = ssSetCursor (ssLookupDown 0 j) sss
|
||||
return (k - 1)
|
||||
|
||||
startDrag :: (Int, Int) -> World -> World
|
||||
startDrag (a, b) w = setcontext $ fromMaybe (invSetSelection (Sel a b) w & hud.diSections.ix a.ssSet.~ mempty) $ do
|
||||
i <- w ^? hud . diSelection . _Just . slSec
|
||||
xs <- w ^? hud . diSections . ix a . ssSet
|
||||
guard $ i == a && b `IS.member` xs
|
||||
return w
|
||||
startDrag (a, b) w = w
|
||||
& input . mouseContext .~ OverInvDrag a
|
||||
& invSetSelectionPos a b
|
||||
& f
|
||||
where
|
||||
--setcontext = input . mouseContext .~ OverInvDrag a (Just (a, b))
|
||||
setcontext = input . mouseContext .~ OverInvDrag a
|
||||
f = fromMaybe id $ do
|
||||
is <- w ^? hud . diSections . ix a . ssSet
|
||||
guard $ not $ b `IS.member` is
|
||||
return $ hud . diSections . ix a . ssSet .~ mempty
|
||||
-- setcontext $ fromMaybe (invSetSelection (Sel a b) w & hud.diSections.ix a.ssSet.~ mempty) $ do
|
||||
-- i <- w ^? hud . diSelection . _Just . slSec
|
||||
-- xs <- w ^? hud . diSections . ix a . ssSet
|
||||
-- guard $ i == a && b `IS.member` xs
|
||||
-- return w
|
||||
-- where
|
||||
-- --setcontext = input . mouseContext .~ OverInvDrag a (Just (a, b))
|
||||
-- setcontext = input . mouseContext .~ OverInvDrag a
|
||||
|
||||
shiftInvItems ::
|
||||
Config ->
|
||||
|
||||
Reference in New Issue
Block a user