Allow for more changable terminal screen colors

This commit is contained in:
2024-11-17 10:18:04 +00:00
parent a0431ff9a3
commit e7ea5d7fa9
11 changed files with 232 additions and 207 deletions
+7 -10
View File
@@ -2,6 +2,7 @@ module Dodge.Machine.Draw (
drawMachine,
) where
import Dodge.Terminal.Color
import Control.Lens
import Data.Maybe
import Dodge.Data.LWorld
@@ -41,22 +42,18 @@ terminalShape lw mc = fromMaybe mempty $ do
[V3 10 10 20, V3 (-10) 10 20, V3 (-10) (-10) 10, V3 10 (-10) 10]
(addZ 0 `map` rectWH 10 10)
)
<> colorSH
(getTermScreenColor term)
<> screenbackground (getcol term)
where
getcol term = fromMaybe black $ termScreenColor term
screenbackground col = colorSH
col
( prismBox
Small
Superfluous
Typical
[V3 8 8 20, V3 (-8) 8 20, V3 0 (-8) 10]
[V3 8 8 19, V3 (-8) 8 19, V3 0 (-8) 9]
--[V3 8 8 20, V3 (-8) 8 20, V3 (-8) (-8) 10, V3 8 (-8) 10]
--[V3 8 8 19, V3 (-8) 8 19, V3 (-8) (-8) 9, V3 8 (-8) 9]
)
getTermScreenColor :: Terminal -> Color
getTermScreenColor tm = case _tmStatus tm of
TerminalOff -> black
_ -> _tmScreenColor tm
drawBaseMachine :: Float -> Machine -> SPic
drawBaseMachine h mc =
noPic
+2 -2
View File
@@ -2,6 +2,7 @@ module Dodge.Machine.Update (
updateMachine,
) where
import Dodge.Terminal.Color
import Control.Monad
import Data.List (partition)
import Data.Maybe
@@ -34,8 +35,7 @@ terminalScreenGlow :: Machine -> World -> World
terminalScreenGlow mc w = fromMaybe w $ do
tid <- mc ^? mcMounts . ix ObTerminal
term <- w ^? cWorld . lWorld . terminals . ix tid
guard (_tmStatus term /= TerminalOff)
let V4 x y z _ = _tmScreenColor term
V4 x y z _ <- termScreenColor term
return $
w & cWorld . lWorld . tempLightSources
.:~ TLS