Add text messages on loading screens
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user