Partial inventory display update
This commit is contained in:
+21
-12
@@ -1,6 +1,7 @@
|
||||
--{-# LANGUAGE TupleSections #-}
|
||||
module Dodge.Render.HUD (
|
||||
drawHUD,
|
||||
invDisplayParams,
|
||||
) where
|
||||
|
||||
import SelectionIntMap
|
||||
@@ -39,17 +40,12 @@ drawHUD :: Configuration -> World -> Picture
|
||||
drawHUD cfig w = case w ^. hud . hudElement of
|
||||
DisplayCarte -> drawCarte cfig w
|
||||
DisplayInventory {_diSections = sections, _subInventory = subinv} ->
|
||||
drawInGameHUD sl cfig w
|
||||
drawHP cfig w
|
||||
<> inventoryDisplay sections w cfig
|
||||
<> drawSubInventory subinv cfig w
|
||||
where
|
||||
sl = makeInventorySelectionList w
|
||||
|
||||
drawInGameHUD :: SelectionList () -> Configuration -> World -> Picture
|
||||
drawInGameHUD sl cfig w =
|
||||
pictures
|
||||
[ winScale cfig . dShadCol white $ displayHP 0 cfig w
|
||||
, inventoryDisplay w cfig sl
|
||||
]
|
||||
drawHP :: Configuration -> World -> Picture
|
||||
drawHP cfig w = winScale cfig . dShadCol white $ displayHP 0 cfig w
|
||||
|
||||
defaultListDisplayParams :: ListDisplayParams
|
||||
defaultListDisplayParams =
|
||||
@@ -76,9 +72,22 @@ invDisplayParams w =
|
||||
Just ExamineInventory{} -> True
|
||||
_ -> False
|
||||
|
||||
inventoryDisplay :: World -> Configuration -> SelectionList () -> Picture
|
||||
inventoryDisplay = drawSelectionList . invDisplayParams
|
||||
|
||||
inventoryDisplay :: SelectionSections () -> World -> Configuration -> Picture
|
||||
inventoryDisplay sss w cfig = listPicturesAtScaleOff
|
||||
(_ldpVerticalGap ldps)
|
||||
(_ldpScale ldps)
|
||||
(_ldpPosX ldps)
|
||||
(_ldpPosY ldps)
|
||||
cfig
|
||||
0 -- offset
|
||||
--undefined
|
||||
pics
|
||||
where
|
||||
ldps = invDisplayParams w
|
||||
-- pics' = take (_sssMaxSize sss) pics
|
||||
-- totallength = length pics'
|
||||
pics = foldMap (_ssShownItems) (_sssSections sss)
|
||||
|
||||
drawSubInventory :: SubInventory -> Configuration -> World -> Picture
|
||||
drawSubInventory subinv cfig w = case subinv of
|
||||
LockedInventory -> mempty -- topInvCursor col cursPos cfig w
|
||||
|
||||
Reference in New Issue
Block a user