Commit before messing with main inventory display
This commit is contained in:
@@ -35,20 +35,11 @@ tryPutItemInInv cid flit w = case maybeInvSlot of
|
||||
maybeInvSlot = checkInvSlotsYou it w
|
||||
updateItLocation invid w' = w' & cWorld . lWorld . itemLocations . ix (_itID it) .~ InInv cid invid
|
||||
|
||||
--{- | Pick up a specific item. -}
|
||||
--putItemInInv :: Int -> FloorItem -> World -> World
|
||||
--putItemInInv cid flit w = case maybeInvSlot of
|
||||
-- Nothing -> w
|
||||
-- Just i -> w
|
||||
-- & updateItLocation i
|
||||
-- & floorItems %~ IM.delete (_flItID flit)
|
||||
-- & creatures . ix cid . crInv %~ IM.insertWith (const $ itAmount +~ 1) i it
|
||||
-- where
|
||||
-- it = _flIt flit
|
||||
-- maybeInvSlot = checkInvSlotsYou it w
|
||||
-- updateItLocation invid w' = case _itID it of
|
||||
-- Nothing -> w'
|
||||
-- Just j -> w' & itemPositions . ix j .~ InInv cid invid
|
||||
createAndSelectItem :: Item -> World -> World
|
||||
createAndSelectItem itm w = case createPutItem itm w of
|
||||
(Just i, w') -> w' & cWorld . lWorld . creatures . ix 0 . crInvSel .~ InvSel i NoInvSelAction
|
||||
(Nothing, w') -> w'
|
||||
|
||||
createPutItem :: Item -> World -> (Maybe Int, World)
|
||||
createPutItem it w =
|
||||
uncurry (putItemInInvID 0) $
|
||||
|
||||
Reference in New Issue
Block a user