Add text messages on loading screens

This commit is contained in:
2025-12-05 10:29:16 +00:00
parent 14d50c4242
commit 0a34db312f
20 changed files with 409 additions and 318 deletions
+12
View File
@@ -1,6 +1,9 @@
{-# LANGUAGE LambdaCase #-}
module Dodge.Render.MenuScreen (drawMenuScreen) where
import Geometry.Polygon
import Linear
import Dodge.Data.ScreenPos
import Control.Lens
import Dodge.Base.Window
import Dodge.Data.CardinalPoint
@@ -15,6 +18,15 @@ drawMenuScreen :: Maybe Int -> ScreenLayer -> Config -> Picture
drawMenuScreen mi = \case
OptionScreen{_scTitle = s, _scSelectionList = l} -> drawOptions s mi l
InputScreen inputstr -> drawInputMenu ('>' : inputstr)
LoadingScreen ss t -> drawLoadingScreen ss t
drawLoadingScreen :: [String] -> BlockStatus -> Config -> Picture
drawLoadingScreen s _ cfig =
polygon (rectWH (fromIntegral (cfig ^.windowX)) (fromIntegral (cfig ^. windowY))) <>
translateScreenPos cfig
(ScreenPos (V2 0 0.2) (V2 (-300) (10 * fromIntegral (length s))))
(drawList $ map text s -- <> [text $ show t])
)
drawInputMenu :: String -> Config -> Picture
drawInputMenu s cf = darkenBackground cf <> drawTitle cf s