Filter combine list more sensibly
This commit is contained in:
@@ -8,6 +8,7 @@ module Dodge.Combine (
|
|||||||
enterCombineInv,
|
enterCombineInv,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import qualified Data.IntSet as IS
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
import Data.Bifunctor
|
import Data.Bifunctor
|
||||||
@@ -44,10 +45,10 @@ combineItemListYouX = map (first $ concatMap g) . lookupItems . yourInv
|
|||||||
g (amount, i) = replicate (_getItAmount amount) i
|
g (amount, i) = replicate (_getItAmount amount) i
|
||||||
|
|
||||||
combineListInfo :: World -> [([Int], ([String], Item))]
|
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
|
where
|
||||||
inv = yourInv w
|
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 :: World -> [([Int], Item)]
|
||||||
combineItemListYou = map (second snd) . combineListInfo
|
combineItemListYou = map (second snd) . combineListInfo
|
||||||
|
|||||||
+1
-1
@@ -225,7 +225,7 @@ listControls =
|
|||||||
, ("m", "DISPLAY MAP")
|
, ("m", "DISPLAY MAP")
|
||||||
, ("f", "DROP ITEM")
|
, ("f", "DROP ITEM")
|
||||||
, ("c", "COMBINE ITEMS")
|
, ("c", "COMBINE ITEMS")
|
||||||
, ("x", "TWEAK ITEMS")
|
, ("x", "EXAMINE ITEMS")
|
||||||
, ("c[esc]", "PAUSE")
|
, ("c[esc]", "PAUSE")
|
||||||
, ("qe", "ROTATE CAMERA")
|
, ("qe", "ROTATE CAMERA")
|
||||||
, ("F5", "QUICKSAVE")
|
, ("F5", "QUICKSAVE")
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ drawSubInventory subinv cfig w = case subinv of
|
|||||||
NoSubInventory -> drawNoSubInventory cfig w
|
NoSubInventory -> drawNoSubInventory cfig w
|
||||||
ExamineInventory mtweaki ->
|
ExamineInventory mtweaki ->
|
||||||
titledSub
|
titledSub
|
||||||
"TWEAK"
|
"EXAMINE"
|
||||||
(defaultSubInvSelectionList & slItems .~ ammoTweakSelectionItems itm)
|
(defaultSubInvSelectionList & slItems .~ ammoTweakSelectionItems itm)
|
||||||
<> examineInventoryExtra mtweaki itm cfig
|
<> examineInventoryExtra mtweaki itm cfig
|
||||||
DisplayTerminal tid -> displayTerminal tid cfig (w ^. cWorld . lWorld)
|
DisplayTerminal tid -> displayTerminal tid cfig (w ^. cWorld . lWorld)
|
||||||
|
|||||||
Reference in New Issue
Block a user