Limit terminal input to 42 characters

This commit is contained in:
2025-12-24 17:00:36 +00:00
parent c96c18b9aa
commit 3cdab08184
3 changed files with 3 additions and 17 deletions
-15
View File
@@ -4,7 +4,6 @@ module Dodge.Render.List (
renderListAt, renderListAt,
drawList, drawList,
drawSelectionList, drawSelectionList,
drawSelectionListBackground,
drawListYgapScaleYoff, drawListYgapScaleYoff,
drawListElement, drawListElement,
dShadCol, dShadCol,
@@ -55,20 +54,6 @@ drawTitleBackground cfig =
. reverse . reverse
$ rectNSWE 70 0 0 560 $ 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 :: [SelectionItem a] -> [Picture]
makeSelectionListPictures = concatMap f makeSelectionListPictures = concatMap f
where where
+2 -2
View File
@@ -37,8 +37,8 @@ textTerminal = defaultTerminal{_tmBootLines = textInputBlurb []}
textInputBlurb :: [TerminalLine] -> [TerminalLine] textInputBlurb :: [TerminalLine] -> [TerminalLine]
textInputBlurb tls = textInputBlurb tls =
[termSoundLine computerBeepingS] [termSoundLine computerBeepingS]
++ tls <> tls
++ tlSetStatus (TerminalTextInput "") <> tlSetStatus (TerminalTextInput "")
termSoundLine :: SoundID -> TerminalLine termSoundLine :: SoundID -> TerminalLine
termSoundLine = TLine 0 [] . TmWdWdTermSound termSoundLine = TLine 0 [] . TmWdWdTermSound
+1
View File
@@ -409,6 +409,7 @@ updateKeysTextInputTerminal tmid u =
(uvWorld . cWorld . lWorld . terminals . ix tmid . tmStatus . tiText) (uvWorld . cWorld . lWorld . terminals . ix tmid . tmStatus . tiText)
& checkEndStatus & checkEndStatus
& tryTabComplete & tryTabComplete
& uvWorld . cWorld . lWorld . terminals . ix tmid . tmStatus . tiText %~ take 42
where where
checkEndStatus checkEndStatus
| u ^. uvWorld . input . pressedKeys . at ScancodeReturn == Just 0 = | u ^. uvWorld . input . pressedKeys . at ScancodeReturn == Just 0 =