Fix cursor selection when dropping filtered items

This commit is contained in:
2023-02-23 09:38:06 +00:00
parent 88eb94abaa
commit da49d7003e
6 changed files with 46 additions and 384 deletions
+7 -1
View File
@@ -1,5 +1,10 @@
module Dodge.Inventory.Add where
module Dodge.Inventory.Add
( tryPutItemInInv
, createPutItem
, createAndSelectItem
)where
import Dodge.Data.SelectionList
import Control.Lens
import Data.Maybe
import Dodge.Base.You
@@ -38,6 +43,7 @@ tryPutItemInInv cid flit w = case maybeInvSlot of
createAndSelectItem :: Item -> World -> World
createAndSelectItem itm w = case createPutItem itm w of
(Just i, w') -> w'
& hud . hudElement . diSections . sssExtra . sssSelPos ?~ (0,i)
& cWorld . lWorld . creatures . ix 0 . crManipulation . manObject
.~ InInventory (SelItem i NoInvSelAction)
(Nothing, w') -> w'