Cleanup warnings
This commit is contained in:
+12
-14
@@ -1,16 +1,13 @@
|
||||
module Dodge.Render.HUD
|
||||
where
|
||||
|
||||
import Dodge.Data
|
||||
import Dodge.Base
|
||||
import Dodge.Inventory
|
||||
|
||||
import Picture
|
||||
import Geometry
|
||||
|
||||
import Data.Maybe
|
||||
import qualified Data.IntMap as IM
|
||||
|
||||
import Control.Lens
|
||||
|
||||
hudDrawings :: World -> Picture
|
||||
@@ -40,7 +37,7 @@ displayListTopLeft :: [(String,Color)] -> World -> [Picture]
|
||||
displayListTopLeft scols w =
|
||||
map scaler $ zipWith
|
||||
(translate (15-halfWidth w))
|
||||
( map (\x -> halfHeight w - (20 * (fromIntegral x+1))) [0..] )
|
||||
( map (\x -> halfHeight w - (20 * (fromIntegral x+1))) ([0..]::[Int]) )
|
||||
( map (\(s,col) -> scale 0.1 0.1 . dShadCol col $ text s) scols )
|
||||
where
|
||||
scaler = scale (2 / getWindowX w) (2 / getWindowY w)
|
||||
@@ -55,15 +52,15 @@ itemStringCol NoItem = ("----", greyN 0.5)
|
||||
itemStringCol itm = (_itInvDisplay itm itm, _itInvColor itm)
|
||||
|
||||
drawLocations :: World -> [Picture]
|
||||
drawLocations w = displayListTopLeft locs w
|
||||
++ zipWith bFunc (displayListEndCoords w locTexts) locPoss
|
||||
++ mapOverlay w
|
||||
++ [drawListCursor white iPos w]
|
||||
drawLocations wrld = displayListTopLeft locs wrld
|
||||
++ zipWith bFunc (displayListEndCoords wrld locTexts) locPoss
|
||||
++ mapOverlay wrld
|
||||
++ [drawListCursor white iPos wrld]
|
||||
where
|
||||
iPos = _selLocation w
|
||||
locs = map (\(_,s) -> (s,white)) . IM.elems . _seenLocations $ w
|
||||
locPoss = map (cartePosToScreen w . ($ w) . fst) . IM.elems . _seenLocations $ w
|
||||
zoom = _carteZoom w
|
||||
iPos = _selLocation wrld
|
||||
locs = map (\(_,s) -> (s,white)) . IM.elems . _seenLocations $ wrld
|
||||
locPoss = map (cartePosToScreen wrld . ($ wrld) . fst) . IM.elems . _seenLocations $ wrld
|
||||
--cZoom = _carteZoom w
|
||||
locTexts = map fst locs
|
||||
bFunc (x,y) (z,w) = pictures
|
||||
[ bezierQuad (withAlpha 0.0 white) (withAlpha 0.2 white) 0.050 0.010 (x,y) (0,y) (z,w)
|
||||
@@ -72,7 +69,7 @@ drawLocations w = displayListTopLeft locs w
|
||||
] --cheapo antialiasing
|
||||
|
||||
displayListCoords :: World -> [Point2]
|
||||
displayListCoords w = map (g . f) [1..]
|
||||
displayListCoords w = map (g . f) [(1::Int)..]
|
||||
where
|
||||
f i = ( 15 - halfWidth w , halfHeight w - (20 * fromIntegral i) )
|
||||
g (x,y) = (2*x / getWindowX w, 2*y / getWindowY w)
|
||||
@@ -106,7 +103,7 @@ mapWall w wl =
|
||||
|
||||
{- | Pictures of popup text for items close to your position.-}
|
||||
closeObjectTexts :: World -> Picture
|
||||
closeObjectTexts w = pictures $ zipWith renderList [0..] (map colAndText $ _closeActiveObjects w)
|
||||
closeObjectTexts w = pictures $ zipWith renderList [(0::Int)..] (map colAndText $ _closeActiveObjects w)
|
||||
++ maybeToList maybeLine
|
||||
where
|
||||
colAndText (Left x) = (_itInvColor $ _flIt x, _itName $ _flIt x)
|
||||
@@ -126,6 +123,7 @@ closeObjectTexts w = pictures $ zipWith renderList [0..] (map colAndText $ _clos
|
||||
maybeLeft (Left x) = Just x
|
||||
maybeLeft _ = Nothing
|
||||
pushout = 140
|
||||
xtran :: Int -> Float
|
||||
xtran 0 = case mayIt of Nothing -> 25
|
||||
_ -> -25
|
||||
xtran _ = 0
|
||||
|
||||
Reference in New Issue
Block a user