Continue work on terminals
This commit is contained in:
@@ -42,7 +42,7 @@ import LensHelp
|
||||
import qualified Data.Map.Strict as M
|
||||
--import qualified Data.Set as S
|
||||
import Data.Maybe
|
||||
import qualified Data.Text as T
|
||||
--import qualified Data.Text as T
|
||||
--import SDL
|
||||
--import Data.List
|
||||
--import System.Random
|
||||
|
||||
@@ -84,12 +84,12 @@ subInventoryDisplay subinv cfig w = case subinv of
|
||||
, invHead cfig "TWEAK"
|
||||
, listTextPicturesAt subInvX 60 cfig $ map text (ammoTweakStrings it)
|
||||
]
|
||||
DisplayTerminal {_termID = tid,_onInputLine=isoninput} ->
|
||||
DisplayTerminal {_termID = tid,_onInputLine=inputstatus} ->
|
||||
let tp = w ^?! terminals . ix tid
|
||||
in pictures
|
||||
[ invHead cfig (_tmTitle tp ++ ":T" ++ show tid)
|
||||
, renderListAt subInvX 60 cfig
|
||||
. displayTermInput tp
|
||||
. displayTermInput inputstatus tp
|
||||
-- . (++ map (\(str,_) -> (str,white)) (_termOptions tp))
|
||||
. reverse
|
||||
. take (_tmMaxLines tp)
|
||||
@@ -124,9 +124,11 @@ subInventoryDisplay subinv cfig w = case subinv of
|
||||
]
|
||||
InspectInventory -> invHead cfig "INSPECT"
|
||||
where
|
||||
displayTermInput tp = case _tmInput tp of
|
||||
displayTermInput inputstatus tp = case _tmInput tp of
|
||||
Nothing -> id
|
||||
Just s -> (++ [('>':T.unpack s++clockCycle 10 (V.fromList ["_",""]) w,white)])
|
||||
Just s -> (++ [('>':T.unpack s++displayBlinkCursor inputstatus,white)])
|
||||
displayBlinkCursor inputstatus | inputstatus = clockCycle 10 (V.fromList ["_",""]) w
|
||||
| otherwise = []
|
||||
closeobjectcursor = case selectedCloseObject w of
|
||||
Nothing -> mempty
|
||||
Just (i,co) -> listCursorNS clObjFloatIn 0 cfig (selNumPos i w) (closeObjectCol co) topInvW (invSelSize i w)
|
||||
|
||||
+7
-5
@@ -110,11 +110,13 @@ tmUpdate tm w = case w ^? terminals . ix (_tmID tm) . tmFutureLines . ix 0 of
|
||||
Just (TerminalLineEffect _ eff) -> w
|
||||
& pointTermParams . tmFutureLines %~ tail
|
||||
& eff tm
|
||||
Just (TerminalLineInput _) -> w & pointTermParams %~
|
||||
( ( tmFutureLines %~ tail )
|
||||
-- . ( tmScrollCommands .~ scrollc )
|
||||
-- . ( tmWriteCommands .~ writec )
|
||||
. ( tmInput ?~ T.empty ) )
|
||||
Just (TerminalLineInput _) -> w
|
||||
& hud . hudElement . subInventory . onInputLine %~ const True
|
||||
& pointTermParams %~
|
||||
( ( tmFutureLines %~ tail )
|
||||
-- . ( tmScrollCommands .~ scrollc )
|
||||
-- . ( tmWriteCommands .~ writec )
|
||||
. ( tmInput ?~ T.empty ) )
|
||||
where
|
||||
pointTermParams = terminals . ix (_tmID tm)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user