Commit before extending selection sections: overlapping elements

This commit is contained in:
2023-05-19 13:38:21 +01:00
parent 2f0bb5115b
commit ac87621640
13 changed files with 131 additions and 115 deletions
+9 -7
View File
@@ -15,21 +15,22 @@ import Picture.Base
invSelectionItem :: Creature -> Int -> Item -> SelectionItem ()
invSelectionItem cr i it =
SelectionItem
{ _siPictures = pics & ix 0 %~ (++ anyequippos ++ anyhotkey)
, _siHeight = length pics
{ _siPictures = (pics & ix 0 %~ (++ anyequippos ++ anyhotkey))
, _siHeight = itSlotsTaken it
, _siIsSelectable = True
, _siColor = col
, _siOffX = 0
, _siOffY = 0
, _siPayload = ()
}
where
anyhotkey = maybe [] ((' ':) .hotkeyToString) (cr ^? crInvHotkeys . ix i)
anyequippos = maybe [] (rightPad 8 ' ' . (' ':) . eqPosText) (cr ^? crInvEquipped . ix i)
col = _itInvColor it
pics = take (itSlotsTaken it) . (++ replicate 10 "*") $ case _itCurseStatus it of
UndroppableIdentified -> itemDisplay it
_ | cr ^? crManipulation . manObject . inInventory . ispItem == Just i -> selectedItemDisplay cr it
_ -> itemDisplay it
pics = case _itCurseStatus it of
UndroppableIdentified -> itemDisplay cr it
-- _ | cr ^? crManipulation . manObject . inInventory . ispItem == Just i -> selectedItemDisplay cr it
_ -> itemDisplay cr it
hotkeyToString :: Hotkey -> String
hotkeyToString x = case x of
@@ -55,6 +56,7 @@ closeObjectToSelectionItem e =
, --, _siWidth = 15
_siColor = col
, _siOffX = 2
, _siOffY = 0
, _siPayload = ()
}
where
@@ -63,5 +65,5 @@ closeObjectToSelectionItem e =
--
closeObjectToTextPictures :: Either FloorItem Button -> ([String], Color)
closeObjectToTextPictures e = case e of
Left flit -> let it = _flIt flit in (itemDisplay it, _itInvColor it)
Left flit -> let it = _flIt flit in (basicItemDisplay it, _itInvColor it)
Right bt -> ([_btText bt], yellow)