Move toward adding infoboxes/better creature information display

This commit is contained in:
2022-04-10 10:16:15 +01:00
parent a6fdd66b9b
commit 901fab762a
16 changed files with 44 additions and 66 deletions
+25 -4
View File
@@ -13,9 +13,12 @@ module Dodge.Creature.Picture
import Dodge.Data
--import Dodge.Base
import Dodge.Creature.Test
import Dodge.Render.InfoBox
import Dodge.Render.List
--import Dodge.Creature.AlertLevel.Data
--import Dodge.Picture.Layer
import Dodge.Clock
import Dodge.Debug.Picture
import Picture
import Geometry
import Shape
@@ -71,8 +74,26 @@ basicCrShape col cr = tr . scaleSH (V3 crsize crsize crsize) $ mconcat
rotmdir = rotateSH (_crMvDir cr)
. colorSH (greyN 0.3)
crDisplayInfo :: Configuration -> World -> Creature -> (Point2,[String])
crDisplayInfo cfig w cr = (_crPos cr,
[show $_crGoal ap
,show $ _crStrategy ap
,show $ _crAction ap
,show $ _crImpulse ap
]
)
where
ap = _crActionPlan cr
crOnScreen = pointOnScreen cfig w $ _crPos cr
creatureDisplayText :: Configuration -> World -> Creature -> Picture
creatureDisplayText cfig w cr
creatureDisplayText cfig w cr = setLayer 4 . setDepth 50
$ color white $ renderListAt 0 0 cfig $ zip ["TEST","ME"] $ repeat white
-- $ renderInfoListAt 0 0 cfig w
-- $ crDisplayInfo cfig w cr
creatureDisplayText' :: Configuration -> World -> Creature -> Picture
creatureDisplayText' cfig w cr
| not (_debug_cr_status cfig) = []
| otherwise
= setLayer 4
@@ -82,10 +103,10 @@ creatureDisplayText cfig w cr
. rotate (0.5 * pi)
-- . rotate (argV v - 0.5 * pi)
. scale theScale theScale
. centerText
. stackText
$ clockCycle 25 (V.fromList
[ crDisplayAwake
, crDisplayAlert
[ \cr' -> [crDisplayAwake cr']
, \cr' -> [crDisplayAlert cr']
]
) w cr
where