Simplify tank decorations
This commit is contained in:
@@ -18,8 +18,8 @@ drawMachine cw mc = case _mcType mc of
|
||||
McStatic -> mempty
|
||||
McTerminal -> terminalSPic lw mc
|
||||
McTurret tu -> drawBaseMachine 20 mc <> drawTurret lw tu mc
|
||||
McDamSensor se -> drawBaseMachine 25 mc <> drawDamSensor gp se mc
|
||||
McProxSensor se -> drawBaseMachine 25 mc <> drawProxSensor se mc
|
||||
McDamSensor se -> drawBaseMachine 25 mc <> drawDamSensor gp se
|
||||
McProxSensor {} -> drawBaseMachine 25 mc
|
||||
where
|
||||
lw = cw ^. lWorld
|
||||
gp = cw ^. cwGen . cwgParams . sensorCoding
|
||||
@@ -27,15 +27,11 @@ drawMachine cw mc = case _mcType mc of
|
||||
drawDamSensor ::
|
||||
M.Map SensorType (PaletteColor, DecorationShape) ->
|
||||
DamageSensor ->
|
||||
Machine ->
|
||||
SPic
|
||||
drawDamSensor gp sens mc = fold $ do
|
||||
drawDamSensor gp sens = fold $ do
|
||||
let st = sens ^. sensType
|
||||
x <- gp ^? ix st
|
||||
return $ sensorSPic x mc
|
||||
|
||||
drawProxSensor :: ProximitySensor -> Machine -> SPic
|
||||
drawProxSensor _ = const mempty
|
||||
return $ sensorSPic x
|
||||
|
||||
terminalSPic :: LWorld -> Machine -> SPic
|
||||
terminalSPic lw = noPic . terminalShape lw
|
||||
@@ -71,7 +67,7 @@ drawBaseMachine h mc =
|
||||
. colorSH (mcColor mc)
|
||||
. upperBox Medium Typical h
|
||||
. square
|
||||
$ _mcWidth mc
|
||||
$ 10
|
||||
|
||||
mcColor :: Machine -> Color
|
||||
mcColor mc = case mc ^. mcType of
|
||||
@@ -87,8 +83,8 @@ drawTurret lw tu mc = fold $ do
|
||||
itm <- lw ^? items . ix (tu ^. tuWeapon)
|
||||
return $ overPosSP (turretItemOffset itm tu mc) (itemSPic itm)
|
||||
|
||||
sensorSPic :: (PaletteColor, DecorationShape) -> Machine -> SPic
|
||||
sensorSPic (pc, ds) mc = noPic $ decorationToShape ds w w 25 col col
|
||||
sensorSPic :: (PaletteColor, DecorationShape) -> SPic
|
||||
sensorSPic (pc, ds) = noPic $ decorationToShape ds w w 25 col
|
||||
where
|
||||
col = paletteToColor pc
|
||||
w = _mcWidth mc
|
||||
w = 10
|
||||
|
||||
Reference in New Issue
Block a user