Start to refactor terminals

This commit is contained in:
2024-11-05 21:14:53 +00:00
parent 79b03ef6ec
commit 7e1b5f0921
12 changed files with 335 additions and 341 deletions
+7 -5
View File
@@ -6,6 +6,7 @@ module Dodge.Render.HUD (
selNumPosCardinal, -- this shoud probably be pushed back here
) where
import Dodge.CharacterEnums
import Dodge.Creature.Test
import Dodge.DoubleTree
import Dodge.Data.DoubleTree
@@ -14,9 +15,9 @@ import Control.Lens
import Control.Monad
import qualified Data.Map.Strict as M
import Data.Maybe
import qualified Data.Vector as V
--import qualified Data.Vector as V
import Dodge.Base
import Dodge.Clock
--import Dodge.Clock
import Dodge.Creature.Info
import Dodge.Data.CardinalPoint
import Dodge.Data.Combine
@@ -360,11 +361,12 @@ displayTerminal tid cfig w = fromMaybe mempty $ do
(++ [(displayInputText tm s ++ displayBlinkCursor hasfoc, white)])
partcommand tm = maybe "" (++ " ") $ tm ^? tmPartialCommand . _Just . tcString
displayInputText tm s
| _tmStatus tm == TerminalReady = partcommand tm ++ "> " ++ s
| _tmStatus tm == TerminalReady = partcommand tm ++ _tmPromptString tm ++ s
| otherwise = ""
displayBlinkCursor hasfoc
| hasfoc = clockCycle 10 (V.fromList ["_", "."]) w
| otherwise = []
-- | hasfoc = clockCycle 10 (V.fromList [[cFilledRect] , "."]) w
| hasfoc = [cFilledRect]
| otherwise = [cWireRect]
lnkMidPosInvSelsCol :: Configuration -> World -> Int -> Color -> [Int] -> Picture
lnkMidPosInvSelsCol cfig w i col = fromMaybe mempty . foldMap f