Limit terminal input to 42 characters
This commit is contained in:
@@ -4,7 +4,6 @@ module Dodge.Render.List (
|
||||
renderListAt,
|
||||
drawList,
|
||||
drawSelectionList,
|
||||
drawSelectionListBackground,
|
||||
drawListYgapScaleYoff,
|
||||
drawListElement,
|
||||
dShadCol,
|
||||
@@ -55,20 +54,6 @@ drawTitleBackground cfig =
|
||||
. reverse
|
||||
$ rectNSWE 70 0 0 560
|
||||
|
||||
drawSelectionListBackground ::
|
||||
LDParams ->
|
||||
Config ->
|
||||
Int -> -- list length
|
||||
Picture
|
||||
drawSelectionListBackground ldp cfig l =
|
||||
translateScreenPos cfig (ldp ^. ldpPos)
|
||||
. polygon
|
||||
. reverse
|
||||
$ rectNSWE 5 s (-5) e
|
||||
where
|
||||
s = -(5 + fromIntegral l * (20 * ldp ^. ldpScale + ldp ^. ldpVerticalGap))
|
||||
e = 555 -- HACK isOverTerminalScreen
|
||||
|
||||
makeSelectionListPictures :: [SelectionItem a] -> [Picture]
|
||||
makeSelectionListPictures = concatMap f
|
||||
where
|
||||
|
||||
@@ -37,8 +37,8 @@ textTerminal = defaultTerminal{_tmBootLines = textInputBlurb []}
|
||||
textInputBlurb :: [TerminalLine] -> [TerminalLine]
|
||||
textInputBlurb tls =
|
||||
[termSoundLine computerBeepingS]
|
||||
++ tls
|
||||
++ tlSetStatus (TerminalTextInput "")
|
||||
<> tls
|
||||
<> tlSetStatus (TerminalTextInput "")
|
||||
|
||||
termSoundLine :: SoundID -> TerminalLine
|
||||
termSoundLine = TLine 0 [] . TmWdWdTermSound
|
||||
|
||||
@@ -409,6 +409,7 @@ updateKeysTextInputTerminal tmid u =
|
||||
(uvWorld . cWorld . lWorld . terminals . ix tmid . tmStatus . tiText)
|
||||
& checkEndStatus
|
||||
& tryTabComplete
|
||||
& uvWorld . cWorld . lWorld . terminals . ix tmid . tmStatus . tiText %~ take 42
|
||||
where
|
||||
checkEndStatus
|
||||
| u ^. uvWorld . input . pressedKeys . at ScancodeReturn == Just 0 =
|
||||
|
||||
Reference in New Issue
Block a user