Work on collapsing close item list

This commit is contained in:
2023-02-11 09:09:23 +00:00
parent a8e00ac025
commit 10f732d489
6 changed files with 183 additions and 63 deletions
+17
View File
@@ -1,5 +1,6 @@
module Dodge.Inventory.SelectionList
( invSelectionItem
, invSelectionItem'
, closeObjectToSelectionItem
)
where
@@ -24,6 +25,22 @@ import LensHelp
-- Just CombineInventory{} -> Nothing
-- _ -> Just $ yourInvSel w
--
invSelectionItem' :: Creature -> Int -> Item -> SelectionItem ()
invSelectionItem' cr i it = SelectionItem
{ _siPictures = pics
, _siHeight = length pics
, _siIsSelectable = True
, _siWidth = 15
, _siColor = col
, _siOffX = 0
, _siPayload = ()
}
where
col = _itInvColor it
pics = take (itSlotsTaken it) . (++ replicate 10 "*") $ case _itCurseStatus it of
UndroppableIdentified -> itemDisplay it
_ | cr ^? crInvSel . isel . ispItem == Just i -> selectedItemDisplay cr it
_ -> itemDisplay it
invSelectionItem :: Creature -> (Int,Item) -> SelectionItem ()
invSelectionItem cr (i,it) = SelectionItem
{ _siPictures = pics