Refactor terminal prompt/maxlines into terminaltype

This commit is contained in:
2024-11-06 11:16:35 +00:00
parent 6168bf282e
commit bfd4649e1b
7 changed files with 39 additions and 27 deletions
+3 -2
View File
@@ -6,6 +6,7 @@ module Dodge.Render.HUD (
selNumPosCardinal, -- this shoud probably be pushed back here
) where
import Dodge.Terminal.Type
import Dodge.CharacterEnums
import Dodge.Creature.Test
import Dodge.DoubleTree
@@ -354,14 +355,14 @@ displayTerminal tid cfig w = fromMaybe mempty $ do
thelist tm =
map toselitm . displayTermInput tm
. reverse
. take (_tmMaxLines tm)
. take (getMaxLinesTM (tm ^. tmType))
$ _tmDisplayedLines tm
displayTermInput tm = case _tmInput tm of
TerminalInput{_tiText = s, _tiFocus = hasfoc} ->
(++ [(displayInputText tm s ++ displayBlinkCursor hasfoc, white)])
partcommand tm = maybe "" (++ " ") $ tm ^? tmPartialCommand . _Just . tcString
displayInputText tm s
| _tmStatus tm == TerminalReady = partcommand tm ++ _tmPromptString tm ++ s
| _tmStatus tm == TerminalReady = partcommand tm ++ getPromptTM (tm ^. tmType) ++ s
| otherwise = ""
displayBlinkCursor hasfoc
-- | hasfoc = clockCycle 10 (V.fromList [[cFilledRect] , "."]) w