Start to generalise text input to "terminal signal" input
This commit is contained in:
@@ -8,6 +8,7 @@ import qualified Data.Map.Strict as M
|
||||
import Data.Maybe
|
||||
import Dodge.Base.You
|
||||
import Dodge.Button.Event
|
||||
import Dodge.Camera
|
||||
import Dodge.Creature.Action
|
||||
import Dodge.Data.Combine
|
||||
import Dodge.Data.Universe
|
||||
@@ -46,9 +47,6 @@ updateUseInputInGame h u = case h of
|
||||
(uvWorld . worldEventFlags . at InventoryChange ?~ ()) . maybeExitCombine $
|
||||
over uvWorld (tryCombine sss) u
|
||||
& uvWorld . worldEventFlags . at CombineInventoryChange ?~ ()
|
||||
-- _ -> case regexFocus w of
|
||||
-- Nothing -> M.foldlWithKey' updateKeyInGame u pkeys
|
||||
-- Just (filtpoint,selpoint,i) -> u & uvWorld . p %~ doRegexInput
|
||||
_
|
||||
| inInvRegex (u ^. uvWorld) ->
|
||||
u & uvWorld . hud . hudElement . diSections %~ doRegexInput u (-1)
|
||||
@@ -108,6 +106,8 @@ updateKeyInGame uv sc pt = case pt of
|
||||
|
||||
updateInitialPressInGame :: Universe -> Scancode -> Universe
|
||||
updateInitialPressInGame uv sc = case sc of
|
||||
ScancodeF2 -> pauseAndFloatCam uv
|
||||
ScancodeF3 -> pauseAndPanCam uv
|
||||
ScancodeF5 -> doQuicksave uv
|
||||
ScancodeF9 -> doQuickload uv
|
||||
ScancodeEscape -> pauseGame uv
|
||||
|
||||
@@ -3,6 +3,7 @@ module Dodge.Update.Input.Text (
|
||||
doTextInputOver',
|
||||
) where
|
||||
|
||||
import Data.Either
|
||||
import Data.Char
|
||||
import Dodge.Data.Universe
|
||||
import LensHelp
|
||||
@@ -13,7 +14,7 @@ doTextInputOver p u = doTextInputOver' u p u
|
||||
|
||||
doTextInputOver' :: Universe -> ASetter' a String -> a -> a
|
||||
doTextInputOver' u p x =
|
||||
x & p %~ (++ map toUpper str)
|
||||
x & p %~ (++ map toUpper (rights str))
|
||||
& checkBackspace
|
||||
where
|
||||
str = u ^. uvWorld . input . textInput
|
||||
|
||||
Reference in New Issue
Block a user