Commit before removing "un-input-able" terminals

This commit is contained in:
2022-06-06 18:33:44 +01:00
parent 4e181b8273
commit b20502bc35
6 changed files with 77 additions and 56 deletions
+20 -21
View File
@@ -84,20 +84,7 @@ subInventoryDisplay subinv cfig w = case subinv of
, invHead cfig "TWEAK"
, listTextPicturesAt subInvX 60 cfig $ map text (ammoTweakStrings it)
]
DisplayTerminal {_termID = tid} ->
let tp = w ^?! terminals . ix tid
in pictures
[ invHead cfig (_tmTitle tp ++ ":T" ++ show tid)
, renderListAt subInvX 60 cfig
. displayTermInput tp
-- . (++ map (\(str,_) -> (str,white)) (_termOptions tp))
. reverse
. take (_tmMaxLines tp)
$ _tmDisplayedLines tp
-- , fromMaybe mempty $ do
-- cursori <- _termSel tp <&> (+ _termMaxLines tp)
-- return $ listCursorNSW subInvX 60 cfig cursori white 15 1
]
DisplayTerminal tid -> displayTerminal tid cfig w
CombineInventory mi -> pictures
[ invHead cfig "COMBINE"
, listTextPicturesAt subInvX 60 cfig $ combineListStringPictures w
@@ -111,7 +98,6 @@ subInventoryDisplay subinv cfig w = case subinv of
cpos <- combinePoss w !? i
csize <- combineSizes w !? i
col <- (combineItemListYou w !? i) <&> _itInvColor . snd
--return $ listCursorNSW subInvX 60 cfig cpos col 15 csize
return $ listCursorNSW subInvX 60 cfig cpos col 15 csize
, fromMaybe mempty $ do
i <- mi
@@ -124,12 +110,6 @@ subInventoryDisplay subinv cfig w = case subinv of
]
InspectInventory -> invHead cfig "INSPECT"
where
displayTermInput tp = case _tmInput tp of
Nothing -> id
Just (TerminalInput s inputstatus _)
-> (++ [('>':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)
@@ -152,6 +132,25 @@ subInventoryDisplay subinv cfig w = case subinv of
then drawRBOptions cfig w (_rbOptions w)
else mempty
displayTerminal :: Int -> Configuration -> World -> Picture
displayTerminal tid cfig w = fromMaybe mempty $ do
tm <- w ^? terminals . ix tid
return $ pictures
[ invHead cfig (_tmTitle tm ++ ":T" ++ show tid)
, renderListAt subInvX 60 cfig
. displayTermInput tm
. reverse
. take (_tmMaxLines tm)
$ _tmDisplayedLines tm
]
where
displayTermInput tp = case _tmInput tp of
Nothing -> id
Just (TerminalInput s inputstatus _)
-> (++ [('>':T.unpack s++displayBlinkCursor inputstatus,white)])
displayBlinkCursor inputstatus | inputstatus = clockCycle 10 (V.fromList ["_",""]) w
| otherwise = []
drawRBOptions :: Configuration -> World -> RightButtonOptions -> Picture
drawRBOptions cfig w EquipOptions{_opEquip = es,_opSel=i, _opAllocateEquipment=ae} =
listTextPicturesAtOffset 342 0 cfig (curpos-i) (map (text . eqPosText) es)