Move status to list on left of screen
This commit is contained in:
@@ -127,8 +127,8 @@ updateDisplaySections w cfig =
|
||||
displaySectionsSizes
|
||||
mselpos
|
||||
(getAvailableListLines (invDisplayParams w) cfig)
|
||||
[filtinv, filtclose, invx, youx, closex]
|
||||
(IM.fromAscList [(-1,0),(0,2),(1,0),(2,0),(3,2)])
|
||||
[statushead,statusdisplay,filtinv, filtclose, invx, youx, closex]
|
||||
(IM.fromAscList [(-3,0),(-2,2),(-1,0),(0,2),(1,0),(2,0),(3,2)])
|
||||
where
|
||||
mselpos = w ^? hud . hudElement . diSelection . _Just
|
||||
invfiltcurs = mselpos ^? _Just . _1 == Just (-1)
|
||||
@@ -142,6 +142,8 @@ updateDisplaySections w cfig =
|
||||
w ^? hud . hudElement . diCloseFilter . _Just
|
||||
(filtclose, closex) = ((2, sfclose), (3, sclose))
|
||||
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)
|
||||
youitems = IM.singleton 0 $ SelectionItem [thetext] 1 True invDimColor 0 ()
|
||||
thetext = displayFreeSlots (crNumFreeSlots cr)
|
||||
closeitms =
|
||||
@@ -199,11 +201,9 @@ displayFreeSlots x = case x of
|
||||
_ -> show x ++ " FREE SLOTS"
|
||||
|
||||
sectionsDesiredLines ::
|
||||
-- IM.IntMap (SelectionSection a) ->
|
||||
IM.IntMap (IM.IntMap (SelectionItem a)) ->
|
||||
IM.IntMap Int
|
||||
sectionsDesiredLines = fmap $ alaf Sum foldMap _siHeight
|
||||
--sectionsDesiredLines = fmap $ alaf Sum foldMap _siHeight . _ssItems
|
||||
|
||||
sectionsSizes ::
|
||||
Int -> -- total available lines
|
||||
@@ -261,6 +261,7 @@ updateSectionsPositioning f mselpos allavailablelines lsss indents sss =
|
||||
return i
|
||||
ls = IM.fromList lsss
|
||||
h = IM.intersectionWith ($)
|
||||
-- defaults non-existing offsets to 0
|
||||
g = merge (mapMissing (const ($ 0))) dropMissing (zipWithMatched (const ($)))
|
||||
lk = fromMaybe [] $ fmap ((: []) . fst) mselpos
|
||||
ssizes =
|
||||
|
||||
Reference in New Issue
Block a user