Move towards displaying tree links in inventory

This commit is contained in:
2024-09-13 12:02:28 +01:00
parent c81fd5490d
commit bd681a577c
8 changed files with 85 additions and 45 deletions
+10 -1
View File
@@ -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