Stop displaying hotkeys and equip positions, fixes space leak
This commit is contained in:
@@ -16,7 +16,6 @@ module Dodge.DisplayInventory (
|
||||
import Control.Applicative
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
import Data.Bifunctor
|
||||
import Data.IntMap.Merge.Strict
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
import Data.IntSet (IntSet)
|
||||
@@ -66,7 +65,6 @@ updateCombineSections w cfig =
|
||||
(IM.fromDistinctAscList . zip [0 ..] $ combineList w)
|
||||
"COMBINATIONS"
|
||||
$ w ^? hud . hudElement . subInventory . ciFilter . _Just
|
||||
--invitms = fold $ w ^? hud . hudElement . diSections . ix 0 . ssItems
|
||||
invitms = fold $ w ^? cWorld . lWorld . creatures . ix 0 . crInv
|
||||
|
||||
--regexCombs :: IM.IntMap (SelectionItem ()) -> SelectionItem CombinableItem -> String -> Bool
|
||||
@@ -135,7 +133,7 @@ updateDisplaySections w cfig =
|
||||
[-1 .. 5]
|
||||
[ invhead
|
||||
, sinv
|
||||
, youx
|
||||
, IM.singleton 0 $ SelectionItem [displayFreeSlots (crNumFreeSlots cr)] 1 15 True invDimColor 2 ()
|
||||
, nearbyhead
|
||||
, sclose
|
||||
, interfaceshead
|
||||
@@ -152,11 +150,7 @@ updateDisplaySections w cfig =
|
||||
(sfclose, sclose) =
|
||||
filterSectionsPair closefiltcurs plainRegex closeitms "NEARBY ITEMS" $
|
||||
w ^? hud . hudElement . diCloseFilter . _Just
|
||||
nearbyhead =
|
||||
if null sfclose
|
||||
then if null sclose then mempty else makehead "NEARBY ITEMS"
|
||||
else sfclose
|
||||
youx = youitems
|
||||
nearbyhead = if null sfclose then makehead "NEARBY ITEMS" else sfclose
|
||||
interfaceshead = if null btitems then mempty else makehead "NEARBY INTERFACES"
|
||||
interfaces = btitems
|
||||
btitems =
|
||||
@@ -164,20 +158,20 @@ updateDisplaySections w cfig =
|
||||
mapMaybe (closeButtonToSelectionItem w) (w ^. hud . closeButtons)
|
||||
makehead str = IM.singleton 0 $ SelectionInfo [str] 1 15 False white 0
|
||||
invhead = if null sfinv then makehead "INVENTORY" else sfinv
|
||||
youitems = IM.singleton 0 $ SelectionItem [thetext] 1 15 True invDimColor 2 ()
|
||||
thetext = displayFreeSlots (crNumFreeSlots cr)
|
||||
cr = you w
|
||||
closeitms =
|
||||
IM.fromDistinctAscList . zip [0 ..] $
|
||||
mapMaybe (closeItemToSelectionItem w) (w ^. hud . closeItems)
|
||||
invitems =
|
||||
IM.map
|
||||
(uncurry (invSelectionItem w))
|
||||
(fmap (first removeindentiffiltering) . allInvLocs $ _crInv cr)
|
||||
removeindentiffiltering =
|
||||
if maybe False (not . null) (w ^? hud . hudElement . diInvFilter . _Just)
|
||||
then const 0
|
||||
else id
|
||||
cr = you w
|
||||
(allInvLocs $ _crInv cr)
|
||||
|
||||
-- (fmap (first removeindentiffiltering) . allInvLocs $ _crInv cr)
|
||||
-- removeindentiffiltering =
|
||||
-- if maybe False (not . null) (w ^? hud . hudElement . diInvFilter . _Just)
|
||||
-- then const 0
|
||||
-- else id
|
||||
|
||||
filterSectionsPair ::
|
||||
Bool -> -- check for whether filter is in focus, changes string at the end
|
||||
|
||||
Reference in New Issue
Block a user