Reify debug booleans

This commit is contained in:
2022-06-17 21:34:00 +01:00
parent 261bb0bb6b
commit 5053590792
10 changed files with 73 additions and 49 deletions
+6 -6
View File
@@ -93,7 +93,7 @@ mcSPic bt = uncurryV translateSPf (_mcPos bt)
soundPics :: Configuration -> World -> Picture
soundPics cfig w
| _debug_show_sound cfig = pictures $ M.map (soundPic cfig w) $ _playingSounds w
| debugOn Show_sound cfig = pictures $ M.map (soundPic cfig w) $ _playingSounds w
| otherwise = []
soundPic :: Configuration -> World -> Sound -> Picture
@@ -111,7 +111,7 @@ soundPic cfig w s = fixedSizePicClampArrow 50 50 thePic p cfig w
drawMousePosition :: Configuration -> World -> Picture
drawMousePosition cfig w
| not $ _debug_mouse_position cfig = mempty
| not $ debugOn Mouse_position cfig = mempty
| otherwise
= setLayer FixedCoordLayer . winScale cfig
. uncurryV translate p
@@ -124,7 +124,7 @@ drawMousePosition cfig w
drawWallIDs :: Configuration -> World -> Picture
drawWallIDs cfig w
| _debug_walls cfig = setLayer FixedCoordLayer
| debugOn Walls_info cfig = setLayer FixedCoordLayer
$ foldMap f (_walls w)
| otherwise = mempty
where
@@ -140,7 +140,7 @@ drawWallIDs cfig w
drawPathing :: Configuration -> World -> Picture
drawPathing cfig w
| _debug_pathing cfig
| debugOn Pathing cfig
= setLayer DebugLayer $
(color green . pictures . map (thickLine 5 . tflat2) $ graphToEdges gr)
<> concatMap dispInc (graphToIncidence gr)
@@ -170,7 +170,7 @@ crDisplayInfo cfig w cr
drawCrInfo :: Configuration -> World -> Picture
drawCrInfo cfig w
| _debug_cr_status cfig = setLayer FixedCoordLayer
| debugOn Cr_status cfig = setLayer FixedCoordLayer
$ renderInfoListsAt (2*hw - 400) 0 cfig w
$ mapMaybe (crDisplayInfo cfig w) $ IM.elems $ _creatures w
| otherwise = mempty
@@ -179,7 +179,7 @@ drawCrInfo cfig w
viewBoundaries :: Configuration -> World -> Picture
viewBoundaries cfig w
| _debug_view_boundaries cfig
| debugOn View_boundaries cfig
= setLayer DebugLayer $ color green (concatMap (polygonWire . _grBound) grs)
<> color yellow (concatMap (\q -> line [p,q]) $ farWallPoints p w)
| otherwise = []