Work on inventory management

This commit is contained in:
2021-11-30 20:11:03 +00:00
parent 3754627e0d
commit 42d7ca3ba8
8 changed files with 154 additions and 85 deletions
+2 -15
View File
@@ -42,22 +42,9 @@ listTextPictureAt xoff yoff cfig yint = winScale cfig
hh = halfHeight cfig
renderListAt :: Float -> Float -> Configuration -> [(String,Color)] -> Picture
renderListAt tx ty cfig =
concatMapPic (winScale cfig) . zipWith (listPairAt tx ty cfig) [0..]
renderListAt tx ty cfig = listTextPicturesAt tx ty cfig . map (\(str,col) -> color col $ text str)
-- concatMapPic (winScale cfig) . zipWith (listPairAt tx ty cfig) [0..]
listPairAt
:: Float -- ^ x offset
-> Float -- ^ y offset
-> Configuration
-> Int -- ^ y offset (discrete)
-> (String,Color) -- ^ The text item
-> Picture
{-# INLINE listPairAt #-}
listPairAt xoff yoff cfig yint (s,col)
= translate (xoff + 15 - halfWidth cfig) (yoff + halfHeight cfig - (20 * (fromIntegral yint+1)))
. scale 0.1 0.1
. dShadCol col
$ text s
--TODO put the following functions in an appropriate place
{- | Colour picture and add black drop shadow. -}
dShadCol :: Color -> Picture -> Picture