Add toggle for visual sounds

This commit is contained in:
2021-09-22 11:37:07 +01:00
parent a4fbe6126c
commit fa7d8e1b50
7 changed files with 14 additions and 34 deletions
+7 -3
View File
@@ -11,6 +11,7 @@ import Dodge.Picture.Layer
import Dodge.Render.HUD
import Dodge.Render.MenuScreen
import Dodge.SoundLogic.LoadSound
import Dodge.Config.Data
import Sound.Data
import Geometry
import Picture
@@ -35,6 +36,7 @@ worldPictures w = pictures
,concatMapPic ppDraw $ _pressPlates w
,concatMapPic btDraw $ _buttons w
,concatMapPic drawWallFloor $ wallFloorsToDraw w
,soundPics w
]
where
crIsClose cr = dist (_crPos cr) camCen < winSize
@@ -59,8 +61,8 @@ customMouseCursor w =
$ pictures [ line [V2 (-5) 0,V2 5 0] , line [V2 0 (-5),V2 0 5] ]
testPic :: World -> Picture
testPic w = pictures
[ soundPics w
testPic _ = pictures
[
-- , fixedSizePicClampArrow 10 50 thepic (mouseWorldPos w) w
]
-- where
@@ -69,7 +71,9 @@ testPic w = pictures
--testPic w = color green . pictures . map (flip thickLine 5 . tflat2) . graphToEdges $ _pathGraph w
soundPics :: World -> Picture
soundPics w = pictures $ M.map (soundPic w) $ _playingSounds w
soundPics w
| _show_sound (_config w) = pictures $ M.map (soundPic w) $ _playingSounds w
| otherwise = []
soundPic :: World -> Sound -> Picture
soundPic w s = fixedSizePicClampArrow 50 50 thePic p w