Add separate function checking when inventory is filtered

This commit is contained in:
2024-11-03 09:50:18 +00:00
parent 7bafb1e9e6
commit feec061aa6
7 changed files with 75 additions and 61 deletions
+8 -2
View File
@@ -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 =