Improve tab completion, cleanup
This commit is contained in:
@@ -86,28 +86,21 @@ doDeathToggle (TerminalToggle trid f) = ix trid %~ doBlBl f
|
||||
|
||||
doTmWdWd :: TmWdWd -> Terminal -> World -> World
|
||||
doTmWdWd tmwdwd = case tmwdwd of
|
||||
TmTmClearDisplayedLines -> \tm -> fromMaybe id $ do
|
||||
tid <- tm ^? tmID
|
||||
return $ cWorld . lWorld . terminals . ix tid . tmDisplayedLines .~ []
|
||||
TmTmClearDisplayedLines -> \tm ->
|
||||
cWorld . lWorld . terminals . ix (tm ^. tmID) . tmDisplayedLines .~ []
|
||||
TmTmSetStatus x -> \tm -> cWorld . lWorld . terminals . ix (tm ^. tmID) . tmStatus .~ x
|
||||
TmWdId -> const id
|
||||
TmWdWdPowerDownTerminal -> powerDownTerminal
|
||||
TmWdWdDeactivateTerminal -> deactivateTerminal
|
||||
TmWdWdPowerDownTerminal -> resetTerminal TerminalOff
|
||||
TmWdWdDeactivateTerminal -> resetTerminal TerminalDeactivated
|
||||
TmWdWdTermSound sid -> \tm w ->
|
||||
let tpos = fromMaybe 0 $ w ^? cWorld . lWorld . buttons . ix (_tmButtonID tm) . btPos
|
||||
in soundStart TerminalSound tpos sid Nothing w
|
||||
TmWdWdDoDeathTriggers -> doDeathTriggers
|
||||
TmWdWdfromWdWd f -> \_ -> doWdWd f
|
||||
|
||||
powerDownTerminal :: Terminal -> World -> World
|
||||
powerDownTerminal tm =
|
||||
(cWorld . lWorld . terminals . ix (_tmID tm) . tmStatus .~ TerminalOff)
|
||||
. (cWorld . lWorld . terminals . ix (_tmID tm) . tmDisplayedLines .~ [])
|
||||
. exitTerminalSubInv
|
||||
|
||||
deactivateTerminal :: Terminal -> World -> World
|
||||
deactivateTerminal tm =
|
||||
(cWorld . lWorld . terminals . ix (_tmID tm) . tmStatus .~ TerminalDeactivated)
|
||||
resetTerminal :: TerminalStatus -> Terminal -> World -> World
|
||||
resetTerminal x tm =
|
||||
(cWorld . lWorld . terminals . ix (_tmID tm) . tmStatus .~ x)
|
||||
. (cWorld . lWorld . terminals . ix (_tmID tm) . tmDisplayedLines .~ [])
|
||||
. exitTerminalSubInv
|
||||
|
||||
|
||||
Reference in New Issue
Block a user