Data-ify item drawing

This commit is contained in:
2022-07-11 00:33:59 +01:00
parent 75cd15c240
commit ad84e69d05
15 changed files with 102 additions and 81 deletions
+9 -5
View File
@@ -4,17 +4,19 @@ import Dodge.Default
import Picture
import Geometry.Data
import LensHelp
--import ShapePicture
import ShapePicture
import Shape
keyCard :: Int -> Item
keyCard n = defaultEquipment
{ _itEquipPict = \_ _ -> (,) emptySH $ setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) keyPic
, _itEffect = NoItEffect
{ _itEffect = NoItEffect
, _itID = Nothing
-- , _itZoom = defaultItZoom
, _itInvColor = aquamarine
}
& itType . iyBase .~ KEYCARD n
& itDimension . dimPortage .~ WornItem
& itDimension . dimSPic .~ (const . noShape)
(setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) keyPic)
keyPic :: Picture
keyPic = color green $
@@ -25,12 +27,14 @@ keyPic = color green $
latchkey :: Int -> Item
latchkey _ = defaultEquipment
{ _itEquipPict = \_ _ -> (,) emptySH $ setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) latchkeyPic
, _itEffect = NoItEffect
{ _itEffect = NoItEffect
, _itID = Nothing
-- , _itZoom = defaultItZoom
, _itInvColor = yellow
}
& itDimension . dimPortage .~ WornItem
& itDimension . dimSPic .~ ( \_ -> (,) emptySH $ setDepth 0 $ translate (-5) (-5) $ rotate (pi/2.5) latchkeyPic
)
latchkeyPic :: Picture
latchkeyPic = color yellow $
pictures [translate (-4) 0 $ thickCircle 4 2