From beac123dd2f1250a4bb1b4e8b046af95c61200f4 Mon Sep 17 00:00:00 2001 From: justin Date: Sat, 31 Dec 2022 12:34:21 +0000 Subject: [PATCH] Filter combine list more sensibly --- src/Dodge/Combine.hs | 5 +++-- src/Dodge/Menu.hs | 2 +- src/Dodge/Render/HUD.hs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Dodge/Combine.hs b/src/Dodge/Combine.hs index d0eb469fc..6ee361555 100644 --- a/src/Dodge/Combine.hs +++ b/src/Dodge/Combine.hs @@ -8,6 +8,7 @@ module Dodge.Combine ( enterCombineInv, ) where +import qualified Data.IntSet as IS import Control.Lens import Control.Monad import Data.Bifunctor @@ -44,10 +45,10 @@ combineItemListYouX = map (first $ concatMap g) . lookupItems . yourInv g (amount, i) = replicate (_getItAmount amount) i combineListInfo :: World -> [([Int], ([String], Item))] -combineListInfo w = filter (f . snd . snd) . map (cmm inv) $ combineItemListYouX w +combineListInfo w = filter f . map (cmm inv) $ combineItemListYouX w where inv = yourInv w - f itm = _itType itm `notElem` fmap _itType inv + f (is,(_,itm)) = _itType itm `notElem` fmap _itType (IM.restrictKeys inv (IS.fromList is)) combineItemListYou :: World -> [([Int], Item)] combineItemListYou = map (second snd) . combineListInfo diff --git a/src/Dodge/Menu.hs b/src/Dodge/Menu.hs index 1537366d0..c19700714 100644 --- a/src/Dodge/Menu.hs +++ b/src/Dodge/Menu.hs @@ -225,7 +225,7 @@ listControls = , ("m", "DISPLAY MAP") , ("f", "DROP ITEM") , ("c", "COMBINE ITEMS") - , ("x", "TWEAK ITEMS") + , ("x", "EXAMINE ITEMS") , ("c[esc]", "PAUSE") , ("qe", "ROTATE CAMERA") , ("F5", "QUICKSAVE") diff --git a/src/Dodge/Render/HUD.hs b/src/Dodge/Render/HUD.hs index 263457e93..10f972e09 100644 --- a/src/Dodge/Render/HUD.hs +++ b/src/Dodge/Render/HUD.hs @@ -89,7 +89,7 @@ drawSubInventory subinv cfig w = case subinv of NoSubInventory -> drawNoSubInventory cfig w ExamineInventory mtweaki -> titledSub - "TWEAK" + "EXAMINE" (defaultSubInvSelectionList & slItems .~ ammoTweakSelectionItems itm) <> examineInventoryExtra mtweaki itm cfig DisplayTerminal tid -> displayTerminal tid cfig (w ^. cWorld . lWorld)