Commit before trying to deal with leak in main inventory display
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
--{-# LANGUAGE TupleSections #-}
|
||||
|
||||
module Dodge.DisplayInventory (
|
||||
toggleCombineInv,
|
||||
updateInventoryPositioning,
|
||||
updateCombinePositioning,
|
||||
toggleCombineInv,
|
||||
) where
|
||||
|
||||
import Control.Applicative
|
||||
@@ -32,12 +32,6 @@ import Dodge.SelectionSections
|
||||
import qualified ListHelp as List
|
||||
import Picture.Base
|
||||
|
||||
toggleCombineInv :: Universe -> Universe
|
||||
toggleCombineInv uv =
|
||||
uv & case uv ^? uvWorld . hud . hudElement . subInventory of
|
||||
Just CombineInventory{} -> uvWorld . hud . hudElement . subInventory .~ NoSubInventory
|
||||
_ -> uvWorld %~ enterCombineInv (uv ^. uvConfig)
|
||||
|
||||
updateCombinePositioning :: Universe -> Universe
|
||||
updateCombinePositioning u =
|
||||
u
|
||||
@@ -341,16 +335,23 @@ updateSection indent mcsel sis availablelines oldoffset =
|
||||
.~ color moredowncolor (text . replicate 15 $ toEnum 31)
|
||||
| otherwise = id
|
||||
moredowncolor = fromMaybe white $ allstrings ^? ix (offset + availablelines - 1) . _1
|
||||
allstrings = listSelectionColorPicture sis
|
||||
allstrings = foldMap listSelectionColorPicture sis
|
||||
shownstrings = drop offset allstrings
|
||||
|
||||
listSelectionColorPicture :: Foldable t => t (SelectionItem a) -> [(Color, Picture)]
|
||||
listSelectionColorPicture = foldMap f
|
||||
listSelectionColorPicture :: SelectionItem a -> [(Color, Picture)]
|
||||
listSelectionColorPicture si = g <$> _siPictures si
|
||||
where
|
||||
f si = map g (_siPictures si)
|
||||
where
|
||||
indent = 100 * fromIntegral (_siOffX si)
|
||||
g str = (_siColor si, translate indent 0 . color (_siColor si) $ text str)
|
||||
g str = (_siColor si, translate lindent 0 . color (_siColor si) $ text str)
|
||||
lindent = 100 * fromIntegral (_siOffX si)
|
||||
|
||||
regexList :: String -> [String] -> Bool
|
||||
regexList x = any (List.isInfixOf x)
|
||||
|
||||
toggleCombineInv :: Universe -> Universe
|
||||
toggleCombineInv uv =
|
||||
uv & case uv ^? uvWorld . hud . hudElement . subInventory of
|
||||
Just CombineInventory{} -> uvWorld . hud . hudElement . subInventory .~ NoSubInventory
|
||||
_ -> uvWorld %~ enterCombineInv (uv ^. uvConfig)
|
||||
|
||||
enterCombineInv :: Configuration -> World -> World
|
||||
enterCombineInv cfig w =
|
||||
@@ -387,6 +388,3 @@ enterCombineInv cfig w =
|
||||
availablelines
|
||||
0
|
||||
availablelines = getAvailableListLines secondColumnParams cfig
|
||||
|
||||
regexList :: String -> [String] -> Bool
|
||||
regexList x = any (List.isInfixOf x)
|
||||
|
||||
Reference in New Issue
Block a user