Add section heads to selection sections
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user