Work towards making world read/showable

This commit is contained in:
2022-07-22 11:16:12 +01:00
parent 6b69fc1684
commit 7fdb70dd1c
22 changed files with 223 additions and 218 deletions
+12 -6
View File
@@ -32,18 +32,24 @@ import qualified Data.Text as T
--import Data.List
--import Data.Bifunctor
hudDrawings :: Configuration -> World -> Picture
hudDrawings cfig w = case _hudElement $ _hud w of
hudDrawings :: Universe -> Picture
hudDrawings uv = case _hudElement $ _hud w of
DisplayCarte -> drawCarte cfig w
DisplayInventory subinv -> drawInGameHUD cfig w
DisplayInventory subinv -> drawInGameHUD uv
<> subInventoryDisplay subinv cfig w
where
w = _uvWorld uv
cfig = _uvConfig uv
drawInGameHUD :: Configuration -> World -> Picture
drawInGameHUD cfig w = pictures
drawInGameHUD :: Universe -> Picture
drawInGameHUD uv = pictures
[ winScale cfig . dShadCol white $ displayHP 0 cfig w
, listPicturesAt (halfWidth cfig) 0 cfig $ map text (_testString w cfig w)
, listPicturesAt (halfWidth cfig) 0 cfig $ map text (_uvTestString uv uv)
, inventoryDisplay cfig w
]
where
w = _uvWorld uv
cfig = _uvConfig uv
inventoryDisplay :: Configuration -> World -> Picture
inventoryDisplay cfig w = listPicturesAt 0 0 cfig invlist