Filter combine list more sensibly
This commit is contained in:
@@ -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
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user