Improve inventory rendering
This commit is contained in:
+5
-20
@@ -432,12 +432,12 @@ linePointsBetween p p' | d > 99 = map (\m -> p +.+ fromIntegral m *.* p'') [0..n
|
|||||||
p'' = (1/fromIntegral n) *.* (p' -.- p)
|
p'' = (1/fromIntegral n) *.* (p' -.- p)
|
||||||
|
|
||||||
displayInv :: Int -> World -> Picture
|
displayInv :: Int -> World -> Picture
|
||||||
displayInv n w = pictures $ zipWith (translate (10-halfWidth w))
|
displayInv n w = pictures $ zipWith (translate (15-halfWidth w))
|
||||||
(map (\x-> halfHeight w-(25*(fromIntegral x+1))) ns) $ map dItem' is
|
(map (\x-> halfHeight w-(25*(fromIntegral x+1))) ns) $ map dItem' is
|
||||||
where (ns,is) = unzip $ IM.toList $ _crInv $ _creatures w IM.! n
|
where (ns,is) = unzip $ IM.toList $ _crInv $ _creatures w IM.! n
|
||||||
|
|
||||||
dItem' NoItem = scale 0.1 0.1 $ dShadCol (greyN 0.5) $ text "----"
|
dItem' NoItem = scale 0.1 0.1 $ dShadCol (greyN 0.5) $ text "----"
|
||||||
dItem' i = scale 0.1 0.1 $ pictures [dropShadow t, color (_itInvColor i) t]
|
dItem' i = scale 0.1 0.1 $ dShadCol (_itInvColor i) t
|
||||||
where t = text $ _itInvDisplay i i
|
where t = text $ _itInvDisplay i i
|
||||||
|
|
||||||
displayAmount :: Int -> String
|
displayAmount :: Int -> String
|
||||||
@@ -504,26 +504,11 @@ ringPict = onLayer LabelLayer $ dShadCol white $ pictures [line [(-8,10),(-15,10
|
|||||||
|
|
||||||
dShadCol :: Color -> Picture -> Picture
|
dShadCol :: Color -> Picture -> Picture
|
||||||
dShadCol c p = pictures $
|
dShadCol c p = pictures $
|
||||||
map (flip (uncurry translate) p) [--(0.2,-0.2)
|
[ color black $ uncurry translate (1.2,-1.2) p
|
||||||
--,(0.4,-0.4)
|
, color c p
|
||||||
--,(0.6,-0.6)
|
|
||||||
--,(0.8,-0.8)
|
|
||||||
--,( 1,- 1)
|
|
||||||
(1.2,-1.2)
|
|
||||||
] ++ [color c p]
|
|
||||||
|
|
||||||
dropShadow :: Picture -> Picture
|
|
||||||
dropShadow p = pictures [ translate 5 (-5) p
|
|
||||||
, translate 1 (-1) p
|
|
||||||
, translate 2 (-2) p
|
|
||||||
, translate 3 (-3) p
|
|
||||||
, translate 4 (-4) p
|
|
||||||
, translate 6 (-6) p
|
|
||||||
, translate 7 (-7) p
|
|
||||||
, translate 8 (-8) p
|
|
||||||
, translate 9 (-9) p
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
ffToDraw :: World -> [ForceField]
|
ffToDraw :: World -> [ForceField]
|
||||||
ffToDraw w = filter (lineOnScreen w . _ffLine) $
|
ffToDraw w = filter (lineOnScreen w . _ffLine) $
|
||||||
IM.elems $ fmap (over ffLine (map (\p->p -.- _cameraPos w))) $
|
IM.elems $ fmap (over ffLine (map (\p->p -.- _cameraPos w))) $
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ tractorGun = autoGun
|
|||||||
, _itEquipPict = drawWeapon $ color blue $ pictures [polygon $ rectNESW 1.5 6 (-1.5) 0 ]
|
, _itEquipPict = drawWeapon $ color blue $ pictures [polygon $ rectNESW 1.5 6 (-1.5) 0 ]
|
||||||
}
|
}
|
||||||
launcher = defaultGun
|
launcher = defaultGun
|
||||||
{ _itName = "lAUNCHER"
|
{ _itName = "LAUNCHER"
|
||||||
, _itIdentity = Launcher
|
, _itIdentity = Launcher
|
||||||
, _wpMaxAmmo = 30
|
, _wpMaxAmmo = 30
|
||||||
, _wpLoadedAmmo = 30
|
, _wpLoadedAmmo = 30
|
||||||
|
|||||||
Reference in New Issue
Block a user