Cleanup
This commit is contained in:
@@ -1,30 +1,30 @@
|
||||
module Dodge.Update.Input.Text (
|
||||
doTextInputOverUniverse,
|
||||
doTextInputOver,
|
||||
doTextInputOver',
|
||||
) where
|
||||
|
||||
import Data.Either
|
||||
--import Data.Char
|
||||
import Data.Char
|
||||
import Dodge.Data.Universe
|
||||
import LensHelp
|
||||
import SDL
|
||||
|
||||
doTextInputOver :: ASetter' Universe String -> Universe -> Universe
|
||||
doTextInputOver p u = doTextInputOver' u p u
|
||||
doTextInputOverUniverse :: ASetter' Universe String -> Universe -> Universe
|
||||
doTextInputOverUniverse p u = doTextInputOver (u ^. uvWorld . input) p u
|
||||
|
||||
doTextInputOver' :: Universe -> ASetter' a String -> a -> a
|
||||
doTextInputOver' u p x =
|
||||
--x & p %~ (++ map toUpper (rights str))
|
||||
x & p %~ (++ rights str)
|
||||
doTextInputOver :: Input -> ASetter' a String -> a -> a
|
||||
doTextInputOver u p x =
|
||||
x & p %~ (++ map toUpper (rights str))
|
||||
--x & p %~ (++ rights str)
|
||||
& checkBackspace
|
||||
where
|
||||
str = u ^. uvWorld . input . textInput
|
||||
str = u ^. textInput
|
||||
checkBackspace
|
||||
| backspaceInputted u = p %~ doBackspace
|
||||
| otherwise = id
|
||||
|
||||
backspaceInputted :: Universe -> Bool
|
||||
backspaceInputted u = case u ^. uvWorld . input . pressedKeys . at ScancodeBackspace of
|
||||
backspaceInputted :: Input -> Bool
|
||||
backspaceInputted u = case u ^. pressedKeys . at ScancodeBackspace of
|
||||
Just InitialPress -> True
|
||||
Just LongPress -> True
|
||||
_ -> False
|
||||
|
||||
Reference in New Issue
Block a user