Work on inventory dragging

This commit is contained in:
2026-05-15 22:02:17 +01:00
parent e56a953c9b
commit 3a2e92169b
3 changed files with 159 additions and 167 deletions
+2 -2
View File
@@ -271,9 +271,9 @@ invSetSelection sel w =
w
& hud . diSelection ?~ sel
& worldEventFlags . at InventoryChange ?~ ()
& crUpdateItemLocations
-- & crUpdateItemLocations
& setInvPosFromSS -- is this necessary here?
& crUpdateItemLocations
-- & crUpdateItemLocations
invSetSelectionPos :: Int -> Int -> World -> World
invSetSelectionPos i j = invSetSelection (Sel i j)
-6
View File
@@ -309,12 +309,6 @@ startDrag (a, b) w = setcontext $ fromMaybe (invSetSelection (Sel a b) w & hud.d
where
setcontext = input . mouseContext .~ OverInvDrag a (Just (a, b))
-- startDrag (a, b) w = setcontext $ case w ^? hud . diSelection . _Just of
-- Just (Sel i _ xs) | i == a && b `IS.member` xs -> w
-- _ -> invSetSelection (Sel a b mempty) w
-- where
-- setcontext = input . mouseContext .~ OverInvDrag a (Just (a, b))
shiftInvItems ::
Config ->
Int -> -- recurse limit