Add section heads to selection sections

This commit is contained in:
2024-11-24 13:24:46 +00:00
parent b2de834bb7
commit 5bea148556
3 changed files with 60 additions and 61 deletions
+9 -4
View File
@@ -127,8 +127,8 @@ updateDisplaySections w cfig =
displaySectionsSizes
mselpos
(getAvailableListLines (invDisplayParams w) cfig)
[statushead,statusdisplay,filtinv, filtclose, invx, youx, closex]
(IM.fromAscList [(-3,0),(-2,2),(-1,0),(0,2),(1,0),(2,0),(3,2)])
[statushead,statusdisplay,invhead,invx,youx, nearbyhead, closex]
(IM.fromAscList [(-4,0),(-3,2),(-2,0),(-1,0),(0,2),(1,0),(2,0),(3,2)])
where
mselpos = w ^? hud . hudElement . diSelection . _Just
invfiltcurs = mselpos ^? _Just . _1 == Just (-1)
@@ -141,9 +141,14 @@ updateDisplaySections w cfig =
filterSectionsPair closefiltcurs plainRegex closeitms "NEARBY" $
w ^? hud . hudElement . diCloseFilter . _Just
(filtclose, closex) = ((2, sfclose), (3, sclose))
nearbyhead = if null sfclose
then if null sclose then (2,mempty) else makehead "NEARBY" 2
else filtclose
youx = (1, youitems)
statushead = (-3,IM.singleton 0 $ SelectionInfo ["STATUS"] 1 False white 0)
statusdisplay = (-2,IM.singleton 0 $ SelectionInfo ["HEALTH "++show (_crHP cr)] 1 False white 0)
makehead str i = (i,IM.singleton 0 $ SelectionInfo [str] 1 False white 0)
statushead = (-4,IM.singleton 0 $ SelectionInfo ["STATUS"] 1 False white 0)
statusdisplay = (-3,IM.singleton 0 $ SelectionInfo ["HEALTH "++show (_crHP cr)] 1 False white 0)
invhead = if null sfinv then makehead "INVENTORY" (-2) else filtinv
youitems = IM.singleton 0 $ SelectionItem [thetext] 1 True invDimColor 0 ()
thetext = displayFreeSlots (crNumFreeSlots cr)
closeitms =