Fix indentation display of indented sections

This commit is contained in:
2024-11-24 14:07:54 +00:00
parent 5bea148556
commit e6c2b659fd
6 changed files with 42 additions and 36 deletions
+3 -3
View File
@@ -138,18 +138,18 @@ updateDisplaySections w cfig =
(filtinv, invx) = ((-1, sfinv), (0, sinv))
closefiltcurs = mselpos ^? _Just . _1 == Just 2
(sfclose, sclose) =
filterSectionsPair closefiltcurs plainRegex closeitms "NEARBY" $
filterSectionsPair closefiltcurs plainRegex closeitms "NEARBY ITEMS" $
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
then if null sclose then (2,mempty) else makehead "NEARBY ITEMS" 2
else filtclose
youx = (1, youitems)
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 ()
youitems = IM.singleton 0 $ SelectionItem [thetext] 1 True invDimColor 2 ()
thetext = displayFreeSlots (crNumFreeSlots cr)
closeitms =
IM.fromDistinctAscList . zip [0 ..] $