Cleanup, fix damage code terminal bug

This commit is contained in:
2025-08-20 15:59:22 +01:00
parent 9daa27ee8b
commit 4bf9ce59d5
12 changed files with 153 additions and 177 deletions
+7 -20
View File
@@ -101,26 +101,18 @@ doTmWdWd tmwdwd = case tmwdwd of
TmTmClearDisplayedLines -> \tm -> fromMaybe id $ do
tid <- tm ^? tmID
return $ cWorld . lWorld . terminals . ix tid . tmDisplayedLines .~ []
TmGetDamageCoding st -> \tm w -> fromMaybe w $ do
tid <- tm ^? tmID
return $
w & cWorld . lWorld . terminals . ix tid . tmFutureLines
.~ decodeSensorType st w
-- TmGetDamageCoding st -> \tm w -> fromMaybe w $ do
-- tid <- tm ^? tmID
-- return $
-- w & cWorld . lWorld . terminals . ix tid . tmFutureLines
-- .~ decodeSensorType st w
TmGetSensor s -> \tm w -> fromMaybe w $ do
tid <- tm ^? tmID
return $ w & cWorld . lWorld . terminals . ix tid . tmFutureLines .~ getSensorInfo w tm s
return $ w & cWorld . lWorld . terminals . ix tid . tmFutureLines
.~ getSensorInfo w tm s
TmTmSetStatus x -> \tm -> fromMaybe id $ do
tid <- tm ^? tmID
return $ cWorld . lWorld . terminals . ix tid . tmStatus .~ x
-- TmDisplayCommands -> \tm -> fromMaybe id $ do
-- tid <- tm ^? tmID
-- return $ cWorld . lWorld . terminals . ix tid %~ tabComplete ""
--return $ cWorld . lWorld . terminals . ix tid . tmFutureLines .~
-- makeColorTermPara commandColor
-- (unwords (map fst (PTE.toList $ getCommands tm)))
-- TmTmSetPartialCommand x -> \tm -> fromMaybe id $ do
-- tid <- tm ^? tmID
-- return $ cWorld . lWorld . terminals . ix tid . tmPartialCommand .~ x
TmWdId -> const id
TmWdWdPowerDownTerminal -> powerDownTerminal
TmWdWdDeactivateTerminal -> deactivateTerminal
@@ -149,11 +141,6 @@ exitTerminalSubInv w = case w ^? hud . hudElement . subInventory . termID of
.~ NoSubInventory --MouseInvNothing
_ -> w
decodeSensorType :: SensorType -> World -> [TerminalLine]
decodeSensorType st w = fromMaybe [] $ do
x <- w ^? cWorld . cwGen . cwgParams . sensorCoding . ix st
return [makeTermLine $ show x]
-- ugly, when changing check sensorCommand
getSensorInfo :: World -> Terminal -> String -> [TerminalLine]
getSensorInfo w tm = \case