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