Refactor text input
This commit is contained in:
+7
-2
@@ -63,7 +63,10 @@ import Sound.Data
|
||||
import StrictHelp
|
||||
|
||||
updateUniverse :: Universe -> Universe
|
||||
updateUniverse u = updateUniverseLast . updateUniverseMid
|
||||
updateUniverse u =
|
||||
updateUniverseLast
|
||||
. over (uvWorld . input . textInput) (const mempty)
|
||||
. updateUniverseMid
|
||||
. updateUseInput
|
||||
. over uvWorld (updateCamera cfig)
|
||||
. over (uvWorld . cWorld . cClock) ( + 1)
|
||||
@@ -72,7 +75,9 @@ updateUniverse u = updateUniverseLast . updateUniverseMid
|
||||
cfig = u ^. uvConfig
|
||||
|
||||
updateUseInput :: Universe -> Universe
|
||||
updateUseInput u = M.foldlWithKey' updateKeyInGame u (u ^. uvWorld . input . pressedKeys)
|
||||
updateUseInput u = case u ^? uvScreenLayers . _head of
|
||||
Just InputScreen{} -> doInputScreenInput u
|
||||
_ -> M.foldlWithKey' updateKeyInGame u (u ^. uvWorld . input . pressedKeys)
|
||||
|
||||
|
||||
updateUniverseLast :: Universe -> Universe
|
||||
|
||||
Reference in New Issue
Block a user