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