Cleanup
This commit is contained in:
+36
-44
@@ -1,7 +1,6 @@
|
||||
{-# LANGUAGE LambdaCase #-}
|
||||
module Dodge.Render.Picture (
|
||||
fixedCoordPictures,
|
||||
) where
|
||||
|
||||
module Dodge.Render.Picture (fixedCoordPictures) where
|
||||
|
||||
import Control.Lens
|
||||
import Data.Maybe
|
||||
@@ -62,18 +61,18 @@ fpsText x = color col . text $ "ms/frame " ++ show x
|
||||
| otherwise = red
|
||||
|
||||
drawMenuOrHUD :: Config -> Universe -> Picture
|
||||
drawMenuOrHUD cfig u = case u ^. uvScreenLayers of
|
||||
drawMenuOrHUD cf u = case u ^. uvScreenLayers of
|
||||
[] -> drawHUD (u ^. uvConfig) (u ^. uvWorld)
|
||||
(x : _) -> drawMenuScreen cfig (u ^? uvWorld . input . mouseContext . mcoMenuClick) x
|
||||
(x : _) -> drawMenuScreen (u ^? uvWorld . input . mouseContext . mcoMenuClick) x cf
|
||||
|
||||
drawConcurrentMessage :: Universe -> Picture
|
||||
drawConcurrentMessage u =
|
||||
translate 0 (50 - halfHeight cfig)
|
||||
translate 0 (50 - halfHeight cf)
|
||||
. stackPicturesAt
|
||||
. map (centerText . f)
|
||||
$ u ^.. uvSideEffects . each
|
||||
where
|
||||
cfig = _uvConfig u
|
||||
cf = _uvConfig u
|
||||
f (RunningSideEffect ce) = ce ++ " IN PROGRESS"
|
||||
f x = _ceString x ++ " QUEUED"
|
||||
|
||||
@@ -131,43 +130,32 @@ drawCursorByTerminalStatus = \case
|
||||
_ -> drawEmptySet 5
|
||||
|
||||
drawQuitTerminal :: Float -> Picture
|
||||
drawQuitTerminal x = fold
|
||||
[ line [V2 x x, V2 (- x) (- x)]
|
||||
, line [V2 x (-x), V2 (- x) x]
|
||||
, polygonWire (square x)
|
||||
]
|
||||
drawQuitTerminal x =
|
||||
line [V2 x x, V2 (- x) (- x)]
|
||||
<> line [V2 x (- x), V2 (- x) x]
|
||||
<> polygonWire (square x)
|
||||
|
||||
drawEmptySet :: Float -> Picture
|
||||
drawEmptySet x =
|
||||
fold
|
||||
[ line [V2 x x, V2 (- x) (- x)]
|
||||
, circle x
|
||||
]
|
||||
drawEmptySet x = line [V2 x x, V2 (- x) (- x)] <> circle x
|
||||
|
||||
drawReturn :: Float -> Picture
|
||||
drawReturn x =
|
||||
fold
|
||||
[ line [V2 0 0, V2 y y]
|
||||
, line [V2 0 0, V2 y (- y)]
|
||||
, line [V2 0 0, V2 (2 * y) 0]
|
||||
, line [V2 (2 * y) 0, V2 (2 * y) (2 * x)]
|
||||
]
|
||||
line [V2 0 0, V2 y y]
|
||||
<> line [V2 0 0, V2 y (- y)]
|
||||
<> line [V2 0 0, V2 (2 * y) 0]
|
||||
<> line [V2 (2 * y) 0, V2 (2 * y) (2 * x)]
|
||||
where
|
||||
y = 0.7 * x
|
||||
|
||||
--drawReturn = scale 0.1 0.1 . translate (-50) (-100) $ text [toEnum 153]
|
||||
|
||||
drawPlus :: Float -> Picture
|
||||
drawPlus x = fold [line [V2 (- x) 0, V2 x 0], line [V2 0 (- x), V2 0 x]]
|
||||
|
||||
drawMenuClick :: Float -> Picture
|
||||
drawMenuClick z =
|
||||
fold
|
||||
[ line [V2 y 0, V2 x 0]
|
||||
, line [V2 ny 0, V2 nx 0]
|
||||
, line [V2 0 ny, V2 0 nx]
|
||||
, line [V2 0 y, V2 0 x]
|
||||
]
|
||||
line [V2 y 0, V2 x 0]
|
||||
<> line [V2 ny 0, V2 nx 0]
|
||||
<> line [V2 0 ny, V2 0 nx]
|
||||
<> line [V2 0 y, V2 0 x]
|
||||
where
|
||||
x = 0.5 * z
|
||||
y = x + z
|
||||
@@ -176,12 +164,10 @@ drawMenuClick z =
|
||||
|
||||
drawMenuCursor :: Float -> Picture
|
||||
drawMenuCursor z =
|
||||
fold
|
||||
[ line [V2 y 0, V2 x 0]
|
||||
, line [V2 ny 0, V2 nx 0]
|
||||
, line [V2 0 ny, V2 0 nx]
|
||||
, line [V2 0 y, V2 0 x]
|
||||
]
|
||||
line [V2 y 0, V2 x 0]
|
||||
<> line [V2 ny 0, V2 nx 0]
|
||||
<> line [V2 0 ny, V2 0 nx]
|
||||
<> line [V2 0 y, V2 0 x]
|
||||
where
|
||||
x = z
|
||||
y = x + z
|
||||
@@ -278,12 +264,10 @@ drawCombFilter x =
|
||||
|
||||
drawGapPlus :: Float -> Picture
|
||||
drawGapPlus x =
|
||||
fold
|
||||
[ line [V2 (-1.5 * x) 0, V2 (-0.5 * x) 0]
|
||||
, line [V2 (0.5 * x) 0, V2 (1.5 * x) 0]
|
||||
, line [V2 (0.5 * x) (- x), V2 (0.5 * x) x]
|
||||
, line [V2 (-0.5 * x) (- x), V2 (-0.5 * x) x]
|
||||
]
|
||||
line [V2 (-1.5 * x) 0, V2 (-0.5 * x) 0]
|
||||
<> line [V2 (0.5 * x) 0, V2 (1.5 * x) 0]
|
||||
<> line [V2 (0.5 * x) (- x), V2 (0.5 * x) x]
|
||||
<> line [V2 (-0.5 * x) (- x), V2 (-0.5 * x) x]
|
||||
|
||||
aimDelaySweep :: Universe -> Picture
|
||||
aimDelaySweep u = fold $ do
|
||||
@@ -297,7 +281,15 @@ drawAimSweep cr w = fold $ do
|
||||
a <- safeArgV (mwp -.- p)
|
||||
return $
|
||||
uncurryV translate (worldPosToScreen campos p) $
|
||||
arcFull (a - rot) 10 white (a + diffAngles cdir a - rot) 1 white (5 + dist mwp p * campos ^. camZoom) white
|
||||
arcFull
|
||||
(a - rot)
|
||||
10
|
||||
white
|
||||
(a + diffAngles cdir a - rot)
|
||||
1
|
||||
white
|
||||
(5 + dist mwp p * campos ^. camZoom)
|
||||
white
|
||||
where
|
||||
cdir = _crDir cr
|
||||
rot = campos ^. camRot
|
||||
|
||||
Reference in New Issue
Block a user