module Dodge.Render.Picture ( fixedCoordPictures, ) where import Control.Lens import Dodge.Base.WinScale import Dodge.Base.Window import Dodge.Data.Universe import Dodge.Render.HUD import Dodge.Render.List import Dodge.Render.MenuScreen import Geometry import Picture fixedCoordPictures :: Universe -> Picture fixedCoordPictures u = drawConcurrentMessage u <> customMouseCursor cfig (u ^. uvWorld) <> case u ^. uvScreenLayers of [] -> hudDrawings u (lay : _) -> (setDepth (-1) $ menuScreen' u lay) <> (setDepth (-1) . winScale cfig $ menuScreen u lay) where cfig = _uvConfig u drawConcurrentMessage :: Universe -> Picture drawConcurrentMessage u = stackPicturesAt (halfWidth cfig) (_windowY cfig - 50) cfig (map (centerText . f) $ u ^.. uvSideEffects . each) where cfig = _uvConfig u f (RunningSideEffect ce) = ce ++ " IN PROGRESS" f x = _ceString x ++ " QUEUED" customMouseCursor :: Configuration -> World -> Picture customMouseCursor cfig w = winScale cfig . uncurryV translate (_mousePos (_input w)) . color white $ pictures [line [V2 (-5) 0, V2 5 0], line [V2 0 (-5), V2 0 5]]