Work on terminals: allow scrolling to get default inputs
This commit is contained in:
+10
-10
@@ -1,5 +1,6 @@
|
||||
{-# LANGUAGE TupleSections #-}
|
||||
--{-# LANGUAGE TupleSections #-}
|
||||
module Dodge.Room.Warning where
|
||||
import Dodge.Terminal
|
||||
import Dodge.LevelGen.Data
|
||||
import Dodge.PlacementSpot
|
||||
import Dodge.Placement.Instance.Terminal
|
||||
@@ -34,6 +35,7 @@ import Data.Maybe
|
||||
--import Data.Tree
|
||||
import Control.Monad.State
|
||||
import System.Random
|
||||
--import qualified Data.Text as T
|
||||
|
||||
|
||||
warningRooms :: RandomGen g => Int -> State g (LabSubCompTree Room)
|
||||
@@ -51,7 +53,7 @@ addWarningTerminal outplid = (rmName .++~ "warningTerm-")
|
||||
where
|
||||
outplace = extTrigLitPos
|
||||
(atFstLnkOutShiftBy (\(p,a) -> (p +.+ rotateV a (V2 18.5 (-2.5)), a)))
|
||||
(\trid -> Just $ set plSpot (rprShift fps) $ putTerminal $ termMessages trid)
|
||||
(Just . set plSpot (rprShift fps) . putTerminal . termMessages)
|
||||
--termspot = atFstLnkOutShiftBy (\(p,a) -> (p +.+ rotateV a (V2 18.5 (-2.5)), a))
|
||||
fps rp rm = case rp ^? rpLinkStatus . rplsChildNum of
|
||||
Just 0 ->
|
||||
@@ -66,15 +68,13 @@ addWarningTerminal outplid = (rmName .++~ "warningTerm-")
|
||||
then Just (rtpos, rpdir)
|
||||
else Just (ltpos, rpdir)
|
||||
_ -> Nothing
|
||||
termMessages trid = ops trid (genTermMessage $ const ["AVAILABLE COMMANDS:"
|
||||
, " QUIT TOGGLE"
|
||||
, replicate 50 'M'
|
||||
])
|
||||
termMessages trid = ops trid (genTermMessage $ const ["OPEN DOOR?"])
|
||||
-- <&> termFutureLines %~ (++ [TerminalLineChoice 0 (ops trid)])
|
||||
ops _ f gw w = f gw w & termFutureLines %~
|
||||
(++ [ TerminalLineInput 0 (const id) ])
|
||||
ops trid f gw w = f gw w & termFutureLines %~
|
||||
(++ [ TerminalLineInput 0 [quitCommand,helpCommand,infoCommand theinfo,commandsCommand,unlockCommand trid]])
|
||||
unlockCommand trid = singleCommand "OPEN" ["YES","Y"] "OPEN THE CONNECTED DOOR." (toggledoor trid)
|
||||
-- (++ [ TerminalLineChoice 0 [ ("TOGGLE", toggledoor trid)
|
||||
-- , ("EXIT", id)
|
||||
-- ]])
|
||||
--toggledoor trid w' = w' & triggers . ix (fromJust $ _plMID trid) .~ const True
|
||||
|
||||
toggledoor trid w' = w' & triggers . ix (fromJust $ _plMID trid) .~ const True
|
||||
theinfo = "DOOR CONTROLABLE BY ENTERING \"OPEN\". THIS TERMINAL CANNOT CLOSE THE DOOR."
|
||||
|
||||
Reference in New Issue
Block a user