Improve terminal color possibilities
This commit is contained in:
+37
-29
@@ -1,8 +1,10 @@
|
||||
module Dodge.Machine.Draw
|
||||
( drawMachine
|
||||
) where
|
||||
module Dodge.Machine.Draw (
|
||||
drawMachine,
|
||||
) where
|
||||
|
||||
import Dodge.Data.Machine
|
||||
import Control.Lens
|
||||
import Data.Maybe
|
||||
import Dodge.Data.LWorld
|
||||
import Dodge.Item.Draw.SPic
|
||||
import Dodge.Item.HeldOffset
|
||||
import Dodge.Placement.TopDecoration
|
||||
@@ -11,10 +13,10 @@ import Picture
|
||||
import Shape
|
||||
import ShapePicture
|
||||
|
||||
drawMachine :: Machine -> SPic
|
||||
drawMachine mc = case _mcType mc of
|
||||
drawMachine :: LWorld -> Machine -> SPic
|
||||
drawMachine lw mc = case _mcType mc of
|
||||
McStatic -> mempty
|
||||
McTerminal -> terminalSPic mc
|
||||
McTerminal -> terminalSPic lw mc
|
||||
McTurret tu -> drawBaseMachine 20 mc <> drawTurret tu mc
|
||||
McSensor se -> drawBaseMachine 25 mc <> drawSensor se mc
|
||||
|
||||
@@ -23,31 +25,37 @@ drawSensor sens = case sens of
|
||||
DamageSensor{_sensDraw = pcds} -> sensorSPic pcds
|
||||
ProximitySensor{} -> const mempty
|
||||
|
||||
terminalSPic :: Machine -> SPic
|
||||
terminalSPic = noPic . terminalShape
|
||||
terminalSPic :: LWorld -> Machine -> SPic
|
||||
terminalSPic lw = noPic . terminalShape lw
|
||||
|
||||
terminalShape :: Machine -> Shape
|
||||
terminalShape mc =
|
||||
colorSH
|
||||
col
|
||||
( prismBox
|
||||
Medium
|
||||
Typical
|
||||
[V3 10 10 20, V3 (-10) 10 20, V3 (-10) (-10) 10, V3 10 (-10) 10]
|
||||
(addZ 0 `map` rectWH 10 10)
|
||||
)
|
||||
<> colorSH
|
||||
black
|
||||
terminalShape :: LWorld -> Machine -> Shape
|
||||
terminalShape lw mc = fromMaybe mempty $ do
|
||||
tid <- mc ^? mcMounts . ix ObTerminal
|
||||
term <- lw ^? terminals . ix tid
|
||||
return $
|
||||
colorSH
|
||||
(_tmExternalColor term)
|
||||
( prismBox
|
||||
Small
|
||||
Superfluous
|
||||
[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]
|
||||
Medium
|
||||
Typical
|
||||
[V3 10 10 20, V3 (-10) 10 20, V3 (-10) (-10) 10, V3 10 (-10) 10]
|
||||
(addZ 0 `map` rectWH 10 10)
|
||||
)
|
||||
where
|
||||
col = _mcColor mc
|
||||
<> colorSH
|
||||
(getTermScreenColor term)
|
||||
( prismBox
|
||||
Small
|
||||
Superfluous
|
||||
[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 =
|
||||
|
||||
Reference in New Issue
Block a user