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
+13 -3
View File
@@ -1,3 +1,4 @@
{-# LANGUAGE LambdaCase #-}
module Dodge.Update.Input.ScreenLayer (
updateUseInputOnScreen,
ldpSelection,
@@ -21,9 +22,18 @@ import Linear
import SDL
updateUseInputOnScreen :: ScreenLayer -> Universe -> Universe
updateUseInputOnScreen sl = case sl of
InputScreen{} -> doInputScreenInput (sl ^. scInput)
_ -> optionScreenUpdate
updateUseInputOnScreen = \case
InputScreen{_scInput = s} -> doInputScreenInput s
OptionScreen{} -> optionScreenUpdate
LoadingScreen{} -> loadingScreenUpdate
loadingScreenUpdate :: Universe -> Universe
loadingScreenUpdate u
| isJust $ u ^. uvWorld . input . pressedKeys . at ScancodeSpace
= case u ^? uvScreenLayers . ix 0 . scBlockStatus of
Just LoadReady -> u & uvScreenLayers .~ []
_ -> u & uvScreenLayers . ix 0 . scBlockStatus .~ LoadWaitingClicked
| otherwise = u
doInputScreenInput :: String -> Universe -> Universe
doInputScreenInput s u =