Slightly rethink display of inventories and terminals
This commit is contained in:
@@ -94,7 +94,7 @@ doTmWdWd tmwdwd = case tmwdwd of
|
||||
TmWdId -> const id
|
||||
TmWdWdPowerDownTerminal -> resetTerminal TerminalOff
|
||||
TmWdWdDeactivateTerminal -> resetTerminal TerminalDeactivated
|
||||
TmWdWdLeaveTerminal -> leaveResetQuitTerminal
|
||||
TmWdWdLeaveTerminal s -> leaveResetQuitTerminal s
|
||||
TmWdWdTermSound sid -> \tm w -> fromMaybe w $ do
|
||||
tpos <- w ^? cWorld . lWorld . buttons . ix (_tmButtonID tm) . btPos
|
||||
return $ soundStart TerminalSound tpos sid Nothing w
|
||||
@@ -107,10 +107,10 @@ resetTerminal x tm =
|
||||
. (cWorld . lWorld . terminals . ix (_tmID tm) . tmDisplayedLines .~ [])
|
||||
. exitTerminalSubInv
|
||||
|
||||
leaveResetQuitTerminal :: Terminal -> World -> World
|
||||
leaveResetQuitTerminal tm =
|
||||
leaveResetQuitTerminal :: String -> Terminal -> World -> World
|
||||
leaveResetQuitTerminal s tm =
|
||||
(cWorld . lWorld . terminals . ix (_tmID tm) . tmFutureLines
|
||||
.~ (tlSetStatus (TerminalPressTo "QUIT")) <> tlDoEffect TmWdWdLeaveTerminal)
|
||||
.~ (tlSetStatus (TerminalPressTo s)) <> tlDoEffect (TmWdWdLeaveTerminal s))
|
||||
. exitTerminalSubInv
|
||||
|
||||
exitTerminalSubInv :: World -> World
|
||||
|
||||
Reference in New Issue
Block a user