diff --git a/src/Dodge/Clock.hs b/src/Dodge/Clock.hs index cd096acf9..9d4e9a878 100644 --- a/src/Dodge/Clock.hs +++ b/src/Dodge/Clock.hs @@ -1,6 +1,4 @@ -module Dodge.Clock ( - clockCycle, -) where +module Dodge.Clock (clockCycle) where import Control.Lens import qualified Data.Vector as V diff --git a/src/Dodge/Data/Terminal/Status.hs b/src/Dodge/Data/Terminal/Status.hs index 7c00f76e2..3caaccd01 100644 --- a/src/Dodge/Data/Terminal/Status.hs +++ b/src/Dodge/Data/Terminal/Status.hs @@ -13,7 +13,6 @@ data TerminalStatus | TerminalLineRead | TerminalTextInput {_tiText :: String} | TerminalPressTo {_tptString :: String} - | TerminalWaiting deriving (Eq,Show) makeLenses ''TerminalStatus diff --git a/src/Dodge/Render/HUD.hs b/src/Dodge/Render/HUD.hs index ea08779d1..95b5da142 100644 --- a/src/Dodge/Render/HUD.hs +++ b/src/Dodge/Render/HUD.hs @@ -2,6 +2,9 @@ module Dodge.Render.HUD (drawHUD) where +import Dodge.Clock +import qualified Data.Vector as V +import Dodge.Terminal import Dodge.Inventory.CheckSlots import Control.Applicative import Control.Lens @@ -161,7 +164,7 @@ drawSubInventory subinv cfig w = case subinv of -- LockedInventory -> mempty -- topInvCursor col cursPos cfig w NoSubInventory{} -> drawRBOptions cfig w ExamineInventory -> drawExamineInventory cfig w - DisplayTerminal tid -> foldMap (drawTerminalDisplay cfig) + DisplayTerminal tid -> foldMap (drawTerminalDisplay (w ^.cWorld.lWorld) cfig) (w ^? cWorld . lWorld . terminals . ix tid) CombineInventory{_ciSections = sss} -> drawCombineInventory cfig sss w MapperInventory _ _ itid -> drawMapperInventory itid w @@ -358,8 +361,8 @@ combineInventoryExtra sss msel cfig w = fold $ do sss' (Just (0, i)) -drawTerminalDisplay :: Config -> Terminal -> Picture -drawTerminalDisplay cfig tm = +drawTerminalDisplay :: LWorld -> Config -> Terminal -> Picture +drawTerminalDisplay lw cfig tm = invHead cfig ("T-" ++ show tid) <> drawSelectionList secondColumnLDP cfig f <> color @@ -379,14 +382,12 @@ drawTerminalDisplay cfig tm = displayTermInput = case _tmStatus tm of TerminalOff -> id TerminalDeactivated -> id - TerminalLineRead -> id - TerminalWaiting -> (++ [("...",white)]) + TerminalLineRead -> (++ [(spincurs,termTextColor)]) TerminalTextInput s -> (++ [(getPromptTM ++ s ++ [cFilledRect], white)]) TerminalPressTo s -> (++ [("<" ++ s ++ ">", white)]) - --- | hasfoc = clockCycle 10 (V.fromList [[cFilledRect] , "."]) w + spincurs = clockCycle 4 (V.fromList ["/","-","\\","|"]) lw lnkMidPosInvSelsCol :: Config -> World -> Int -> Color -> [Int] -> Picture lnkMidPosInvSelsCol cfig w i col = fromMaybe mempty . foldMap f diff --git a/src/Dodge/Terminal.hs b/src/Dodge/Terminal.hs index 34ff1639c..6c2c156b1 100644 --- a/src/Dodge/Terminal.hs +++ b/src/Dodge/Terminal.hs @@ -13,6 +13,7 @@ module Dodge.Terminal ( tabComplete, tlSetStatus, tlDoEffect, + termTextColor, ) where import Color diff --git a/src/Dodge/Terminal/Color.hs b/src/Dodge/Terminal/Color.hs index 92ddce45f..aaaa15d35 100644 --- a/src/Dodge/Terminal/Color.hs +++ b/src/Dodge/Terminal/Color.hs @@ -12,4 +12,3 @@ termScreenColor tm = case tm ^. tmStatus of TerminalTextInput _ -> Just green TerminalPressTo{} -> Just green TerminalLineRead -> Just white - TerminalWaiting -> Just green diff --git a/src/Dodge/WorldEffect.hs b/src/Dodge/WorldEffect.hs index 4b166ad49..881cbb9b3 100644 --- a/src/Dodge/WorldEffect.hs +++ b/src/Dodge/WorldEffect.hs @@ -62,7 +62,6 @@ accessTerminal tid w = fromMaybe w $ do TerminalTextInput{} -> tm TerminalLineRead -> tm TerminalPressTo{} -> tm - TerminalWaiting{} -> tm TerminalOff -> tm & tmFutureLines .~ _tmBootLines tm