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)
|
||||
|
||||
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
|
||||
where (ns,is) = unzip $ IM.toList $ _crInv $ _creatures w IM.! n
|
||||
|
||||
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
|
||||
|
||||
displayAmount :: Int -> String
|
||||
@@ -504,25 +504,10 @@ ringPict = onLayer LabelLayer $ dShadCol white $ pictures [line [(-8,10),(-15,10
|
||||
|
||||
dShadCol :: Color -> Picture -> Picture
|
||||
dShadCol c p = pictures $
|
||||
map (flip (uncurry translate) p) [--(0.2,-0.2)
|
||||
--,(0.4,-0.4)
|
||||
--,(0.6,-0.6)
|
||||
--,(0.8,-0.8)
|
||||
--,( 1,- 1)
|
||||
(1.2,-1.2)
|
||||
] ++ [color c p]
|
||||
[ color black $ uncurry translate (1.2,-1.2) p
|
||||
, 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 w = filter (lineOnScreen w . _ffLine) $
|
||||
|
||||
@@ -331,7 +331,7 @@ tractorGun = autoGun
|
||||
, _itEquipPict = drawWeapon $ color blue $ pictures [polygon $ rectNESW 1.5 6 (-1.5) 0 ]
|
||||
}
|
||||
launcher = defaultGun
|
||||
{ _itName = "lAUNCHER"
|
||||
{ _itName = "LAUNCHER"
|
||||
, _itIdentity = Launcher
|
||||
, _wpMaxAmmo = 30
|
||||
, _wpLoadedAmmo = 30
|
||||
|
||||
Reference in New Issue
Block a user