Cleanup
This commit is contained in:
@@ -4,6 +4,7 @@ module Dodge.Render.HUD
|
||||
)
|
||||
where
|
||||
import Dodge.Data
|
||||
import Dodge.WinScale
|
||||
import Dodge.Base
|
||||
import Dodge.Base.Window
|
||||
import Dodge.Inventory
|
||||
@@ -129,11 +130,11 @@ drawLocations cfig w = pictures $
|
||||
locTexts = map fst locs
|
||||
|
||||
displayListEndCoords :: Configuration -> [String] -> [Point2]
|
||||
displayListEndCoords w ss = map g $ zipWith h ss $ map f [1..]
|
||||
displayListEndCoords cfig ss = map (doWindowScale cfig) $ zipWith h ss $ map f [1..]
|
||||
where
|
||||
f :: Int -> Point2
|
||||
f i = V2 ( 15 - halfWidth w ) ( 2.5 + halfHeight w - (20 * fromIntegral i))
|
||||
g (V2 x y) = V2 (2*x / getWindowX w) ( 2*y / getWindowY w)
|
||||
f i = V2 ( 15 - halfWidth cfig ) ( 2.5 + halfHeight cfig - (20 * fromIntegral i))
|
||||
--g (V2 x y) = V2 (2*x / getWindowX w) ( 2*y / getWindowY w)
|
||||
h :: String -> Point2 -> Point2
|
||||
h s (V2 x y) = V2 (x + 9 * fromIntegral (length s)) y
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ fixedCoordPictures w = case _menuLayers w of
|
||||
]
|
||||
(lay:_) -> scaler . onLayer MenuDepth $ menuScreen w lay
|
||||
where
|
||||
scaler = setDepth (-1) . scale (2 / getWindowX cfig) (2 / getWindowY cfig)
|
||||
scaler = setDepth (-1) . winScale cfig
|
||||
cfig = _config w
|
||||
|
||||
customMouseCursor :: Configuration -> World -> Picture
|
||||
|
||||
@@ -35,7 +35,7 @@ worldSPic cfig w =
|
||||
where
|
||||
filtOn f g = IM.filter (pointIsClose . f) (g w)
|
||||
pointIsClose p = dist camCen p < winSize
|
||||
winSize = 30 + max (getWindowX cfig) (getWindowY cfig)
|
||||
winSize = 30 + max (_windowX cfig) (_windowY cfig)
|
||||
camCen = _cameraCenter w
|
||||
|
||||
extraShapes :: World -> Shape
|
||||
|
||||
Reference in New Issue
Block a user