Cleanup
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
-- {-# OPTIONS_GHC -fno-full-laziness #-}
|
-- {-# OPTIONS_GHC -fno-full-laziness #-}
|
||||||
--{-# LANGUAGE TupleSections #-}
|
--{-# LANGUAGE TupleSections #-}
|
||||||
|
{-# LANGUAGE LambdaCase #-}
|
||||||
|
|
||||||
module Dodge.DisplayInventory (
|
module Dodge.DisplayInventory (
|
||||||
updateInventoryPositioning,
|
updateInventoryPositioning,
|
||||||
@@ -64,14 +65,14 @@ updateCombineSections w cfig =
|
|||||||
invitms = fold $ w ^? hud . hudElement . diSections . ix 0 . ssItems
|
invitms = fold $ w ^? hud . hudElement . diSections . ix 0 . ssItems
|
||||||
|
|
||||||
regexCombs :: IM.IntMap (SelectionItem ()) -> SelectionItem CombinableItem -> String -> Bool
|
regexCombs :: IM.IntMap (SelectionItem ()) -> SelectionItem CombinableItem -> String -> Bool
|
||||||
regexCombs inv ci str = case str of
|
regexCombs inv ci = \case
|
||||||
'<' : str' -> f str' ci
|
'<' : str -> f str
|
||||||
_ -> (regexList str . _siPictures) ci
|
str -> (regexList str . _siPictures) ci
|
||||||
where
|
where
|
||||||
f str' si = any (g str') (_ciInvIDs $ _siPayload si)
|
f str = any (g str) (_ciInvIDs $ _siPayload ci)
|
||||||
g str' i = fromMaybe False $ do
|
g str i = fromMaybe False $ do
|
||||||
si' <- inv ^? ix i
|
si <- inv ^? ix i
|
||||||
return $ regexList str' $ _siPictures si'
|
return $ regexList str $ _siPictures si
|
||||||
|
|
||||||
andOrRegex :: (a -> String -> Bool) -> a -> String -> Bool
|
andOrRegex :: (a -> String -> Bool) -> a -> String -> Bool
|
||||||
andOrRegex f x = all (orRegex f x) . List.wordsBy '&'
|
andOrRegex f x = all (orRegex f x) . List.wordsBy '&'
|
||||||
|
|||||||
Reference in New Issue
Block a user