Refactor updates
This commit is contained in:
@@ -167,7 +167,7 @@ debugDraw' cfig w bl = case bl of
|
||||
Close_shape_culling -> mempty
|
||||
Bound_box_screen -> mempty
|
||||
Show_ms_frame -> mempty
|
||||
View_boundaries -> viewBoundaries w
|
||||
View_boundaries -> viewBoundaries (w ^. cWorld)
|
||||
Show_bound_box -> drawBoundingBox w
|
||||
Show_wall_search_rays -> drawWallSearchRays w
|
||||
Show_dda_test -> drawDDATest w
|
||||
@@ -176,7 +176,7 @@ debugDraw' cfig w bl = case bl of
|
||||
Inspect_wall -> drawInspectWalls w
|
||||
Cr_awareness -> drawCreatureDisplayTexts w
|
||||
Show_sound -> pictures $ M.map (soundPic cfig w) $ _playingSounds w
|
||||
Cr_status -> drawCrInfo cfig w
|
||||
Cr_status -> drawCrInfo cfig (w ^. cWorld . lWorld)
|
||||
Mouse_position -> drawMousePosition cfig w
|
||||
Walls_info -> drawWlIDs cfig w
|
||||
Pathing -> drawPathing cfig w
|
||||
@@ -436,22 +436,23 @@ crDisplayInfo cfig cam cr
|
||||
fpreShow :: (Show a, Functor f) => String -> f a -> f String
|
||||
fpreShow str = fmap (((rightPad 7 '.' str ++ "...") ++) . show)
|
||||
|
||||
drawCrInfo :: Configuration -> World -> Picture
|
||||
drawCrInfo :: Configuration -> LWorld -> Picture
|
||||
drawCrInfo cfig w =
|
||||
setLayer FixedCoordLayer $
|
||||
renderInfoListsAt (2 * hw - 400) 0 cfig w $
|
||||
mapMaybe (crDisplayInfo cfig (w ^. cWorld . lWorld . camPos)) $ IM.elems $ w ^. cWorld . lWorld . creatures
|
||||
renderInfoListsAt (2 * hw - 400) 0 cfig cam $
|
||||
mapMaybe (crDisplayInfo cfig cam) $ IM.elems $ w ^. creatures
|
||||
where
|
||||
cam = w ^. camPos
|
||||
hw = halfWidth cfig
|
||||
|
||||
viewBoundaries :: World -> Picture
|
||||
viewBoundaries :: CWorld -> Picture
|
||||
viewBoundaries w =
|
||||
setLayer DebugLayer $
|
||||
color green (foldMap (polygonWire . _grBound) grs)
|
||||
<> color yellow (foldMap (\q -> line [p, q]) $ farWallPoints p w)
|
||||
where
|
||||
p = _crPos $ you w
|
||||
grs = filter (pointInOrOnPolygon p . _grBound) (_cwgGameRooms $ _cwGen (_cWorld w))
|
||||
p = _crPos $ youc w
|
||||
grs = filter (pointInOrOnPolygon p . _grBound) (_cwgGameRooms $ _cwGen w)
|
||||
|
||||
viewClipBounds :: Configuration -> World -> Picture
|
||||
viewClipBounds cfig w
|
||||
|
||||
Reference in New Issue
Block a user