Refactor, try to limit dependencies
This commit is contained in:
+14
-17
@@ -1,29 +1,26 @@
|
||||
module Dodge.Render.InfoBox where
|
||||
import Dodge.Data
|
||||
--import Dodge.Base.Window
|
||||
--import Dodge.Base.WinScale
|
||||
|
||||
import Dodge.Base
|
||||
import Dodge.Data.Universe
|
||||
import Dodge.Render.Connectors
|
||||
import Dodge.Render.List
|
||||
import Dodge.Base
|
||||
import Picture
|
||||
import Geometry
|
||||
import Picture
|
||||
|
||||
--import qualified Control.Foldl as L
|
||||
--import Control.Monad
|
||||
--import Data.Maybe
|
||||
|
||||
renderInfoListAt :: Float -> Float -> Configuration -> World -> (Point2,[String]) -> Picture
|
||||
renderInfoListAt x y cfig w (p,ss) = renderListAt x y cfig (zip ss (repeat white))
|
||||
<> winScale cfig (color white $ lConnect (V2 (x-hw) (hh-25-y)) (worldPosToScreen w p))
|
||||
<> listCursorNSW x y cfig 0 white 19 (length ss)
|
||||
renderInfoListAt :: Float -> Float -> Configuration -> World -> (Point2, [String]) -> Picture
|
||||
renderInfoListAt x y cfig w (p, ss) =
|
||||
renderListAt x y cfig (zip ss (repeat white))
|
||||
<> winScale cfig (color white $ lConnect (V2 (x - hw) (hh -25 - y)) (worldPosToScreen w p))
|
||||
<> listCursorNSW x y cfig 0 white 19 (length ss)
|
||||
where
|
||||
hw = halfWidth cfig
|
||||
hh = halfHeight cfig
|
||||
|
||||
renderInfoListsAt :: Float -> Float -> Configuration -> World -> [(Point2,[String])] -> Picture
|
||||
renderInfoListsAt x y cfig w =
|
||||
fst . foldr f (mempty,0)
|
||||
renderInfoListsAt :: Float -> Float -> Configuration -> World -> [(Point2, [String])] -> Picture
|
||||
renderInfoListsAt x y cfig w =
|
||||
fst . foldr f (mempty, 0)
|
||||
where
|
||||
f (p,ss) (pic,offset) = (pic <> renderInfoListAt x (y + offset) cfig w (p,ss)
|
||||
f (p, ss) (pic, offset) =
|
||||
( pic <> renderInfoListAt x (y + offset) cfig w (p, ss)
|
||||
, offset + 20 * fromIntegral (length ss)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user