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
+26 -2
View File
@@ -8,9 +8,10 @@ import Dodge.Data.Universe
import Dodge.LevelGen
import Dodge.Save
import Dodge.WorldLoad
import Justify
import LensHelp
import System.Random
import System.Directory
import System.Random
startNewGameInSlot :: Int -> Universe -> Universe
startNewGameInSlot slot u = startSeedGame slot i u
@@ -20,10 +21,28 @@ startNewGameInSlot slot u = startSeedGame slot i u
startSeedGame :: Int -> Int -> Universe -> Universe
startSeedGame _ i u =
blockingLoad
startPara
("GENERATING FROM SEED " ++ show i)
(startSeedGameConc i $ u ^. preloadData)
u
startPara :: [String]
startPara =
[ "Something has gone wrong."
, ""
, ""
, ""
]
<> makeParagraph
55
( "My last memory is the reconstitution scan. "
<> "Though experimental, this techology allows for perfect duplication. "
<> "At least in theory, "
<> "it hasn't been tested on humans. "
<> "I'd only be duplicated if my original body was... non-functional."
)
<> ["", "","", "Hopefully I can take better care of this one."]
startSeedGameConc :: Int -> PreloadData -> IO (Universe -> Maybe Universe)
startSeedGameConc seed pdata = do
w <- generateWorldFromSeed (pdata ^?! renderData) seed
@@ -32,6 +51,11 @@ startSeedGameConc seed pdata = do
return $
Just
. saveWorldInSlot (LevelStartSlot 0)
. (uvScreenLayers .~ [])
. maybeClearLoadingScreen
. (uvWorld .~ w)
. postUniverseLoadSideEffect
maybeClearLoadingScreen :: Universe -> Universe
maybeClearLoadingScreen u = case u ^? uvScreenLayers . ix 0 . scBlockStatus of
Just LoadWaitingClicked -> u & uvScreenLayers .~ []
_ -> u & uvScreenLayers . ix 0 . scBlockStatus .~ LoadReady