Move towards implementing terminal autocomplete

This commit is contained in:
2025-08-16 23:13:24 +01:00
parent f7759b1f31
commit 76b6cda19b
14 changed files with 351 additions and 261 deletions
+8 -5
View File
@@ -5,6 +5,7 @@ module Dodge.WorldEffect (
lineOutputTerminal,
) where
import qualified Data.ListTrie.Patricia.Map.Enum as PTE
--import Dodge.DoubleTree
import Dodge.Data.Terminal.Status
import Dodge.Item.Grammar
@@ -78,9 +79,6 @@ lineOutputTerminal tls =
defaultTerminal
{ _tmDisplayedLines = []
, _tmFutureLines = []
-- , _tmTitle = "TERMINAL"
, _tmCommands = [helpCommand,commandsCommand,quitCommand]
-- , _tmWriteCommands = [helpCommand, commandsCommand]
, _tmBootLines = connectionBlurbLines tls
, _tmDeathEffect = TmWdWdDoDeathTriggers
}
@@ -101,9 +99,14 @@ doTmWdWd tmwdwd = case tmwdwd of
TmTmSetStatus x -> \tm -> fromMaybe id $ do
tid <- tm ^? tmID
return $ cWorld . lWorld . terminals . ix tid . tmStatus .~ x
TmTmSetPartialCommand x -> \tm -> fromMaybe id $ do
TmDisplayCommands -> \tm -> fromMaybe id $ do
tid <- tm ^? tmID
return $ cWorld . lWorld . terminals . ix tid . tmPartialCommand .~ x
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
TmWdWdDisconnectTerminal -> disconnectTerminal
TmWdWdTermSound sid -> \tm w ->