Work on inventory dragging

This commit is contained in:
2026-05-15 22:52:32 +01:00
parent d5ed27f57c
commit 569ea1e1ab
2 changed files with 127 additions and 119 deletions
+16 -7
View File
@@ -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 ->