Show items that are to be combined
This commit is contained in:
@@ -105,20 +105,6 @@ rmSelectedInvItem cid w = case w ^? cWorld . lWorld . creatures . ix cid . crMan
|
|||||||
Just i -> rmInvItem cid i w
|
Just i -> rmInvItem cid i w
|
||||||
Nothing -> w
|
Nothing -> w
|
||||||
|
|
||||||
selSecSelSize :: Int -> Int -> SelectionSections a -> Maybe Int
|
|
||||||
selSecSelSize i j sss = fmap length $ sss ^? sssSections . ix i . ssItems . ix j . siPictures
|
|
||||||
|
|
||||||
selSecSelPos :: Int -> Int -> SelectionSections a -> Maybe Int
|
|
||||||
selSecSelPos i j sss = do
|
|
||||||
ss <- sss ^? sssSections . ix i
|
|
||||||
return . (secpos +)
|
|
||||||
. subtract (ss ^. ssOffset)
|
|
||||||
. sum
|
|
||||||
. fmap (length . _siPictures)
|
|
||||||
. fst $ IM.split j (ss ^. ssItems)
|
|
||||||
where
|
|
||||||
secpos = sum . fmap (length . _ssShownItems) . fst $ IM.split i $ sss ^. sssSections
|
|
||||||
|
|
||||||
selNumPos :: ManipulatedObject -> World -> Maybe Int
|
selNumPos :: ManipulatedObject -> World -> Maybe Int
|
||||||
selNumPos mo w = w ^? hud . hudElement . diSections >>=
|
selNumPos mo w = w ^? hud . hudElement . diSections >>=
|
||||||
case mo of
|
case mo of
|
||||||
|
|||||||
+22
-1
@@ -178,7 +178,28 @@ examineInventoryExtra mtweaki mitm cfig = fromMaybe mempty $ do
|
|||||||
|
|
||||||
--combineInventoryExtra :: SelectionIntMap CombinableItem -> Maybe Int -> Configuration -> World -> Picture
|
--combineInventoryExtra :: SelectionIntMap CombinableItem -> Maybe Int -> Configuration -> World -> Picture
|
||||||
combineInventoryExtra :: SelectionSections CombinableItem -> Configuration -> World -> Picture
|
combineInventoryExtra :: SelectionSections CombinableItem -> Configuration -> World -> Picture
|
||||||
combineInventoryExtra sss cfig w = mempty
|
combineInventoryExtra sss cfig w = fromMaybe mempty $ do
|
||||||
|
(i,j) <- sss ^? sssSelPos . _Just
|
||||||
|
si <- sss ^? sssSections . ix i . ssItems . ix j
|
||||||
|
cpos <- selSecSelPos i j sss
|
||||||
|
let col = _siColor si
|
||||||
|
return $
|
||||||
|
pictures
|
||||||
|
[ fromMaybe mempty $ do
|
||||||
|
strs <- si ^? siPayload . ciInfo
|
||||||
|
return $ listPicturesAtOff (subInvX + 150) 60 cfig cpos $ map (color red . text) strs
|
||||||
|
, fromMaybe mempty $ do
|
||||||
|
lnks <- si ^? siPayload . ciInvIDs
|
||||||
|
return $
|
||||||
|
lnkMidPosInvSelsCol cfig w cpos col lnks
|
||||||
|
-- <> foldMap (topCursorTypeWidth listCursorNESW (topInvW + 2) cfig w) lnks
|
||||||
|
<> foldMap invcursor lnks
|
||||||
|
<> combineCounts cfig w lnks
|
||||||
|
]
|
||||||
|
where
|
||||||
|
invcursor i = fromMaybe mempty $ do
|
||||||
|
sss' <- w ^? hud . hudElement . diSections
|
||||||
|
return $ selSecDrawCursor 17 [North,South,East] cfig (invDisplayParams w) sss' 0 i
|
||||||
-- fromMaybe mempty $ do
|
-- fromMaybe mempty $ do
|
||||||
-- i <- mi
|
-- i <- mi
|
||||||
-- let cpos = getIthPos i (sm ^. smShownItems)
|
-- let cpos = getIthPos i (sm ^. smShownItems)
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ module Dodge.SelectionSections (
|
|||||||
ssLookupGT,
|
ssLookupGT,
|
||||||
ssSetCursor,
|
ssSetCursor,
|
||||||
setFirstPosSelectionSections,
|
setFirstPosSelectionSections,
|
||||||
|
selSecSelPos,
|
||||||
|
selSecSelSize,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Applicative
|
import Control.Applicative
|
||||||
@@ -23,11 +25,6 @@ setFirstPosSelectionSections sss = fromMaybe sss $ do
|
|||||||
(i, j, _) <- ssLookupMin sss
|
(i, j, _) <- ssLookupMin sss
|
||||||
return $ sss & sssSelPos ?~ (i, j)
|
return $ sss & sssSelPos ?~ (i, j)
|
||||||
|
|
||||||
--scrollUpSelectionSections :: SelectionSections a -> SelectionSections a
|
|
||||||
--scrollUpSelectionSections sss = fromMaybe (setFirstPosSelectionSections sss) $ do
|
|
||||||
-- (i, j) <- sss ^? sssSelPos . _Just
|
|
||||||
-- (i', j', _) <- ssLookupUp i j sss
|
|
||||||
-- return $ sss & sssSelPos ?~ (i', j')
|
|
||||||
scrollUpSelectionSections :: SelectionSections a -> SelectionSections a
|
scrollUpSelectionSections :: SelectionSections a -> SelectionSections a
|
||||||
scrollUpSelectionSections sss = sss & sssSelPos .~
|
scrollUpSelectionSections sss = sss & sssSelPos .~
|
||||||
fmap f (ssScrollUp (sss & sssSections %~ fmap (ssItems %~ IM.filter _siIsSelectable)))
|
fmap f (ssScrollUp (sss & sssSections %~ fmap (ssItems %~ IM.filter _siIsSelectable)))
|
||||||
@@ -128,5 +125,19 @@ ssLookupGE' i sss = do
|
|||||||
Just (j', si) -> return (i', j', si)
|
Just (j', si) -> return (i', j', si)
|
||||||
Nothing -> ssLookupGT' i' sss
|
Nothing -> ssLookupGT' i' sss
|
||||||
|
|
||||||
|
selSecSelSize :: Int -> Int -> SelectionSections a -> Maybe Int
|
||||||
|
selSecSelSize i j sss = fmap length $ sss ^? sssSections . ix i . ssItems . ix j . siPictures
|
||||||
|
|
||||||
|
selSecSelPos :: Int -> Int -> SelectionSections a -> Maybe Int
|
||||||
|
selSecSelPos i j sss = do
|
||||||
|
ss <- sss ^? sssSections . ix i
|
||||||
|
return . (secpos +)
|
||||||
|
. subtract (ss ^. ssOffset)
|
||||||
|
. sum
|
||||||
|
. fmap (length . _siPictures)
|
||||||
|
. fst $ IM.split j (ss ^. ssItems)
|
||||||
|
where
|
||||||
|
secpos = sum . fmap (length . _ssShownItems) . fst $ IM.split i $ sss ^. sssSections
|
||||||
|
|
||||||
--getIthPos :: Int -> IM.IntMap (SelectionItem a) -> Int
|
--getIthPos :: Int -> IM.IntMap (SelectionItem a) -> Int
|
||||||
--getIthPos i sm = sum . fmap _siHeight . fst $ IM.split i sm
|
--getIthPos i sm = sum . fmap _siHeight . fst $ IM.split i sm
|
||||||
|
|||||||
Reference in New Issue
Block a user