Add separate function checking when inventory is filtered
This commit is contained in:
@@ -5,6 +5,7 @@ module Dodge.DisplayInventory (
|
||||
updateCombinePositioning,
|
||||
) where
|
||||
|
||||
import Data.Bifunctor
|
||||
import Dodge.Inventory
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
@@ -132,8 +133,13 @@ updateDisplaySections w cfig =
|
||||
map closeObjectToSelectionItem (w ^. hud . closeObjects)
|
||||
invitems =
|
||||
IM.mapWithKey
|
||||
(\k (y, x) -> invSelectionItem y cr k (x ^. locLDT . ldtValue))
|
||||
(allInvLocs $ _crInv cr)
|
||||
(\k (indent, x) -> invSelectionItem indent cr k (x ^. locLDT . ldtValue))
|
||||
(fmap (first removeindentiffiltering) . allInvLocs $ _crInv cr)
|
||||
-- this clearly deserves refactoring, also check if drawInventory/iextra
|
||||
-- needs it at the same time
|
||||
removeindentiffiltering = if maybe False isFilteringInv (w ^? hud . hudElement . diSections)
|
||||
then const 0
|
||||
else id
|
||||
cr = you w
|
||||
|
||||
-- filtpair i itms filtdescription mstr =
|
||||
|
||||
Reference in New Issue
Block a user