Make inventory cursor change when dropping items sensible

This commit is contained in:
2024-11-01 11:23:39 +00:00
parent de12f0ef34
commit 723dfafc18
5 changed files with 117 additions and 70 deletions
+12
View File
@@ -13,6 +13,7 @@ module Dodge.Inventory (
setInvPosFromSS,
module Dodge.Inventory.RBList,
swapInvItems,
scrollAugNextInSection,
) where
import Control.Applicative
@@ -236,6 +237,17 @@ scrollAugInvSel yi w
sss <- he ^? diSections
return $ he & diSelection %~ scrollSelectionSections yi sss
scrollAugNextInSection :: World -> World
scrollAugNextInSection w =
w & hud . hudElement %~ doscroll
& worldEventFlags . at InventoryChange ?~ ()
& setInvPosFromSS
& cWorld . lWorld %~ crUpdateItemLocations 0
where
doscroll he = fromMaybe he $ do
sss <- he ^? diSections
return $ he & diSelection %~ nextInSectionSS sss
selectedCloseObject :: World -> Maybe (Either FloorItem Button)
selectedCloseObject w = do
i <-