Improve inventory display
Extant bugs: can get to INVENTORY heading section when deleting nearby filter if inventory is empty
This commit is contained in:
@@ -133,7 +133,7 @@ updateDisplaySections w cfig =
|
|||||||
, nearbyhead
|
, nearbyhead
|
||||||
, sclose
|
, sclose
|
||||||
, interfaceshead
|
, interfaceshead
|
||||||
, interfaces
|
, btitems
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
@@ -146,9 +146,10 @@ updateDisplaySections w cfig =
|
|||||||
(sfclose, sclose) =
|
(sfclose, sclose) =
|
||||||
filterSectionsPair closefiltcurs plainRegex closeitms "NEARBY ITEMS" $
|
filterSectionsPair closefiltcurs plainRegex closeitms "NEARBY ITEMS" $
|
||||||
w ^? hud . hudElement . diCloseFilter . _Just
|
w ^? hud . hudElement . diCloseFilter . _Just
|
||||||
nearbyhead = if null sfclose then makehead "NEARBY ITEMS" else sfclose
|
nearbyhead
|
||||||
|
| null sfclose && not (null sclose) = makehead "NEARBY ITEMS"
|
||||||
|
| otherwise = sfclose
|
||||||
interfaceshead = if null btitems then mempty else makehead "NEARBY INTERFACES"
|
interfaceshead = if null btitems then mempty else makehead "NEARBY INTERFACES"
|
||||||
interfaces = btitems
|
|
||||||
btitems =
|
btitems =
|
||||||
IM.fromDistinctAscList . zip [0 ..] $
|
IM.fromDistinctAscList . zip [0 ..] $
|
||||||
mapMaybe (closeButtonToSelectionItem w) (w ^. hud . closeButtons)
|
mapMaybe (closeButtonToSelectionItem w) (w ^. hud . closeButtons)
|
||||||
@@ -324,39 +325,7 @@ enterCombineInv cfig w =
|
|||||||
w & hud . hudElement . subInventory
|
w & hud . hudElement . subInventory
|
||||||
.~ CombineInventory
|
.~ CombineInventory
|
||||||
{ _ciSections = updateCombineSections w cfig mempty
|
{ _ciSections = updateCombineSections w cfig mempty
|
||||||
, _ciSelection = selpos
|
, _ciSelection = Just (0,0,mempty)
|
||||||
, _ciFilter = Nothing
|
, _ciFilter = Nothing
|
||||||
}
|
}
|
||||||
-- .~ CombineInventory
|
& hud . hudElement . diInvFilter .~ Nothing
|
||||||
-- { _ciSections = IM.fromDistinctAscList [(-1, filtsection), (0, combsection)]
|
|
||||||
-- , _ciSelection = selpos
|
|
||||||
-- , _ciFilter = Nothing
|
|
||||||
-- }
|
|
||||||
& hud . hudElement . diInvFilter
|
|
||||||
.~ Nothing
|
|
||||||
where
|
|
||||||
cm' = IM.fromDistinctAscList . zip [0 ..] $ combineList w
|
|
||||||
cm
|
|
||||||
| null cm' =
|
|
||||||
IM.singleton 0 $
|
|
||||||
SelectionInfo ["No possible combinations"] 1 25 False white 0
|
|
||||||
| otherwise = cm'
|
|
||||||
selpos
|
|
||||||
| null cm' = Nothing
|
|
||||||
| otherwise = Just (0, 0, mempty)
|
|
||||||
filtsection =
|
|
||||||
SelectionSection
|
|
||||||
{ _ssItems = mempty
|
|
||||||
, _ssOffset = 0
|
|
||||||
, _ssShownItems = mempty
|
|
||||||
, _ssShownLength = 0
|
|
||||||
, _ssIndent = 0
|
|
||||||
}
|
|
||||||
combsection =
|
|
||||||
updateSection
|
|
||||||
0
|
|
||||||
(Just 0)
|
|
||||||
cm
|
|
||||||
availablelines
|
|
||||||
0
|
|
||||||
availablelines = getAvailableListLines secondColumnParams cfig
|
|
||||||
|
|||||||
Reference in New Issue
Block a user