Allow for concurrent effects

This commit is contained in:
2022-08-16 16:02:09 +01:00
parent 919a179283
commit 26e88f059a
14 changed files with 181 additions and 53 deletions
+15 -7
View File
@@ -2,6 +2,8 @@ module Dodge.Render.Picture (
fixedCoordPictures,
) where
import Dodge.Base.Window
import Dodge.Render.List
import Dodge.Base.WinScale
import Dodge.Data.Universe
import Dodge.Render.HUD
@@ -10,17 +12,23 @@ import Geometry
import Picture
fixedCoordPictures :: Universe -> Picture
fixedCoordPictures u = case _menuLayers u of
[] ->
pictures
[ hudDrawings u
, customMouseCursor cfig w
]
(lay : _) -> setDepth (-1) . winScale cfig $ menuScreen u lay
fixedCoordPictures u =
drawConcurrentMessage u <> case _menuLayers u of
[] ->
pictures
[ hudDrawings u
, customMouseCursor cfig w
]
(lay : _) -> setDepth (-1) . winScale cfig $ menuScreen u lay
where
w = _uvWorld u
cfig = _uvConfig u
drawConcurrentMessage :: Universe -> Picture
drawConcurrentMessage uv = listPicturesAt (halfWidth cfig) (_windowY cfig - 50) cfig [text (_uvConcMessage uv)]
where
cfig = _uvConfig uv
customMouseCursor :: Configuration -> World -> Picture
customMouseCursor cfig w =
winScale cfig