Remove intmap over filters

This commit is contained in:
2024-10-25 22:42:23 +01:00
parent d93c548d3c
commit 46ee29f646
7 changed files with 65 additions and 39 deletions
+5 -3
View File
@@ -65,7 +65,7 @@ updateCombineSections w cfig =
IM.singleton
0
(SelectionInfo ["COMBINATIONS FILTER: " ++ str, numfiltitems] 2 True white 0)
mstr = w ^? hud . hudElement . subInventory . ciFilters . ix (-1) . _Just
mstr = w ^? hud . hudElement . subInventory . ciFilter . _Just
numfiltitems = " " ++ show (length allcombs - length filtcombs) ++ " FILTERED"
regexCombs :: IM.IntMap (SelectionItem ()) -> SelectionItem CombinableItem -> String -> Bool
@@ -131,7 +131,9 @@ updateDisplaySections w cfig sss =
, (i + 1, itms')
)
where
mstr = w ^? hud . hudElement . diFilters . ix i . _Just
mstr = case i of
(-1) -> w ^? hud . hudElement . diInvFilter . _Just
2 -> w ^? hud . hudElement . diCloseFilter . _Just
filtsis = fromMaybe mempty $ do
str <- mstr
return $
@@ -255,7 +257,7 @@ enterCombineInv cfig w =
.~ CombineInventory
sss
selpos
(IM.singleton (-1) Nothing)
Nothing
where
cm' = IM.fromDistinctAscList . zip [0 ..] $ combineList w
cm