Move towards simplifying terminal lines/effects
This commit is contained in:
@@ -17,6 +17,8 @@ module Dodge.Terminal (
|
||||
terminalReturnEffect,
|
||||
) where
|
||||
|
||||
import Dodge.Data.WorldEffect
|
||||
import Dodge.Data.Terminal.Status
|
||||
import Color
|
||||
--import Control.Monad
|
||||
import Data.Char
|
||||
@@ -51,7 +53,7 @@ connectionBlurbLines tls =
|
||||
]
|
||||
++ tls
|
||||
++ [ TerminalLineDisplay 10 (TerminalLineConst "READY FOR INPUT" termTextColor)]
|
||||
++ [TerminalLineTerminalEffect 0 (TmTmSetStatus (TerminalTextInput ""))]
|
||||
++ [TerminalLineEffect 0 (TmTmSetStatus (TerminalTextInput ""))]
|
||||
|
||||
quitCommand :: TerminalCommand
|
||||
quitCommand =
|
||||
@@ -212,7 +214,7 @@ disconnectTerminal tm =
|
||||
(cWorld . lWorld . terminals . ix (_tmID tm) . tmStatus .~ TerminalOff)
|
||||
. exitTerminalSubInv
|
||||
. ( cWorld . lWorld . terminals . ix (_tmID tm) . tmFutureLines
|
||||
.~ [TerminalLineTerminalEffect 0 TmTmClearDisplayedLines]
|
||||
.~ [TerminalLineEffect 0 TmTmClearDisplayedLines]
|
||||
)
|
||||
|
||||
exitTerminalSubInv :: World -> World
|
||||
@@ -255,10 +257,10 @@ commandFutureLines s tm w = fromMaybe [errline "^ Invalid command"] $ do
|
||||
OneArgument argtype m ->
|
||||
let setpartial
|
||||
| null (_tmPartialCommand tm) =
|
||||
TerminalLineTerminalEffect 0 (TmTmSetPartialCommand (Just command)) :
|
||||
TerminalLineEffect 0 (TmTmSetPartialCommand (Just command)) :
|
||||
makeTermPara ("Expects " ++ argtype ++ " as an argument")
|
||||
| otherwise =
|
||||
TerminalLineTerminalEffect 0 (TmTmSetPartialCommand Nothing) :
|
||||
TerminalLineEffect 0 (TmTmSetPartialCommand Nothing) :
|
||||
makeTermPara "No argument input, cancelling"
|
||||
in Just $
|
||||
fromMaybe setpartial $
|
||||
|
||||
Reference in New Issue
Block a user