Cleanup invSelectionItem

This commit is contained in:
2024-09-30 13:17:10 +01:00
parent fc5539cb38
commit ad76359dcf
11 changed files with 384 additions and 583 deletions
+18 -18
View File
@@ -14,25 +14,25 @@ import LensHelp
import Picture.Base
invSelectionItem' :: Creature -> Int -> Item -> SelectionItem ()
invSelectionItem' cr i it =
SelectionItem
{ _siPictures = pics & ix 0 %~ (++ anyequippos ++ anyhotkey)
, _siHeight = _itInvSize it
, _siIsSelectable = True
, _siColor = col
, _siOffX = 0
, _siPayload = ()
}
where
anyhotkey = maybe [] ((' ':) .hotkeyToString) (cr ^? crInvHotkeys . ix i)
anyequippos = maybe [] (rightPad 8 ' ' . (' ':) . eqPosText) (cr ^? crInvEquipped . ix i)
col = itemInvColor it
pics = case _itCurseStatus it of
UndroppableIdentified -> itemDisplay cr it
_ -> itemDisplay cr it
invSelectionItem' cr i it = invSelectionItem cr i it 0
-- SelectionItem
-- { _siPictures = pics & ix 0 %~ (++ anyequippos ++ anyhotkey)
-- , _siHeight = _itInvSize it
-- , _siIsSelectable = True
-- , _siColor = col
-- , _siOffX = 0
-- , _siPayload = ()
-- }
-- where
-- anyhotkey = maybe [] ((' ':) .hotkeyToString) (cr ^? crInvHotkeys . ix i)
-- anyequippos = maybe [] (rightPad 8 ' ' . (' ':) . eqPosText) (cr ^? crInvEquipped . ix i)
-- col = itemInvColor it
-- pics = case _itCurseStatus it of
-- UndroppableIdentified -> itemDisplay cr it
-- _ -> itemDisplay cr it
invSelectionItem :: Creature -> Int -> (Item,Int,a) -> SelectionItem ()
invSelectionItem cr i (it,indent,_) =
invSelectionItem :: Creature -> Int -> Item -> Int -> SelectionItem ()
invSelectionItem cr i it indent =
SelectionItem
{ _siPictures = pics & ix 0 %~ (++ anyequippos ++ anyhotkey)
, _siHeight = _itInvSize it