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
+2 -2
View File
@@ -18,6 +18,7 @@ module Dodge.Terminal (
terminalReturnEffect,
) where
import Dodge.Terminal.Type
import Control.Monad
import Color
import Data.Char
@@ -37,7 +38,6 @@ basicTerminal =
defaultTerminal
{ _tmDisplayedLines = []
, _tmFutureLines = []
, _tmMaxLines = 14
, _tmTitle = "TERMINAL"
, _tmScrollCommands = [quitCommand]
, _tmWriteCommands = [helpCommand, commandsCommand]
@@ -283,7 +283,7 @@ terminalReturnEffect tm w = fromMaybe w $ do
w
& cWorld . lWorld . terminals . ix (_tmID tm) . tmPartialCommand .~ Nothing
& cWorld . lWorld . terminals . ix (_tmID tm) . tmFutureLines
.~ [makeTermLine (pc ++ _tmPromptString tm ++ s)]
.~ [makeTermLine (pc ++ getPromptTM (tm ^. tmType) ++ s)]
runTerminalString :: String -> Terminal -> World -> World
runTerminalString s tm w =