Fix cursor selection when dropping filtered items
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user