Move towards displaying tree links in inventory
This commit is contained in:
@@ -2,9 +2,13 @@ module Dodge.Render.Connectors
|
||||
( zConnect
|
||||
, zConnectCol
|
||||
, lConnect
|
||||
, lConnectMulti
|
||||
) where
|
||||
import FoldableHelp
|
||||
import Picture
|
||||
import Geometry
|
||||
import Control.Lens
|
||||
import Linear.V2
|
||||
|
||||
zConnect :: Point2 -> Point2 -> Picture
|
||||
zConnect (V2 x y) (V2 a b) = line $ map toV2
|
||||
@@ -29,3 +33,10 @@ lConnect sp@(V2 _ y) ep@(V2 x _) = line
|
||||
, V2 x y
|
||||
, ep
|
||||
]
|
||||
|
||||
lConnectMulti :: [Point2] -> Point2 -> Picture
|
||||
lConnectMulti sps (V2 x y) = line [V2 x ymin,V2 x ymax] <>
|
||||
foldMap f sps
|
||||
where
|
||||
(Just ymin,Just ymax) = minAndMax $ y : map (^._y) sps
|
||||
f (V2 x' y') = line [V2 x' y',V2 x y']
|
||||
|
||||
+10
-1
@@ -3,6 +3,7 @@ module Dodge.Render.HUD (
|
||||
drawHUD,
|
||||
) where
|
||||
|
||||
import Dodge.Item.Grammar
|
||||
import Dodge.Inventory.RBList
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
@@ -56,7 +57,12 @@ drawHP cfig =
|
||||
. (^?! cWorld . lWorld . creatures . ix 0 . crHP)
|
||||
|
||||
drawInventory :: SelectionSections () -> World -> Configuration -> Picture
|
||||
drawInventory sss = drawSelectionSections sss . invDisplayParams
|
||||
drawInventory sss w cfig = drawSelectionSections sss (invDisplayParams w) cfig
|
||||
<> iextra
|
||||
where
|
||||
iextra = fromMaybe mempty $ do
|
||||
inv <- w ^? cWorld . lWorld . creatures . ix 0 . crInv
|
||||
return $ inventoryExtra cfig (invAdj inv) (fmap (^._2) $ invIndentIM inv)
|
||||
|
||||
drawSubInventory :: SubInventory -> Configuration -> World -> Picture
|
||||
drawSubInventory subinv cfig w = case subinv of
|
||||
@@ -177,6 +183,9 @@ examineInventoryExtra mtweaki cfig = fromMaybe mempty $ do
|
||||
translate subInvX (-71) $
|
||||
listCursorChooseBorderScale 0 1 [North, South, West] tweaki 0 white 10 1
|
||||
|
||||
inventoryExtra :: Configuration -> IM.IntMap ([Int],[Int]) -> IM.IntMap Int -> Picture
|
||||
inventoryExtra = undefined
|
||||
|
||||
combineInventoryExtra :: SelectionSections CombinableItem -> Configuration -> World -> Picture
|
||||
combineInventoryExtra sss cfig w = fromMaybe mempty $ do
|
||||
(i, j) <- sss ^? sssExtra . sssSelPos . _Just
|
||||
|
||||
Reference in New Issue
Block a user