Slightly rethink display of inventories and terminals

This commit is contained in:
2025-09-18 19:56:12 +01:00
parent e017a92892
commit 2d856ddf9e
13 changed files with 156 additions and 139 deletions
+4 -4
View File
@@ -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