Tweak characters
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
@@ -53,9 +53,7 @@ updateCombineInventory w cfig sss =
|
|||||||
filtcombs = fromMaybe allcombs $ do
|
filtcombs = fromMaybe allcombs $ do
|
||||||
str <- mstr
|
str <- mstr
|
||||||
invitms <- w ^? hud . hudElement . diSections . sssSections . ix 0 . ssItems
|
invitms <- w ^? hud . hudElement . diSections . sssSections . ix 0 . ssItems
|
||||||
--return $ IM.filter (regexList str . _siPictures) allcombs
|
return $ IM.filter (flip (andOrRegex $ regexCombs invitms) str) allcombs
|
||||||
return $ IM.filter (flip (andOrRegex $ regexCombs' invitms) str) allcombs
|
|
||||||
--return $ regexCombs invitms str allcombs
|
|
||||||
showncombs
|
showncombs
|
||||||
| null filtcombs = IM.singleton 0 $ SelectionInfo ["No possible combinations"] 1 False white 0
|
| null filtcombs = IM.singleton 0 $ SelectionInfo ["No possible combinations"] 1 False white 0
|
||||||
| otherwise = filtcombs
|
| otherwise = filtcombs
|
||||||
@@ -68,8 +66,8 @@ updateCombineInventory w cfig sss =
|
|||||||
mstr = w ^? hud . hudElement . subInventory . ciSections . sssExtra . sssFilters . ix (-1) . _Just
|
mstr = w ^? hud . hudElement . subInventory . ciSections . sssExtra . sssFilters . ix (-1) . _Just
|
||||||
numfiltitems = " " ++ show (length allcombs - length filtcombs) ++ " FILTERED"
|
numfiltitems = " " ++ show (length allcombs - length filtcombs) ++ " FILTERED"
|
||||||
|
|
||||||
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 str = case str of
|
||||||
'<':str' -> f str' ci
|
'<':str' -> f str' ci
|
||||||
_ -> (regexList str . _siPictures) ci
|
_ -> (regexList str . _siPictures) ci
|
||||||
where
|
where
|
||||||
@@ -82,9 +80,9 @@ andOrRegex :: (a -> String -> Bool) -> a -> String -> Bool
|
|||||||
andOrRegex f x str = all (orRegex f x) (wordsBy '&' str)
|
andOrRegex f x str = all (orRegex f x) (wordsBy '&' str)
|
||||||
|
|
||||||
orRegex :: (a -> String -> Bool) -> a -> String -> Bool
|
orRegex :: (a -> String -> Bool) -> a -> String -> Bool
|
||||||
orRegex _ _ [] = True
|
orRegex f x str = case words str of
|
||||||
orRegex f x str = any (f x) (words str)
|
[] -> True
|
||||||
|
xs -> any (f x) xs
|
||||||
|
|
||||||
updateDisplayInventory :: World -> Configuration -> SelectionSections () -> SelectionSections ()
|
updateDisplayInventory :: World -> Configuration -> SelectionSections () -> SelectionSections ()
|
||||||
updateDisplayInventory w cfig sss =
|
updateDisplayInventory w cfig sss =
|
||||||
@@ -128,9 +126,12 @@ updateDisplayInventory w cfig sss =
|
|||||||
(SelectionRegex [filtdescription ++ "FILTER: " ++ str, numfiltitems] 2 True white 0)
|
(SelectionRegex [filtdescription ++ "FILTER: " ++ str, numfiltitems] 2 True white 0)
|
||||||
itms' = fromMaybe itms $ do
|
itms' = fromMaybe itms $ do
|
||||||
str <- mstr
|
str <- mstr
|
||||||
return $ IM.filter (regexList str . _siPictures) itms
|
return $ IM.filter (plainRegex str) itms
|
||||||
numfiltitems = " " ++ show (length itms - length itms') ++ " FILTERED"
|
numfiltitems = " " ++ show (length itms - length itms') ++ " FILTERED"
|
||||||
|
|
||||||
|
plainRegex :: String -> SelectionItem a -> Bool
|
||||||
|
plainRegex = flip $ andOrRegex (\si str -> regexList str (_siPictures si))
|
||||||
|
|
||||||
displayFreeSlots :: Int -> String
|
displayFreeSlots :: Int -> String
|
||||||
displayFreeSlots x = case x of
|
displayFreeSlots x = case x of
|
||||||
0 -> "INVENTORY FULL"
|
0 -> "INVENTORY FULL"
|
||||||
|
|||||||
Reference in New Issue
Block a user