Work on pickup and putdown of inventory items

This commit is contained in:
2021-11-30 16:44:33 +00:00
parent 27b1a6da9e
commit 3754627e0d
10 changed files with 42 additions and 60 deletions
+2 -9
View File
@@ -59,16 +59,10 @@ subInventoryDisplay cfig w = case _inventoryMode w of
cursPos = crInvSelPos cr
crInvSelSize :: Creature -> Int
crInvSelSize cr = theitinvsize $ _crInv cr IM.! _crInvSel cr
where
theitinvsize NoItem = 1 -- this should be removable later
theitinvsize x = _itInvSize x
crInvSelSize cr = _itInvSize $ _crInv cr IM.! _crInvSel cr
crInvSelPos :: Creature -> Int
crInvSelPos cr = sum . fmap theitinvsize . fst $ IM.split (_crInvSel cr) (_crInv cr)
where
theitinvsize NoItem = 1 -- this should be removable later
theitinvsize x = _itInvSize x
crInvSelPos cr = sum . fmap _itInvSize . fst $ IM.split (_crInvSel cr) (_crInv cr)
cursorsZ :: Configuration -> Int -> Item -> Picture
cursorsZ cfig ipos it = case it ^? itTweaks . tweakSel of
@@ -205,7 +199,6 @@ itemText :: Item -> [Picture]
{-# INLINE itemText #-}
--itemText NoItem = dShadCol (greyN 0.5) $ text "----"
--itemText it = dShadCol (_itInvColor it) $ text (_itInvDisplay it it)
itemText NoItem = [text "----"]
itemText it = case _itCurseStatus it of
UndroppableIdentified -> map (color yellow . text) (_itInvDisplay it it)
-- <> color (withAlpha 0.9 thecolor) (polygon (rectNSEW 110 (-65) 885 (-90)))