Allow for terminals to be deactivated

This commit is contained in:
2025-08-19 13:58:57 +01:00
parent b8581a7862
commit 2f9cea1b69
9 changed files with 16 additions and 16 deletions
+4 -5
View File
@@ -51,12 +51,11 @@ doWdWd we = case we of
loc <- invIndents (cr ^. crInv) ^? ix invid . _2
return $ heldEffectMuzzles loc cr w
accessTerminal :: Maybe Int -> World -> World
accessTerminal mtmid w = fromMaybe w $ do
tmid <- mtmid
accessTerminal :: Int -> World -> World
accessTerminal tid w = fromMaybe w $ do -- should possibly check the terminal actually exists
return $
w & hud . hudElement . subInventory .~ DisplayTerminal tmid
& cWorld . lWorld . terminals . ix tmid %~ tryToBoot
w & hud . hudElement . subInventory .~ DisplayTerminal tid
& cWorld . lWorld . terminals . ix tid %~ tryToBoot
where
tryToBoot tm = case _tmStatus tm of
TerminalTextInput{} -> tm