Filter combine list more sensibly

This commit is contained in:
2022-12-31 12:34:21 +00:00
parent 67a13c1d01
commit beac123dd2
3 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -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
+1 -1
View File
@@ -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")
+1 -1
View File
@@ -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)